diff --git a/assets/About--s9Eeedt.js b/assets/About-BJ53y4VU.js similarity index 93% rename from assets/About--s9Eeedt.js rename to assets/About-BJ53y4VU.js index ad040b1..5a62f0b 100644 --- a/assets/About--s9Eeedt.js +++ b/assets/About-BJ53y4VU.js @@ -1 +1 @@ -import{f as p,j as e,c as j,z as v,V as B,w as F,x as A,l as D,g as N,M as _,B as f}from"./index-CtCGTwpN.js";import{T as x,O as M,a as u,F as P}from"./Footer-BC_OGLFm.js";import{C as V,a as H,H as w,b as I}from"./heading-eSNaMiYV.js";import{m as C,S as O}from"./stack-DvvG7f8C.js";import{I as Y}from"./image-jfUXVBUx.js";const y=p(function(s,a){const{templateAreas:o,gap:i,rowGap:n,columnGap:r,column:c,row:m,autoFlow:h,autoRows:g,templateRows:S,autoColumns:R,templateColumns:T,...E}=s,L={display:"grid",gridTemplateAreas:o,gridGap:i,gridRowGap:n,gridColumnGap:r,gridAutoColumns:R,gridColumn:c,gridRow:m,gridAutoFlow:h,gridAutoRows:g,gridTemplateRows:S,gridTemplateColumns:T};return e.jsx(j.div,{ref:a,__css:L,...E})});y.displayName="Grid";const k=p(function(s,a){const{columns:o,spacingX:i,spacingY:n,spacing:r,minChildWidth:c,...m}=s,h=v(),g=c?W(c,h):$(o);return e.jsx(y,{ref:a,gap:r,columnGap:i,rowGap:n,templateColumns:g,...m})});k.displayName="SimpleGrid";function z(t){return typeof t=="number"?`${t}px`:t}function W(t,s){return C(t,a=>{const o=B("sizes",a,z(a))(s);return a===null?null:`repeat(auto-fit, minmax(${o}, 1fr))`})}function $(t){return C(t,s=>s===null?null:`repeat(${s}, minmax(0, 1fr))`)}const l=p(function(s,a){const o=F("Link",s),{className:i,isExternal:n,...r}=A(s);return e.jsx(j.a,{target:n?"_blank":void 0,rel:n?"noopener":void 0,ref:a,className:D("chakra-link",i),...r,__css:o})});l.displayName="Link";const G=p((t,s)=>e.jsx(O,{align:"center",...t,direction:"column",ref:s}));G.displayName="VStack";const U=()=>{const{t}=N();return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:t("about.title"),description:t("about.description"),children:e.jsxs(V,{height:"100%",overflow:"auto",padding:"20px",children:[e.jsx(H,{children:e.jsx(w,{as:"h1",children:t("about.title")})}),e.jsx(I,{children:e.jsxs(G,{spacing:"6",align:"start",children:[e.jsx(x,{children:t("about.introduction")}),e.jsxs(d,{heading:t("about.generalDescription.h"),content:t("about.generalDescription.p"),children:[e.jsx(x,{children:t("about.steps.introduction")}),e.jsxs(M,{children:[e.jsx(u,{children:t("about.steps.1")}),e.jsx(u,{children:t("about.steps.2")}),e.jsx(u,{children:t("about.steps.3")}),e.jsx(u,{children:t("about.steps.4")})]})]}),e.jsx(b,{images:["images/about/about1.png","images/WelcomeMessage2.png","images/WelcomeMessage3.png"],alttext:["Screenshot of the map that is visible on the start screen of openpv.de.","Screenhot of a simulated building.","Screenshot of a PV system that is drawn on a simulated building together with an estimated annual PV yield."]}),e.jsxs(d,{heading:t("about.data.h"),children:[t("about.data.p1")," ",e.jsx(l,{href:"https://www.dwd.de/DE/leistungen/cdc/climate-data-center.html",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",t("about.data.p2")," ",e.jsx(l,{href:"https://sonny.4lima.de/",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",t("about.data.p3")," ",e.jsx(l,{href:"https://www.bkg.bund.de/DE/Home/home.html",isExternal:!0,color:"teal",children:"[DL-DE/BY-2-0]"}),"."]}),e.jsx(d,{heading:t("about.whyOpenSource.h"),content:t("about.whyOpenSource.p")}),e.jsx(d,{heading:t("about.team.h"),content:t("about.team.p"),children:e.jsx(l,{href:"https://github.com/orgs/open-pv/people",isExternal:!0,color:"teal",children:t("about.team.link")})}),e.jsx(d,{heading:t("about.sponsors.h"),content:t("about.sponsors.p")}),e.jsx(b,{images:["images/about/ptf.png","images/about/bmbf.jpg"],alttext:["Logo of the Prototypefund.","Logo of the German Federal Ministry of Education and Research."],links:["https://prototypefund.de/","https://www.bmbf.de"],objectFit:"contain"})]})})]})}),e.jsx(P,{})]})};function d({content:t,heading:s,children:a}){return e.jsxs(f,{children:[e.jsx(w,{as:"h3",size:"md",children:s}),e.jsx(x,{children:t}),a]})}const b=({images:t,alttext:s,links:a=[],objectFit:o="cover"})=>e.jsx(k,{columns:t.length,spacing:4,children:t.map((i,n)=>{const r=e.jsx(Y,{src:i,objectFit:o,width:"100%",height:"150px",borderRadius:"md",alt:s[n]});return e.jsx(f,{padding:2,children:a[n]?e.jsx(l,{href:a[n],isExternal:!0,children:r}):r},n)})});export{U as default}; +import{f as p,j as e,c as j,z as v,V as B,w as F,x as A,l as D,g as N,M as _,B as f}from"./index-DZP_WaxS.js";import{T as x,O as M,a as u,F as P}from"./Footer-C3QM0Uoc.js";import{C as V,a as H,H as w,b as I}from"./heading-D46BZoGw.js";import{m as C,S as O}from"./stack-D-KFs-Nt.js";import{I as Y}from"./image-x7XY6IFe.js";const y=p(function(s,a){const{templateAreas:o,gap:i,rowGap:n,columnGap:r,column:c,row:m,autoFlow:h,autoRows:g,templateRows:S,autoColumns:R,templateColumns:T,...E}=s,L={display:"grid",gridTemplateAreas:o,gridGap:i,gridRowGap:n,gridColumnGap:r,gridAutoColumns:R,gridColumn:c,gridRow:m,gridAutoFlow:h,gridAutoRows:g,gridTemplateRows:S,gridTemplateColumns:T};return e.jsx(j.div,{ref:a,__css:L,...E})});y.displayName="Grid";const k=p(function(s,a){const{columns:o,spacingX:i,spacingY:n,spacing:r,minChildWidth:c,...m}=s,h=v(),g=c?W(c,h):$(o);return e.jsx(y,{ref:a,gap:r,columnGap:i,rowGap:n,templateColumns:g,...m})});k.displayName="SimpleGrid";function z(t){return typeof t=="number"?`${t}px`:t}function W(t,s){return C(t,a=>{const o=B("sizes",a,z(a))(s);return a===null?null:`repeat(auto-fit, minmax(${o}, 1fr))`})}function $(t){return C(t,s=>s===null?null:`repeat(${s}, minmax(0, 1fr))`)}const l=p(function(s,a){const o=F("Link",s),{className:i,isExternal:n,...r}=A(s);return e.jsx(j.a,{target:n?"_blank":void 0,rel:n?"noopener":void 0,ref:a,className:D("chakra-link",i),...r,__css:o})});l.displayName="Link";const G=p((t,s)=>e.jsx(O,{align:"center",...t,direction:"column",ref:s}));G.displayName="VStack";const U=()=>{const{t}=N();return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:t("about.title"),description:t("about.description"),children:e.jsxs(V,{height:"100%",overflow:"auto",padding:"20px",children:[e.jsx(H,{children:e.jsx(w,{as:"h1",children:t("about.title")})}),e.jsx(I,{children:e.jsxs(G,{spacing:"6",align:"start",children:[e.jsx(x,{children:t("about.introduction")}),e.jsxs(d,{heading:t("about.generalDescription.h"),content:t("about.generalDescription.p"),children:[e.jsx(x,{children:t("about.steps.introduction")}),e.jsxs(M,{children:[e.jsx(u,{children:t("about.steps.1")}),e.jsx(u,{children:t("about.steps.2")}),e.jsx(u,{children:t("about.steps.3")}),e.jsx(u,{children:t("about.steps.4")})]})]}),e.jsx(b,{images:["images/about/about1.png","images/WelcomeMessage2.png","images/WelcomeMessage3.png"],alttext:["Screenshot of the map that is visible on the start screen of openpv.de.","Screenhot of a simulated building.","Screenshot of a PV system that is drawn on a simulated building together with an estimated annual PV yield."]}),e.jsxs(d,{heading:t("about.data.h"),children:[t("about.data.p1")," ",e.jsx(l,{href:"https://www.dwd.de/DE/leistungen/cdc/climate-data-center.html",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",t("about.data.p2")," ",e.jsx(l,{href:"https://sonny.4lima.de/",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",t("about.data.p3")," ",e.jsx(l,{href:"https://www.bkg.bund.de/DE/Home/home.html",isExternal:!0,color:"teal",children:"[DL-DE/BY-2-0]"}),"."]}),e.jsx(d,{heading:t("about.whyOpenSource.h"),content:t("about.whyOpenSource.p")}),e.jsx(d,{heading:t("about.team.h"),content:t("about.team.p"),children:e.jsx(l,{href:"https://github.com/orgs/open-pv/people",isExternal:!0,color:"teal",children:t("about.team.link")})}),e.jsx(d,{heading:t("about.sponsors.h"),content:t("about.sponsors.p")}),e.jsx(b,{images:["images/about/ptf.png","images/about/bmbf.jpg"],alttext:["Logo of the Prototypefund.","Logo of the German Federal Ministry of Education and Research."],links:["https://prototypefund.de/","https://www.bmbf.de"],objectFit:"contain"})]})})]})}),e.jsx(P,{})]})};function d({content:t,heading:s,children:a}){return e.jsxs(f,{children:[e.jsx(w,{as:"h3",size:"md",children:s}),e.jsx(x,{children:t}),a]})}const b=({images:t,alttext:s,links:a=[],objectFit:o="cover"})=>e.jsx(k,{columns:t.length,spacing:4,children:t.map((i,n)=>{const r=e.jsx(Y,{src:i,objectFit:o,width:"100%",height:"150px",borderRadius:"md",alt:s[n]});return e.jsx(f,{padding:2,children:a[n]?e.jsx(l,{href:a[n],isExternal:!0,children:r}):r},n)})});export{U as default}; diff --git a/assets/Datenschutz-BRFAolcR.js b/assets/Datenschutz-BrIseX2Y.js similarity index 98% rename from assets/Datenschutz-BRFAolcR.js rename to assets/Datenschutz-BrIseX2Y.js index c4e6d77..59df01b 100644 --- a/assets/Datenschutz-BRFAolcR.js +++ b/assets/Datenschutz-BrIseX2Y.js @@ -1 +1 @@ -import{j as e,M as n}from"./index-CtCGTwpN.js";import{C as r,a as i,H as t,b as s}from"./heading-eSNaMiYV.js";const u=()=>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,{as:"h1",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{u as default}; +import{j as e,M as n}from"./index-DZP_WaxS.js";import{C as r,a as i,H as t,b as s}from"./heading-D46BZoGw.js";const u=()=>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,{as:"h1",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{u as default}; diff --git a/assets/Footer-BC_OGLFm.js b/assets/Footer-BC_OGLFm.js deleted file mode 100644 index 3d02686..0000000 --- a/assets/Footer-BC_OGLFm.js +++ /dev/null @@ -1,41 +0,0 @@ -import{d as c,i as Hn,X as Un,Y as Vn,Z as $n,k as ct,y as ge,l as I,j as v,c as E,Q as pe,$ as zn,f as O,w as Ft,x as He,a0 as Yn,q as ut,N as Ae,R as qn,D as Pt,I as Xn,v as lt,s as J,A as ye,P as Kn,a1 as Zn,m as ie,K as Qn,a2 as Jn,g as er,a3 as tr}from"./index-CtCGTwpN.js";function nr(e){return c.Children.toArray(e).filter(t=>c.isValidElement(t))}const rr=e=>e.hasAttribute("tabindex");function ar(e){if(!Hn(e)||Un(e)||Vn(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]():$n(e)?!0:rr(e)}const or=["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]"],ir=or.join(),sr=e=>e.offsetWidth>0&&e.offsetHeight>0;function cr(e){const t=Array.from(e.querySelectorAll(ir));return t.unshift(e),t.filter(n=>ar(n)&&sr(n))}function ur(e={}){const{onClose:t,onOpen:n,isOpen:r,id:a}=e,o=ct(n),s=ct(t),[i,m]=c.useState(e.defaultIsOpen||!1),u=r!==void 0?r:i,h=r!==void 0,l=c.useId(),d=a??`disclosure-${l}`,p=c.useCallback(()=>{h||m(!1),s==null||s()},[h,s]),b=c.useCallback(()=>{h||m(!0),o==null||o()},[h,o]),f=c.useCallback(()=>{u?p():b()},[u,b,p]);function g(y={}){return{...y,"aria-expanded":u,"aria-controls":d,onClick(x){var S;(S=y.onClick)==null||S.call(y,x),f()}}}function w(y={}){return{...y,hidden:!u,id:d}}return{isOpen:u,onOpen:b,onClose:p,onToggle:f,isControlled:h,getButtonProps:g,getDisclosureProps:w}}const dt={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 jo(e){switch((e==null?void 0:e.direction)??"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}}const D={enter:{duration:.2,ease:dt.easeOut},exit:{duration:.1,ease:dt.easeIn}},B={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})},[Go,lr]=ge({strict:!1,name:"ButtonGroupContext"});function ee(e){const{children:t,className:n,...r}=e,a=c.isValidElement(t)?c.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=I("chakra-button__icon",n);return v.jsx(E.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o,children:a})}ee.displayName="ButtonIcon";function Te(e){const{label:t,placement:n,spacing:r="0.5rem",children:a=v.jsx(zn,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:s,...i}=e,m=I("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",h=c.useMemo(()=>pe({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,t,u,r]);return v.jsx(E.div,{className:m,...i,__css:h,children:a})}Te.displayName="ButtonSpinner";function dr(e){const[t,n]=c.useState(!e);return{ref:c.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}const Nt=O((e,t)=>{const n=lr(),r=Ft("Button",{...n,...e}),{isDisabled:a=n==null?void 0:n.isDisabled,isLoading:o,isActive:s,children:i,leftIcon:m,rightIcon:u,loadingText:h,iconSpacing:l="0.5rem",type:d,spinner:p,spinnerPlacement:b="start",className:f,as:g,shouldWrapChildren:w,...y}=He(e),x=c.useMemo(()=>{const N={...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:N}}},[r,n]),{ref:S,type:C}=dr(g),F={rightIcon:u,leftIcon:m,iconSpacing:l,children:i,shouldWrapChildren:w};return v.jsxs(E.button,{disabled:a||o,ref:Yn(t,S),as:g,type:d??C,"data-active":ut(s),"data-loading":ut(o),__css:x,className:I("chakra-button",f),...y,children:[o&&b==="start"&&v.jsx(Te,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:l,children:p}),o?h||v.jsx(E.span,{opacity:0,children:v.jsx(ft,{...F})}):v.jsx(ft,{...F}),o&&b==="end"&&v.jsx(Te,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:l,children:p})]})});Nt.displayName="Button";function ft(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:a,shouldWrapChildren:o}=e;return o?v.jsxs("span",{style:{display:"contents"},children:[t&&v.jsx(ee,{marginEnd:a,children:t}),r,n&&v.jsx(ee,{marginStart:a,children:n})]}):v.jsxs(v.Fragment,{children:[t&&v.jsx(ee,{marginEnd:a,children:t}),r,n&&v.jsx(ee,{marginStart:a,children:n})]})}function fr(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 _e="data-focus-lock",Et="data-focus-lock-disabled",vr="data-no-focus-lock",mr="data-autofocus-inside",hr="data-no-autofocus";function ke(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pr(e,t){var n=c.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 br=typeof window<"u"?c.useLayoutEffect:c.useEffect,vt=new WeakMap;function It(e,t){var n=pr(null,function(r){return e.forEach(function(a){return ke(a,r)})});return br(function(){var r=vt.get(n);if(r){var a=new Set(r),o=new Set(e),s=n.current;a.forEach(function(i){o.has(i)||ke(i,null)}),o.forEach(function(i){a.has(i)||ke(i,s)})}vt.set(n,e)},[e]),n}var Fe={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(Br)},jr=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Ye=jr.join(","),Gr="".concat(Ye,", [data-focus-guard]"),$t=function(e,t){return A((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?Gr:Ye)?[r]:[],$t(r))},[])},Wr=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=$t(r,t),s=(a=[]).concat.apply(a,o.map(function(i){return Wr(i,t)}));return n.concat(s,r.parentNode?A(r.parentNode.querySelectorAll(Ye)).filter(function(i){return i===r}):[])},[])},Hr=function(e){var t=e.querySelectorAll("[".concat(mr,"]"));return A(t).map(function(n){return X([n])}).reduce(function(n,r){return n.concat(r)},[])},qe=function(e,t){return A(e).filter(function(n){return Gt(t,n)}).filter(function(n){return _r(n)})},mt=function(e,t){return t===void 0&&(t=new Map),A(e).filter(function(n){return Wt(t,n)})},Xe=function(e,t,n){return ze(qe(X(e,n),t),!0,n)},re=function(e,t){return ze(qe(X(e),t),!1)},Ur=function(e,t){return qe(Hr(e),t)},R=function(e,t){return e.shadowRoot?R(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:A(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?R(a,t):!1}return R(n,t)})},Vr=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)})},zt=function(e){return e.parentNode?zt(e.parentNode):e},Ke=function(e){var t=j(e);return t.filter(Boolean).reduce(function(n,r){var a=r.getAttribute(_e);return n.push.apply(n,a?Vr(A(zt(r).querySelectorAll("[".concat(_e,'="').concat(a,'"]:not([').concat(Et,'="disabled"])')))):[r]),n},[])},$r=function(e){try{return e()}catch{return}},ae=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?ae(t.shadowRoot):t instanceof HTMLIFrameElement&&$r(function(){return t.contentWindow.document})?ae(t.contentWindow.document):t}},zr=function(e,t){return e===t},Yr=function(e,t){return!!A(e.querySelectorAll("iframe")).some(function(n){return zr(n,t)})},Yt=function(e,t){return t===void 0&&(t=ae(Bt(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Ke(e).some(function(n){return R(n,t)||Yr(n,t)})},qr=function(e){e===void 0&&(e=document);var t=ae(e);return t?A(e.querySelectorAll("[".concat(vr,"]"))).some(function(n){return R(n,t)}):!1},Xr=function(e,t){return t.filter(Vt).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Ze=function(e,t){return Vt(e)&&e.name?Xr(e,t):e},Kr=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)})},ht=function(e){return e[0]&&e.length>1?Ze(e[0],e):e[0]},pt=function(e,t){return e.indexOf(Ze(t,e))},Be="NEW_FOCUS",Zr=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 u=r!==void 0?n.indexOf(r):-1,h=a?n.indexOf(a):u,l=a?e.indexOf(a):-1;if(u===-1)return l!==-1?l:Be;if(l===-1)return Be;var d=u-h,p=n.indexOf(s),b=n.indexOf(i),f=Kr(n),g=r!==void 0?f.indexOf(r):-1,w=g-(a?f.indexOf(a):u);if(!d&&l>=0||t.length===0)return l;var y=pt(e,t[0]),x=pt(e,t[t.length-1]);if(u<=p&&m&&Math.abs(d)>1)return x;if(u>=b&&m&&Math.abs(d)>1)return y;if(d&&Math.abs(w)>1)return l;if(u<=p)return x;if(u>b)return y;if(d)return Math.abs(d)>1?l:(o+l+d)%o}},Qr=function(e){return function(t){var n,r=(n=Ht(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},bt=function(e,t,n){var r=e.map(function(o){var s=o.node;return s}),a=mt(r.filter(Qr(n)));return a&&a.length?ht(a):ht(mt(t))},Re=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Re(e.parentNode.host||e.parentNode,t),t},Pe=function(e,t){for(var n=Re(e),r=Re(t),a=0;a=0)return o}return!1},qt=function(e,t,n){var r=j(e),a=j(t),o=r[0],s=!1;return a.filter(Boolean).forEach(function(i){s=Pe(s||i,i)||s,n.filter(Boolean).forEach(function(m){var u=Pe(o,m);u&&(!s||R(u,s)?s=u:s=Pe(u,s))})}),s},gt=function(e,t){return e.reduce(function(n,r){return n.concat(Ur(r,t))},[])},Jr=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(Dr)},ea=function(e,t){var n=ae(j(e).length>0?document:Bt(e).ownerDocument),r=Ke(e).filter(De),a=qt(n||e,e,r),o=new Map,s=re(r,o),i=s.filter(function(b){var f=b.node;return De(f)});if(i[0]){var m=re([a],o).map(function(b){var f=b.node;return f}),u=Jr(m,i),h=u.map(function(b){var f=b.node;return f}),l=u.filter(function(b){var f=b.tabIndex;return f>=0}).map(function(b){var f=b.node;return f}),d=Zr(h,l,m,n,t);if(d===Be){var p=bt(s,l,gt(r,o))||bt(s,h,gt(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:u[d]}},ta=function(e){var t=Ke(e).filter(De),n=qt(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())},Ne=0,Ee=!1,Xt=function(e,t,n){n===void 0&&(n={});var r=ea(e,t);if(!Ee&&r){if(Ne>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Ee=!0,setTimeout(function(){Ee=!1},1);return}Ne++,Qe(r.node,n.focusOptions),Ne--}};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 na=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}},ra=function(e){var t,n,r,a,o;if(e)for(var s=e.stack,i=e.ownerDocument,m=new Map,u=0,h=s;u-1&&(g.filter(function(y){var x=y.guard,S=y.node;return x&&S.dataset.focusAutoGuard}).forEach(function(y){var x=y.node;return x.removeAttribute("tabIndex")}),xt(w,g.length,1,g),xt(w,-1,-1,g))}}}return t},tn=function(t){be()&&t&&(t.stopPropagation(),t.preventDefault())},tt=function(){return Je(be)},wa=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||ha(r,n)},Sa=function(){return null},nn=function(){et=!0},rn=function(){et=!1,oe="just",Je(function(){oe="meanwhile"})},Ca=function(){document.addEventListener("focusin",tn),document.addEventListener("focusout",tt),window.addEventListener("focus",nn),window.addEventListener("blur",rn)},ka=function(){document.removeEventListener("focusin",tn),document.removeEventListener("focusout",tt),window.removeEventListener("focus",nn),window.removeEventListener("blur",rn)};function Fa(e){return e.filter(function(t){var n=t.disabled;return!n})}var an={moveFocusInside:Xt,focusInside:Yt,focusNextElement:sa,focusPrevElement:ca,focusFirstElement:ua,focusLastElement:la,captureFocusRestore:Kt};function Pa(e){var t=e.slice(-1)[0];t&&!z&&Ca();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?(P=null,(!r||n.observed!==t.observed)&&t.onActivation(an),be(),Je(be)):(ka(),P=null)}Lt.assignSyncMedium(wa);Dt.assignMedium(tt);xr.assignMedium(function(e){return e(an)});const Na=Er(Fa,Pa)(Sa);var je=c.forwardRef(function(t,n){return c.createElement(Ve,Ae({sideCar:Na,ref:n},t))}),on=Ve.propTypes||{};on.sideCar;fr(on,["sideCar"]);je.propTypes={};const Ea=je.default??je,sn=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:a,children:o,isDisabled:s,autoFocus:i,persistentFocus:m,lockFocusAcrossFrames:u}=e,h=c.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&cr(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),l=c.useCallback(()=>{var p;(p=n==null?void 0:n.current)==null||p.focus()},[n]),d=a&&!n;return v.jsx(Ea,{crossFrame:u,persistentFocus:m,autoFocus:i,disabled:s,onActivation:h,onDeactivation:l,returnFocus:d,children:o})};sn.displayName="FocusLock";const[Ia,cn]=ge({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),nt=O(function(t,n){const r=Pt("List",t),{children:a,styleType:o="none",stylePosition:s,spacing:i,...m}=He(t),u=nr(a),l=i?{["& > *:not(style) ~ *:not(style)"]:{mt:i}}:{};return v.jsx(Ia,{value:r,children:v.jsx(E.ul,{ref:n,listStyleType:o,listStylePosition:s,role:"list",__css:{...r.container,...l},...m,children:u})})});nt.displayName="List";const Oa=O((e,t)=>{const{as:n,...r}=e;return v.jsx(nt,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});Oa.displayName="OrderedList";const Ma=O(function(t,n){const{as:r,...a}=t;return v.jsx(nt,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...a})});Ma.displayName="UnorderedList";const Aa=O(function(t,n){const r=cn();return v.jsx(E.li,{ref:n,...t,__css:r.item})});Aa.displayName="ListItem";const Ta=O(function(t,n){const r=cn();return v.jsx(Xn,{ref:n,role:"presentation",...t,__css:r.icon})});Ta.displayName="ListIcon";var _a=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},U=new WeakMap,le=new WeakMap,de={},Ie=0,un=function(e){return e&&(e.host||un(e.parentNode))},La=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=un(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})},Da=function(e,t,n,r){var a=La(t,Array.isArray(e)?e:[e]);de[n]||(de[n]=new WeakMap);var o=de[n],s=[],i=new Set,m=new Set(a),u=function(l){!l||i.has(l)||(i.add(l),u(l.parentNode))};a.forEach(u);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&&le.set(d,!0),g===1&&d.setAttribute(n,"true"),b||d.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",d,w)}})};return h(t),i.clear(),Ie++,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||(le.has(l)||l.removeAttribute(r),le.delete(l)),p||l.removeAttribute(n)}),Ie--,Ie||(U=new WeakMap,U=new WeakMap,le=new WeakMap,de={})}},Ba=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=_a(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),Da(r,a,n,"aria-hidden")):function(){return null}},Ra=Object.defineProperty,ja=(e,t,n)=>t in e?Ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ga=(e,t,n)=>(ja(e,t+"",n),n);class Wa{constructor(){Ga(this,"modals"),this.modals=new Set}add(t){return this.modals.add(t),this.modals.size}remove(t){this.modals.delete(t)}isTopModal(t){if(!t)return!1;const n=Array.from(this.modals)[this.modals.size-1];return t===n}}const Ge=new Wa;function ln(e,t){const[n,r]=c.useState(0);return c.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}function Ha(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:a=!0,closeOnEsc:o=!0,useInert:s=!0,onOverlayClick:i,onEsc:m}=e,u=c.useRef(null),h=c.useRef(null),[l,d,p]=Va(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Ua(u,t&&s);const b=ln(u,t),f=c.useRef(null),g=c.useCallback(k=>{f.current=k.target},[]),w=c.useCallback(k=>{k.key==="Escape"&&(k.stopPropagation(),o&&(n==null||n()),m==null||m())},[o,n,m]),[y,x]=c.useState(!1),[S,C]=c.useState(!1),F=c.useCallback((k={},K=null)=>({role:"dialog",...k,ref:lt(K,u),id:l,tabIndex:-1,"aria-modal":!0,"aria-labelledby":y?d:void 0,"aria-describedby":S?p:void 0,onClick:J(k.onClick,ce=>ce.stopPropagation())}),[p,S,l,d,y]),N=c.useCallback(k=>{k.stopPropagation(),f.current===k.target&&Ge.isTopModal(u.current)&&(a&&(n==null||n()),i==null||i())},[n,a,i]),_=c.useCallback((k={},K=null)=>({...k,ref:lt(K,h),onClick:J(k.onClick,N),onKeyDown:J(k.onKeyDown,w),onMouseDown:J(k.onMouseDown,g)}),[w,g,N]);return{isOpen:t,onClose:n,headerId:d,bodyId:p,setBodyMounted:C,setHeaderMounted:x,dialogRef:u,overlayRef:h,getDialogProps:F,getDialogContainerProps:_,index:b}}function Ua(e,t){const n=e.current;c.useEffect(()=>{if(!(!e.current||!t))return Ba(e.current)},[t,e,n])}function Va(e,...t){const n=c.useId(),r=e||n;return c.useMemo(()=>t.map(a=>`${a}-${r}`),[r,t])}const[$a,se]=ge({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[za,G]=ge({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),dn=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,preserveScrollBarGap:!0,motionPreset:"scale",...e,lockFocusAcrossFrames:e.lockFocusAcrossFrames||!0},{portalProps:n,children:r,autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:u,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p,animatePresenceProps:b,onCloseComplete:f}=t,g=Pt("Modal",t),y={...Ha(t),autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:u,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p};return v.jsx(za,{value:y,children:v.jsx($a,{value:g,children:v.jsx(ye,{...b,onExitComplete:f,children:y.isOpen&&v.jsx(Kn,{...n,children:r})})})})};dn.displayName="Modal";var me="right-scroll-bar-position",he="width-before-scroll-bar",Ya="with-scroll-bars-hidden",qa="--removed-body-scroll-bar-size",fn=Tt(),Oe=function(){},xe=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Oe,onWheelCapture:Oe,onTouchMoveCapture:Oe}),a=r[0],o=r[1],s=e.forwardProps,i=e.children,m=e.className,u=e.removeScrollBar,h=e.enabled,l=e.shards,d=e.sideCar,p=e.noIsolation,b=e.inert,f=e.allowPinchZoom,g=e.as,w=g===void 0?"div":g,y=e.gapMode,x=Ot(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=d,C=It([n,t]),F=M(M({},x),a);return c.createElement(c.Fragment,null,h&&c.createElement(S,{sideCar:fn,removeScrollBar:u,shards:l,noIsolation:p,inert:b,setCallbacks:o,allowPinchZoom:!!f,lockRef:n,gapMode:y}),s?c.cloneElement(c.Children.only(i),M(M({},F),{ref:C})):c.createElement(w,M({},F,{className:m,ref:C}),i))});xe.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xe.classNames={fullWidth:he,zeroRight:me};var Xa=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ka(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Xa();return t&&e.setAttribute("nonce",t),e}function Za(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qa(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ja=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ka())&&(Za(t,n),Qa(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eo=function(){var e=Ja();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vn=function(){var e=eo(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},to={left:0,top:0,right:0,gap:0},Me=function(e){return parseInt(e||"",10)||0},no=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[Me(n),Me(r),Me(a)]},ro=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return to;var t=no(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])}},ao=vn(),q="data-scroll-locked",oo=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(Ya,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(i,"px ").concat(r,`; - } - body[`).concat(q,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(a,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(i,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(me,` { - right: `).concat(i,"px ").concat(r,`; - } - - .`).concat(he,` { - margin-right: `).concat(i,"px ").concat(r,`; - } - - .`).concat(me," .").concat(me,` { - right: 0 `).concat(r,`; - } - - .`).concat(he," .").concat(he,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(q,`] { - `).concat(qa,": ").concat(i,`px; - } -`)},wt=function(){var e=parseInt(document.body.getAttribute(q)||"0",10);return isFinite(e)?e:0},io=function(){c.useEffect(function(){return document.body.setAttribute(q,(wt()+1).toString()),function(){var e=wt()-1;e<=0?document.body.removeAttribute(q):document.body.setAttribute(q,e.toString())}},[])},so=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;io();var o=c.useMemo(function(){return ro(a)},[a]);return c.createElement(ao,{styles:oo(o,!t,a,n?"":"!important")})},We=!1;if(typeof window<"u")try{var fe=Object.defineProperty({},"passive",{get:function(){return We=!0,!0}});window.addEventListener("test",fe,fe),window.removeEventListener("test",fe,fe)}catch{We=!1}var V=We?{passive:!1}:!1,co=function(e){return e.tagName==="TEXTAREA"},mn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!co(e)&&n[t]==="visible")},uo=function(e){return mn(e,"overflowY")},lo=function(e){return mn(e,"overflowX")},St=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=hn(e,r);if(a){var o=pn(e,r),s=o[1],i=o[2];if(s>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fo=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vo=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hn=function(e,t){return e==="v"?uo(t):lo(t)},pn=function(e,t){return e==="v"?fo(t):vo(t)},mo=function(e,t){return e==="h"&&t==="rtl"?-1:1},ho=function(e,t,n,r,a){var o=mo(e,window.getComputedStyle(t).direction),s=o*r,i=n.target,m=t.contains(i),u=!1,h=s>0,l=0,d=0;do{var p=pn(e,i),b=p[0],f=p[1],g=p[2],w=f-g-o*b;(b||w)&&hn(e,i)&&(l+=w,d+=b),i instanceof ShadowRoot?i=i.host:i=i.parentNode}while(!m&&i!==document.body||m&&(t.contains(i)||t===i));return(h&&(Math.abs(l)<1||!a)||!h&&(Math.abs(d)<1||!a))&&(u=!0),u},ve=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ct=function(e){return[e.deltaX,e.deltaY]},kt=function(e){return e&&"current"in e?e.current:e},po=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bo=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},go=0,$=[];function yo(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),a=c.useState(go++)[0],o=c.useState(vn)[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var f=gr([e.lockRef.current],(e.shards||[]).map(kt),!0).filter(Boolean);return f.forEach(function(g){return g.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),f.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=c.useCallback(function(f,g){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var w=ve(f),y=n.current,x="deltaX"in f?f.deltaX:y[0]-w[0],S="deltaY"in f?f.deltaY:y[1]-w[1],C,F=f.target,N=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in f&&N==="h"&&F.type==="range")return!1;var _=St(N,F);if(!_)return!0;if(_?C=N:(C=N==="v"?"h":"v",_=St(N,F)),!_)return!1;if(!r.current&&"changedTouches"in f&&(x||S)&&(r.current=C),!C)return!0;var k=r.current||C;return ho(k,g,f,k==="h"?x:S,!0)},[]),m=c.useCallback(function(f){var g=f;if(!(!$.length||$[$.length-1]!==o)){var w="deltaY"in g?Ct(g):ve(g),y=t.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&po(C.delta,w)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var x=(s.current.shards||[]).map(kt).filter(Boolean).filter(function(C){return C.contains(g.target)}),S=x.length>0?i(g,x[0]):!s.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),u=c.useCallback(function(f,g,w,y){var x={name:f,delta:g,target:w,should:y,shadowParent:xo(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),h=c.useCallback(function(f){n.current=ve(f),r.current=void 0},[]),l=c.useCallback(function(f){u(f.type,Ct(f),f.target,i(f,e.lockRef.current))},[]),d=c.useCallback(function(f){u(f.type,ve(f),f.target,i(f,e.lockRef.current))},[]);c.useEffect(function(){return $.push(o),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",m,V),document.addEventListener("touchmove",m,V),document.addEventListener("touchstart",h,V),function(){$=$.filter(function(f){return f!==o}),document.removeEventListener("wheel",m,V),document.removeEventListener("touchmove",m,V),document.removeEventListener("touchstart",h,V)}},[]);var p=e.removeScrollBar,b=e.inert;return c.createElement(c.Fragment,null,b?c.createElement(o,{styles:bo(a)}):null,p?c.createElement(so,{gapMode:e.gapMode}):null)}function xo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wo=yr(fn,yo);var bn=c.forwardRef(function(e,t){return c.createElement(xe,M({},e,{ref:t,sideCar:wo}))});bn.classNames=xe.classNames;function So(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:a,blockScrollOnMount:o,allowPinchZoom:s,finalFocusRef:i,returnFocusOnClose:m,preserveScrollBarGap:u,lockFocusAcrossFrames:h,isOpen:l}=G(),[d,p]=Zn();c.useEffect(()=>{!d&&p&&setTimeout(p)},[d,p]);const b=ln(r,l);return v.jsx(sn,{autoFocus:t,isDisabled:!n,initialFocusRef:a,finalFocusRef:i,restoreFocus:m,contentRef:r,lockFocusAcrossFrames:h,children:v.jsx(bn,{removeScrollBar:!u,allowPinchZoom:s,enabled:b===1&&o,forwardProps:!0,children:e.children})})}const Co={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:a})=>({opacity:0,x:e,y:t,transition:(n==null?void 0:n.exit)??B.exit(D.exit,a),transitionEnd:r==null?void 0:r.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??B.enter(D.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:a,delay:o})=>{const s={x:t,y:e};return{opacity:0,transition:(n==null?void 0:n.exit)??B.exit(D.exit,o),...a?{...s,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...s,...r==null?void 0:r.exit}}}}},te={initial:"initial",animate:"enter",exit:"exit",variants:Co},ko=c.forwardRef(function(t,n){const{unmountOnExit:r,in:a,reverse:o=!0,className:s,offsetX:i=0,offsetY:m=8,transition:u,transitionEnd:h,delay:l,animatePresenceProps:d,...p}=t,b=r?a&&r:!0,f=a||r?"enter":"exit",g={offsetX:i,offsetY:m,reverse:o,transition:u,transitionEnd:h,delay:l};return v.jsx(ye,{...d,custom:g,children:b&&v.jsx(ie.div,{ref:n,className:I("chakra-offset-slide",s),custom:g,...te,animate:f,...p})})});ko.displayName="SlideFade";const Fo={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:a})=>({opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(n==null?void 0:n.exit)??B.exit(D.exit,a)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??B.enter(D.enter,n),transitionEnd:e==null?void 0:e.enter})},gn={initial:"exit",animate:"enter",exit:"exit",variants:Fo},Po=c.forwardRef(function(t,n){const{unmountOnExit:r,in:a,reverse:o=!0,initialScale:s=.95,className:i,transition:m,transitionEnd:u,delay:h,animatePresenceProps:l,...d}=t,p=r?a&&r:!0,b=a||r?"enter":"exit",f={initialScale:s,reverse:o,transition:m,transitionEnd:u,delay:h};return v.jsx(ye,{...l,custom:f,children:p&&v.jsx(ie.div,{ref:n,className:I("chakra-offset-slide",i),...gn,animate:b,custom:f,...d})})});Po.displayName="ScaleFade";const No={slideInBottom:{...te,custom:{offsetY:16,reverse:!0}},slideInRight:{...te,custom:{offsetX:16,reverse:!0}},slideInTop:{...te,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...te,custom:{offsetX:-16,reverse:!0}},scale:{...gn,custom:{initialScale:.95,reverse:!0}},none:{}},Eo=E(ie.section),Io=e=>No[e||"none"],yn=c.forwardRef((e,t)=>{const{preset:n,motionProps:r=Io(n),...a}=e;return v.jsx(Eo,{ref:t,...r,...a})});yn.displayName="ModalTransition";const xn=O((e,t)=>{const{className:n,children:r,containerProps:a,motionProps:o,...s}=e,{getDialogProps:i,getDialogContainerProps:m}=G(),u=i(s,t),h=m(a),l=I("chakra-modal__content",n),d=se(),p=pe({display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...d.dialog}),b=pe({display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...d.dialogContainer}),{motionPreset:f}=G();return v.jsx(So,{children:v.jsx(E.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:b,children:v.jsx(yn,{preset:f,motionProps:o,className:l,...u,__css:p,children:r})})})});xn.displayName="ModalContent";const wn=O((e,t)=>{const{className:n,...r}=e,{bodyId:a,setBodyMounted:o}=G();c.useEffect(()=>(o(!0),()=>o(!1)),[o]);const s=I("chakra-modal__body",n),i=se();return v.jsx(E.div,{ref:t,className:s,id:a,...r,__css:i.body})});wn.displayName="ModalBody";const Sn=O((e,t)=>{const{onClick:n,className:r,...a}=e,{onClose:o}=G(),s=I("chakra-modal__close-btn",r),i=se();return v.jsx(Qn,{ref:t,__css:i.closeButton,className:s,onClick:J(n,m=>{m.stopPropagation(),o()}),...a})});Sn.displayName="ModalCloseButton";const Cn=O((e,t)=>{const{className:n,...r}=e,{headerId:a,setHeaderMounted:o}=G();c.useEffect(()=>(o(!0),()=>o(!1)),[o]);const s=I("chakra-modal__header",n),i=se(),m=pe({flex:0,...i.header});return v.jsx(E.header,{ref:t,className:s,id:a,...r,__css:m})});Cn.displayName="ModalHeader";const Oo={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??B.enter(D.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??B.exit(D.exit,n),transitionEnd:t==null?void 0:t.exit})},kn={initial:"exit",animate:"enter",exit:"exit",variants:Oo},Mo=c.forwardRef(function(t,n){const{unmountOnExit:r,in:a,className:o,transition:s,transitionEnd:i,delay:m,animatePresenceProps:u,...h}=t,l=a||r?"enter":"exit",d=r?a&&r:!0,p={transition:s,transitionEnd:i,delay:m};return v.jsx(ye,{...u,custom:p,children:d&&v.jsx(ie.div,{ref:n,className:I("chakra-fade",o),custom:p,...kn,animate:l,...h})})});Mo.displayName="Fade";const Ao=E(ie.div),Fn=O((e,t)=>{const{className:n,transition:r,motionProps:a,...o}=e,s=I("chakra-modal__overlay",n),m={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...se().overlay},{motionPreset:u}=G(),l=a||(u==="none"?{}:kn);return v.jsx(Ao,{...l,__css:m,ref:t,className:s,...o})});Fn.displayName="ModalOverlay";const To=O(function(t,n){const r=Ft("Text",t),{className:a,align:o,decoration:s,casing:i,...m}=He(t),u=Jn({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return v.jsx(E.p,{ref:n,className:I("chakra-text",t.className),...u,...m,__css:r})});To.displayName="Text";const _o={BB:{attribution:"GeoBasis-DE/LGB",license:"dl-de/by-2-0",link:"https://geoportal.brandenburg.de/"},BY:{attribution:"Bayerische Vermessungsverwaltung – www.geodaten.bayern.de",license:"cc/by-4-0",link:"https://geodaten.bayern.de/opengeodata/OpenDataDetail.html?pn=lod2"},BW:{attribution:"Datenquelle: LGL, www.lgl-bw.de",license:"dl-de/by-2-0",link:"https://www.lgl-bw.de/Produkte/3D-Produkte/3D-Gebaeudemodelle/"},BE:{attribution:"Geoportal Berlin / 3D-Gebäudemodelle im Level of Detail 2 (LoD 2)",license:"dl-de/by-2-0",link:"https://www.berlin.de/sen/sbw/stadtdaten/geoportal/geoportal-daten-und-dienste/"},HB:{attribution:"Landesamt GeoInformation Bremen",license:"cc/by-4-0",link:"https://geoportal.bremen.de/geoportal/"},HE:{attribution:"Hessische Verwaltung für Bodenmanagement und Geoinformation",license:"dl-de/zero-2-0",link:"https://gds.hessen.de/INTERSHOP/web/WFS/HLBG-Geodaten-Site/de_DE/-/EUR/ViewDownloadcenter-Start?path=3D-Daten/3D-Geb%C3%A4udemodelle/3D-Geb%C3%A4udemodelle%20LoD2"},HH:{attribution:"Freie und Hansestadt Hamburg, Landesbetrieb Geoinformation und Vermessung (LGV)",license:"dl-de/by-2-0",link:"https://metaver.de/trefferanzeige?docuuid=2C1F2EEC-CF9F-4D8B-ACAC-79D8C1334D5E&q=3D-Geb%C3%A4udemodell+LoD2&f=type%3Aopendata%3B"},MV:{attribution:"GeoBasis-DE/M-V",license:"cc/by-4-0",link:"https://www.geoportal-mv.de/portal/Geowebdienste/INSPIRE-Themen/Gebaeude"},NI:{attribution:"Quelle: LGLN 2024",license:"cc/by-4-0",link:"https://metaver.de/trefferanzeige?docuuid=6c1ab9c0-02c0-4f0d-98af-caf9fec83cc3&q=3D-Geb%C3%A4udemodell+LoD2&rstart=10&f=type%3Aopendata%3B"},NW:{attribution:"Geobasis NRW",license:"dl-de/zero-2-0",link:"https://www.geoportal.nrw/?activetab=map#/datasets/iso/5d9a8abc-dfd0-4dda-b8fa-165cce4d8065"},SH:{attribution:"GeoBasis-DE/LVermGeo SH",license:"cc/by-4-0",link:"https://geodaten.schleswig-holstein.de/gaialight-sh/_apps/dladownload/dl-lod2.html"},SL:{attribution:"GeoBasis DE/LVGL-SL (2024)",license:"dl-de/by-2-0",link:"https://geoportal.saarland.de/spatial-objects/407"},SN:{attribution:"Landesamt für Geobasisinformation Sachsen (GeoSN)",license:"dl-de/by-2-0",link:"https://www.geodaten.sachsen.de/downloadbereich-digitale-3d-stadtmodelle-4875.html"},ST:{attribution:"GeoBasis-DE/LVermGeo ST",license:"dl-de/by-2-0",link:"https://metaver.de/trefferanzeige?docuuid=4D2501AB-6888-4B8A-A706-6B0755947B13&q=3D-Geb%C3%A4udemodell+LoD2&f=type%3Aopendata%3B"},TH:{attribution:"GDI-Th",license:"dl-de/by-2-0",link:"https://geoportal.thueringen.de/gdi-th/download-offene-geodaten/download-3d-gebaeudedaten"},RP:{attribution:"GeoBasis-DE/LVermGeoRP (2024)",license:"dl-de/by-2-0",link:"https://metaportal.rlp.de/gui/html/0b28684d-b2ce-4b0b-b080-928025588c61"}},Lo={"dl-de/by-2-0":"https://www.govdata.de/dl-de/by-2-0","dl-de/zero-2-0":"https://www.govdata.de/dl-de/zero-2-0","cc/by-4-0":"https://creativecommons.org/licenses/by/4.0/deed","cc/by-3-0":"https://creativecommons.org/licenses/by/3.0/deed"},Do=({children:e})=>v.jsx("div",{className:"overlay",children:v.jsx("div",{className:"attribution",children:e})}),Bo=({children:e})=>{const{isOpen:t,onOpen:n,onClose:r}=ur();return v.jsx("div",{className:"overlay",children:v.jsxs("div",{className:"attribution",children:[v.jsx(Nt,{variant:"link",onClick:n,children:"License Information"}),v.jsxs(dn,{isOpen:t,onClose:r,children:[v.jsx(Fn,{}),v.jsxs(xn,{children:[v.jsx(Cn,{children:"License Information"}),v.jsx(Sn,{}),v.jsx(wn,{children:e})]})]})]})})};function Wo({federalState:e,frontendState:t}){const n=e?_o[e]:void 0,r=i=>{tr.changeLanguage(i)},{t:a}=er(),o=window.isTouchDevice?Bo:Do,s=v.jsxs(v.Fragment,{children:[(t=="Map"||t=="Results"||t=="DrawPV")&&v.jsxs("p",{className:"copyright",children:["Basiskarte ©"," ",v.jsx("a",{href:"https://www.bkg.bund.de",target:"_blank",children:"BKG"})," (",v.jsx("a",{href:"https://www.govdata.de/dl-de/by-2-0",target:"_blank",children:"dl-de/by-2-0"}),") | Geländemodell: ",v.jsx("a",{href:"https://sonny.4lima.de",target:"_blank",children:"© Sonny"})," (",v.jsx("a",{href:"https://creativecommons.org/licenses/by/4.0/deed.en",target:"_blank",children:"CC-BY-4.0"}),"), erstellt aus",v.jsx("a",{href:"https://drive.google.com/file/d/1rgGA22Ha42ulQORK9Pfp4JPpPAIKFx6Q/view",target:"_blank",children:"verschiedenen Quellen"})]},"map-attribution"),e&&v.jsx(v.Fragment,{children:v.jsxs("p",{className:"copyright",style:e?{}:{display:"none"},children:["Gebäudedaten ©"," ",v.jsx("a",{href:n.link,target:"_blank",children:n.attribution})," (",v.jsx("a",{href:Lo[n.license],target:"_blank",children:n.license}),")"]},e)}),v.jsxs("p",{className:"copyright",children:["© ",v.jsx("a",{href:"https://github.com/open-pv",target:"_blank",children:"Team OpenPV"})," | ",v.jsx("a",{href:"/Impressum",children:"Impressum"})," | ",v.jsx("a",{href:"/Datenschutz",children:a("Footer.privacyPolicy")})," | ",v.jsx("a",{href:"",onClick:i=>{i.preventDefault(),r("en")},children:"English"})," | ",v.jsx("a",{href:"",onClick:i=>{i.preventDefault(),r("de")},children:"German"})]})]});return v.jsx(o,{children:s})}export{Nt as B,Wo as F,nt as L,dn as M,Oa as O,To as T,Ma as U,Aa as a,Fn as b,xn as c,Cn as d,Sn as e,wn as f,dt as g,jo as h,G as i,se as j,So as k,_o as l,nr as m,ur as u,B as w}; diff --git a/assets/Footer-C3QM0Uoc.js b/assets/Footer-C3QM0Uoc.js new file mode 100644 index 0000000..cc78162 --- /dev/null +++ b/assets/Footer-C3QM0Uoc.js @@ -0,0 +1,41 @@ +import{d as c,i as Un,X as Vn,Y as $n,Z as zn,k as ut,y as ye,l as I,j as v,c as E,Q as be,$ as Yn,f as O,w as Pt,x as Ue,a0 as qn,q as lt,I as Le,R as T,D as Nt,J as Xn,v as dt,s as ee,A as xe,P as Kn,a1 as Zn,m as se,L as Qn,a2 as Jn,g as er,a3 as tr}from"./index-DZP_WaxS.js";function nr(e){return c.Children.toArray(e).filter(t=>c.isValidElement(t))}const rr=e=>e.hasAttribute("tabindex");function ar(e){if(!Un(e)||Vn(e)||$n(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]():zn(e)?!0:rr(e)}const or=["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]"],ir=or.join(),sr=e=>e.offsetWidth>0&&e.offsetHeight>0;function cr(e){const t=Array.from(e.querySelectorAll(ir));return t.unshift(e),t.filter(n=>ar(n)&&sr(n))}function ur(e={}){const{onClose:t,onOpen:n,isOpen:r,id:a}=e,o=ut(n),s=ut(t),[i,m]=c.useState(e.defaultIsOpen||!1),u=r!==void 0?r:i,h=r!==void 0,l=c.useId(),d=a??`disclosure-${l}`,p=c.useCallback(()=>{h||m(!1),s==null||s()},[h,s]),b=c.useCallback(()=>{h||m(!0),o==null||o()},[h,o]),f=c.useCallback(()=>{u?p():b()},[u,b,p]);function g(y={}){return{...y,"aria-expanded":u,"aria-controls":d,onClick(x){var S;(S=y.onClick)==null||S.call(y,x),f()}}}function w(y={}){return{...y,hidden:!u,id:d}}return{isOpen:u,onOpen:b,onClose:p,onToggle:f,isControlled:h,getButtonProps:g,getDisclosureProps:w}}const ft={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Q={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 Ro(e){switch((e==null?void 0:e.direction)??"right"){case"right":return Q.slideRight;case"left":return Q.slideLeft;case"bottom":return Q.slideDown;case"top":return Q.slideUp;default:return Q.slideRight}}const B={enter:{duration:.2,ease:ft.easeOut},exit:{duration:.1,ease:ft.easeIn}},j={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})},[Go,lr]=ye({strict:!1,name:"ButtonGroupContext"});function te(e){const{children:t,className:n,...r}=e,a=c.isValidElement(t)?c.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=I("chakra-button__icon",n);return v.jsx(E.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o,children:a})}te.displayName="ButtonIcon";function Te(e){const{label:t,placement:n,spacing:r="0.5rem",children:a=v.jsx(Yn,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:s,...i}=e,m=I("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",h=c.useMemo(()=>be({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,t,u,r]);return v.jsx(E.div,{className:m,...i,__css:h,children:a})}Te.displayName="ButtonSpinner";function dr(e){const[t,n]=c.useState(!e);return{ref:c.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}const Et=O((e,t)=>{const n=lr(),r=Pt("Button",{...n,...e}),{isDisabled:a=n==null?void 0:n.isDisabled,isLoading:o,isActive:s,children:i,leftIcon:m,rightIcon:u,loadingText:h,iconSpacing:l="0.5rem",type:d,spinner:p,spinnerPlacement:b="start",className:f,as:g,shouldWrapChildren:w,...y}=Ue(e),x=c.useMemo(()=>{const N={...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:N}}},[r,n]),{ref:S,type:C}=dr(g),F={rightIcon:u,leftIcon:m,iconSpacing:l,children:i,shouldWrapChildren:w};return v.jsxs(E.button,{disabled:a||o,ref:qn(t,S),as:g,type:d??C,"data-active":lt(s),"data-loading":lt(o),__css:x,className:I("chakra-button",f),...y,children:[o&&b==="start"&&v.jsx(Te,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:l,children:p}),o?h||v.jsx(E.span,{opacity:0,children:v.jsx(vt,{...F})}):v.jsx(vt,{...F}),o&&b==="end"&&v.jsx(Te,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:l,children:p})]})});Et.displayName="Button";function vt(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:a,shouldWrapChildren:o}=e;return o?v.jsxs("span",{style:{display:"contents"},children:[t&&v.jsx(te,{marginEnd:a,children:t}),r,n&&v.jsx(te,{marginStart:a,children:n})]}):v.jsxs(v.Fragment,{children:[t&&v.jsx(te,{marginEnd:a,children:t}),r,n&&v.jsx(te,{marginStart:a,children:n})]})}function fr(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 _e="data-focus-lock",It="data-focus-lock-disabled",vr="data-no-focus-lock",mr="data-autofocus-inside",hr="data-no-autofocus";function Fe(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pr(e,t){var n=c.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 br=typeof window<"u"?c.useLayoutEffect:c.useEffect,mt=new WeakMap;function Ot(e,t){var n=pr(null,function(r){return e.forEach(function(a){return Fe(a,r)})});return br(function(){var r=mt.get(n);if(r){var a=new Set(r),o=new Set(e),s=n.current;a.forEach(function(i){o.has(i)||Fe(i,null)}),o.forEach(function(i){a.has(i)||Fe(i,s)})}mt.set(n,e)},[e]),n}var Pe={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(Br)},Rr=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],qe=Rr.join(","),Gr="".concat(qe,", [data-focus-guard]"),zt=function(e,t){return A((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?Gr:qe)?[r]:[],zt(r))},[])},Wr=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?K([e.contentDocument.body],t):[e]},K=function(e,t){return e.reduce(function(n,r){var a,o=zt(r,t),s=(a=[]).concat.apply(a,o.map(function(i){return Wr(i,t)}));return n.concat(s,r.parentNode?A(r.parentNode.querySelectorAll(qe)).filter(function(i){return i===r}):[])},[])},Hr=function(e){var t=e.querySelectorAll("[".concat(mr,"]"));return A(t).map(function(n){return K([n])}).reduce(function(n,r){return n.concat(r)},[])},Xe=function(e,t){return A(e).filter(function(n){return Wt(t,n)}).filter(function(n){return Tr(n)})},ht=function(e,t){return t===void 0&&(t=new Map),A(e).filter(function(n){return Ht(t,n)})},Ke=function(e,t,n){return Ye(Xe(K(e,n),t),!0,n)},ae=function(e,t){return Ye(Xe(K(e),t),!1)},Ur=function(e,t){return Xe(Hr(e),t)},R=function(e,t){return e.shadowRoot?R(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:A(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?R(a,t):!1}return R(n,t)})},Vr=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},Ze=function(e){var t=G(e);return t.filter(Boolean).reduce(function(n,r){var a=r.getAttribute(_e);return n.push.apply(n,a?Vr(A(Yt(r).querySelectorAll("[".concat(_e,'="').concat(a,'"]:not([').concat(It,'="disabled"])')))):[r]),n},[])},$r=function(e){try{return e()}catch{return}},oe=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?oe(t.shadowRoot):t instanceof HTMLIFrameElement&&$r(function(){return t.contentWindow.document})?oe(t.contentWindow.document):t}},zr=function(e,t){return e===t},Yr=function(e,t){return!!A(e.querySelectorAll("iframe")).some(function(n){return zr(n,t)})},qt=function(e,t){return t===void 0&&(t=oe(jt(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Ze(e).some(function(n){return R(n,t)||Yr(n,t)})},qr=function(e){e===void 0&&(e=document);var t=oe(e);return t?A(e.querySelectorAll("[".concat(vr,"]"))).some(function(n){return R(n,t)}):!1},Xr=function(e,t){return t.filter($t).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Qe=function(e,t){return $t(e)&&e.name?Xr(e,t):e},Kr=function(e){var t=new Set;return e.forEach(function(n){return t.add(Qe(n,e))}),e.filter(function(n){return t.has(n)})},pt=function(e){return e[0]&&e.length>1?Qe(e[0],e):e[0]},bt=function(e,t){return e.indexOf(Qe(t,e))},je="NEW_FOCUS",Zr=function(e,t,n,r,a){var o=e.length,s=e[0],i=e[o-1],m=ze(r);if(!(r&&e.indexOf(r)>=0)){var u=r!==void 0?n.indexOf(r):-1,h=a?n.indexOf(a):u,l=a?e.indexOf(a):-1;if(u===-1)return l!==-1?l:je;if(l===-1)return je;var d=u-h,p=n.indexOf(s),b=n.indexOf(i),f=Kr(n),g=r!==void 0?f.indexOf(r):-1,w=g-(a?f.indexOf(a):u);if(!d&&l>=0||t.length===0)return l;var y=bt(e,t[0]),x=bt(e,t[t.length-1]);if(u<=p&&m&&Math.abs(d)>1)return x;if(u>=b&&m&&Math.abs(d)>1)return y;if(d&&Math.abs(w)>1)return l;if(u<=p)return x;if(u>b)return y;if(d)return Math.abs(d)>1?l:(o+l+d)%o}},Qr=function(e){return function(t){var n,r=(n=Ut(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},gt=function(e,t,n){var r=e.map(function(o){var s=o.node;return s}),a=ht(r.filter(Qr(n)));return a&&a.length?pt(a):pt(ht(t))},Re=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Re(e.parentNode.host||e.parentNode,t),t},Ne=function(e,t){for(var n=Re(e),r=Re(t),a=0;a=0)return o}return!1},Xt=function(e,t,n){var r=G(e),a=G(t),o=r[0],s=!1;return a.filter(Boolean).forEach(function(i){s=Ne(s||i,i)||s,n.filter(Boolean).forEach(function(m){var u=Ne(o,m);u&&(!s||R(u,s)?s=u:s=Ne(u,s))})}),s},yt=function(e,t){return e.reduce(function(n,r){return n.concat(Ur(r,t))},[])},Jr=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(Dr)},ea=function(e,t){var n=oe(G(e).length>0?document:jt(e).ownerDocument),r=Ze(e).filter(Be),a=Xt(n||e,e,r),o=new Map,s=ae(r,o),i=s.filter(function(b){var f=b.node;return Be(f)});if(i[0]){var m=ae([a],o).map(function(b){var f=b.node;return f}),u=Jr(m,i),h=u.map(function(b){var f=b.node;return f}),l=u.filter(function(b){var f=b.tabIndex;return f>=0}).map(function(b){var f=b.node;return f}),d=Zr(h,l,m,n,t);if(d===je){var p=gt(s,l,yt(r,o))||gt(s,h,yt(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:u[d]}},ta=function(e){var t=Ze(e).filter(Be),n=Xt(e,e,t),r=Ye(K([n],!0),!0,!0),a=K(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:ze(s)}})},Je=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},Ee=0,Ie=!1,Kt=function(e,t,n){n===void 0&&(n={});var r=ea(e,t);if(!Ie&&r){if(Ee>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Ie=!0,setTimeout(function(){Ie=!1},1);return}Ee++,Je(r.node,n.focusOptions),Ee--}};function J(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 na=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:J(n),parent:J(n.parentElement),left:J(n.previousElementSibling),right:J(n.nextElementSibling)}),n=n.parentElement;return{element:J(e),stack:t,ownerDocument:e.ownerDocument}},ra=function(e){var t,n,r,a,o;if(e)for(var s=e.stack,i=e.ownerDocument,m=new Map,u=0,h=s;u-1&&(g.filter(function(y){var x=y.guard,S=y.node;return x&&S.dataset.focusAutoGuard}).forEach(function(y){var x=y.node;return x.removeAttribute("tabIndex")}),wt(w,g.length,1,g),wt(w,-1,-1,g))}}}return t},nn=function(t){ge()&&t&&(t.stopPropagation(),t.preventDefault())},nt=function(){return et(ge)},wa=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||ha(r,n)},Sa=function(){return null},rn=function(){tt=!0},an=function(){tt=!1,ie="just",et(function(){ie="meanwhile"})},Ca=function(){document.addEventListener("focusin",nn),document.addEventListener("focusout",nt),window.addEventListener("focus",rn),window.addEventListener("blur",an)},ka=function(){document.removeEventListener("focusin",nn),document.removeEventListener("focusout",nt),window.removeEventListener("focus",rn),window.removeEventListener("blur",an)};function Fa(e){return e.filter(function(t){var n=t.disabled;return!n})}var on={moveFocusInside:Kt,focusInside:qt,focusNextElement:sa,focusPrevElement:ca,focusFirstElement:ua,focusLastElement:la,captureFocusRestore:Zt};function Pa(e){var t=e.slice(-1)[0];t&&!Y&&Ca();var n=Y,r=n&&t&&t.id===n.id;Y=t,n&&!r&&(n.onDeactivation(),e.filter(function(a){var o=a.id;return o===n.id}).length||n.returnFocus(!t)),t?(P=null,(!r||n.observed!==t.observed)&&t.onActivation(on),ge(),et(ge)):(ka(),P=null)}Dt.assignSyncMedium(wa);Bt.assignMedium(nt);xr.assignMedium(function(e){return e(on)});const Na=Er(Fa,Pa)(Sa);var Ge=c.forwardRef(function(t,n){return T.createElement($e,Le({sideCar:Na,ref:n},t))}),sn=$e.propTypes||{};sn.sideCar;fr(sn,["sideCar"]);Ge.propTypes={};const Ea=Ge.default??Ge,cn=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:a,children:o,isDisabled:s,autoFocus:i,persistentFocus:m,lockFocusAcrossFrames:u}=e,h=c.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&cr(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),l=c.useCallback(()=>{var p;(p=n==null?void 0:n.current)==null||p.focus()},[n]),d=a&&!n;return v.jsx(Ea,{crossFrame:u,persistentFocus:m,autoFocus:i,disabled:s,onActivation:h,onDeactivation:l,returnFocus:d,children:o})};cn.displayName="FocusLock";const[Ia,un]=ye({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),rt=O(function(t,n){const r=Nt("List",t),{children:a,styleType:o="none",stylePosition:s,spacing:i,...m}=Ue(t),u=nr(a),l=i?{["& > *:not(style) ~ *:not(style)"]:{mt:i}}:{};return v.jsx(Ia,{value:r,children:v.jsx(E.ul,{ref:n,listStyleType:o,listStylePosition:s,role:"list",__css:{...r.container,...l},...m,children:u})})});rt.displayName="List";const Oa=O((e,t)=>{const{as:n,...r}=e;return v.jsx(rt,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});Oa.displayName="OrderedList";const Ma=O(function(t,n){const{as:r,...a}=t;return v.jsx(rt,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...a})});Ma.displayName="UnorderedList";const Aa=O(function(t,n){const r=un();return v.jsx(E.li,{ref:n,...t,__css:r.item})});Aa.displayName="ListItem";const La=O(function(t,n){const r=un();return v.jsx(Xn,{ref:n,role:"presentation",...t,__css:r.icon})});La.displayName="ListIcon";var Ta=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},V=new WeakMap,de=new WeakMap,fe={},Oe=0,ln=function(e){return e&&(e.host||ln(e.parentNode))},_a=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ln(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})},Da=function(e,t,n,r){var a=_a(t,Array.isArray(e)?e:[e]);fe[n]||(fe[n]=new WeakMap);var o=fe[n],s=[],i=new Set,m=new Set(a),u=function(l){!l||i.has(l)||(i.add(l),u(l.parentNode))};a.forEach(u);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=(V.get(d)||0)+1,g=(o.get(d)||0)+1;V.set(d,f),o.set(d,g),s.push(d),f===1&&b&&de.set(d,!0),g===1&&d.setAttribute(n,"true"),b||d.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",d,w)}})};return h(t),i.clear(),Oe++,function(){s.forEach(function(l){var d=V.get(l)-1,p=o.get(l)-1;V.set(l,d),o.set(l,p),d||(de.has(l)||l.removeAttribute(r),de.delete(l)),p||l.removeAttribute(n)}),Oe--,Oe||(V=new WeakMap,V=new WeakMap,de=new WeakMap,fe={})}},Ba=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Ta(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),Da(r,a,n,"aria-hidden")):function(){return null}},ja=Object.defineProperty,Ra=(e,t,n)=>t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ga=(e,t,n)=>(Ra(e,t+"",n),n);class Wa{constructor(){Ga(this,"modals"),this.modals=new Set}add(t){return this.modals.add(t),this.modals.size}remove(t){this.modals.delete(t)}isTopModal(t){if(!t)return!1;const n=Array.from(this.modals)[this.modals.size-1];return t===n}}const We=new Wa;function dn(e,t){const[n,r]=c.useState(0);return c.useEffect(()=>{const a=e.current;if(a){if(t){const o=We.add(a);r(o)}return()=>{We.remove(a),r(0)}}},[t,e]),n}function Ha(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:a=!0,closeOnEsc:o=!0,useInert:s=!0,onOverlayClick:i,onEsc:m}=e,u=c.useRef(null),h=c.useRef(null),[l,d,p]=Va(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Ua(u,t&&s);const b=dn(u,t),f=c.useRef(null),g=c.useCallback(k=>{f.current=k.target},[]),w=c.useCallback(k=>{k.key==="Escape"&&(k.stopPropagation(),o&&(n==null||n()),m==null||m())},[o,n,m]),[y,x]=c.useState(!1),[S,C]=c.useState(!1),F=c.useCallback((k={},Z=null)=>({role:"dialog",...k,ref:dt(Z,u),id:l,tabIndex:-1,"aria-modal":!0,"aria-labelledby":y?d:void 0,"aria-describedby":S?p:void 0,onClick:ee(k.onClick,ue=>ue.stopPropagation())}),[p,S,l,d,y]),N=c.useCallback(k=>{k.stopPropagation(),f.current===k.target&&We.isTopModal(u.current)&&(a&&(n==null||n()),i==null||i())},[n,a,i]),_=c.useCallback((k={},Z=null)=>({...k,ref:dt(Z,h),onClick:ee(k.onClick,N),onKeyDown:ee(k.onKeyDown,w),onMouseDown:ee(k.onMouseDown,g)}),[w,g,N]);return{isOpen:t,onClose:n,headerId:d,bodyId:p,setBodyMounted:C,setHeaderMounted:x,dialogRef:u,overlayRef:h,getDialogProps:F,getDialogContainerProps:_,index:b}}function Ua(e,t){const n=e.current;c.useEffect(()=>{if(!(!e.current||!t))return Ba(e.current)},[t,e,n])}function Va(e,...t){const n=c.useId(),r=e||n;return c.useMemo(()=>t.map(a=>`${a}-${r}`),[r,t])}const[$a,ce]=ye({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[za,W]=ye({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),fn=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,preserveScrollBarGap:!0,motionPreset:"scale",...e,lockFocusAcrossFrames:e.lockFocusAcrossFrames||!0},{portalProps:n,children:r,autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:u,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p,animatePresenceProps:b,onCloseComplete:f}=t,g=Nt("Modal",t),y={...Ha(t),autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:u,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p};return v.jsx(za,{value:y,children:v.jsx($a,{value:g,children:v.jsx(xe,{...b,onExitComplete:f,children:y.isOpen&&v.jsx(Kn,{...n,children:r})})})})};fn.displayName="Modal";var he="right-scroll-bar-position",pe="width-before-scroll-bar",Ya="with-scroll-bars-hidden",qa="--removed-body-scroll-bar-size",vn=Tt(),Me=function(){},we=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Me,onWheelCapture:Me,onTouchMoveCapture:Me}),a=r[0],o=r[1],s=e.forwardProps,i=e.children,m=e.className,u=e.removeScrollBar,h=e.enabled,l=e.shards,d=e.sideCar,p=e.noIsolation,b=e.inert,f=e.allowPinchZoom,g=e.as,w=g===void 0?"div":g,y=e.gapMode,x=Mt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=d,C=Ot([n,t]),F=M(M({},x),a);return c.createElement(c.Fragment,null,h&&c.createElement(S,{sideCar:vn,removeScrollBar:u,shards:l,noIsolation:p,inert:b,setCallbacks:o,allowPinchZoom:!!f,lockRef:n,gapMode:y}),s?c.cloneElement(c.Children.only(i),M(M({},F),{ref:C})):c.createElement(w,M({},F,{className:m,ref:C}),i))});we.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};we.classNames={fullWidth:pe,zeroRight:he};var Xa=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ka(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Xa();return t&&e.setAttribute("nonce",t),e}function Za(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qa(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ja=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ka())&&(Za(t,n),Qa(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eo=function(){var e=Ja();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mn=function(){var e=eo(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},to={left:0,top:0,right:0,gap:0},Ae=function(e){return parseInt(e||"",10)||0},no=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[Ae(n),Ae(r),Ae(a)]},ro=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return to;var t=no(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])}},ao=mn(),X="data-scroll-locked",oo=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(Ya,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(i,"px ").concat(r,`; + } + body[`).concat(X,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(a,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(i,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(he,` { + right: `).concat(i,"px ").concat(r,`; + } + + .`).concat(pe,` { + margin-right: `).concat(i,"px ").concat(r,`; + } + + .`).concat(he," .").concat(he,` { + right: 0 `).concat(r,`; + } + + .`).concat(pe," .").concat(pe,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(X,`] { + `).concat(qa,": ").concat(i,`px; + } +`)},St=function(){var e=parseInt(document.body.getAttribute(X)||"0",10);return isFinite(e)?e:0},io=function(){c.useEffect(function(){return document.body.setAttribute(X,(St()+1).toString()),function(){var e=St()-1;e<=0?document.body.removeAttribute(X):document.body.setAttribute(X,e.toString())}},[])},so=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;io();var o=c.useMemo(function(){return ro(a)},[a]);return c.createElement(ao,{styles:oo(o,!t,a,n?"":"!important")})},He=!1;if(typeof window<"u")try{var ve=Object.defineProperty({},"passive",{get:function(){return He=!0,!0}});window.addEventListener("test",ve,ve),window.removeEventListener("test",ve,ve)}catch{He=!1}var $=He?{passive:!1}:!1,co=function(e){return e.tagName==="TEXTAREA"},hn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!co(e)&&n[t]==="visible")},uo=function(e){return hn(e,"overflowY")},lo=function(e){return hn(e,"overflowX")},Ct=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=pn(e,r);if(a){var o=bn(e,r),s=o[1],i=o[2];if(s>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fo=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vo=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},pn=function(e,t){return e==="v"?uo(t):lo(t)},bn=function(e,t){return e==="v"?fo(t):vo(t)},mo=function(e,t){return e==="h"&&t==="rtl"?-1:1},ho=function(e,t,n,r,a){var o=mo(e,window.getComputedStyle(t).direction),s=o*r,i=n.target,m=t.contains(i),u=!1,h=s>0,l=0,d=0;do{var p=bn(e,i),b=p[0],f=p[1],g=p[2],w=f-g-o*b;(b||w)&&pn(e,i)&&(l+=w,d+=b),i instanceof ShadowRoot?i=i.host:i=i.parentNode}while(!m&&i!==document.body||m&&(t.contains(i)||t===i));return(h&&(Math.abs(l)<1||!a)||!h&&(Math.abs(d)<1||!a))&&(u=!0),u},me=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kt=function(e){return[e.deltaX,e.deltaY]},Ft=function(e){return e&&"current"in e?e.current:e},po=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bo=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},go=0,z=[];function yo(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),a=c.useState(go++)[0],o=c.useState(mn)[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var f=gr([e.lockRef.current],(e.shards||[]).map(Ft),!0).filter(Boolean);return f.forEach(function(g){return g.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),f.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=c.useCallback(function(f,g){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var w=me(f),y=n.current,x="deltaX"in f?f.deltaX:y[0]-w[0],S="deltaY"in f?f.deltaY:y[1]-w[1],C,F=f.target,N=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in f&&N==="h"&&F.type==="range")return!1;var _=Ct(N,F);if(!_)return!0;if(_?C=N:(C=N==="v"?"h":"v",_=Ct(N,F)),!_)return!1;if(!r.current&&"changedTouches"in f&&(x||S)&&(r.current=C),!C)return!0;var k=r.current||C;return ho(k,g,f,k==="h"?x:S,!0)},[]),m=c.useCallback(function(f){var g=f;if(!(!z.length||z[z.length-1]!==o)){var w="deltaY"in g?kt(g):me(g),y=t.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&po(C.delta,w)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var x=(s.current.shards||[]).map(Ft).filter(Boolean).filter(function(C){return C.contains(g.target)}),S=x.length>0?i(g,x[0]):!s.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),u=c.useCallback(function(f,g,w,y){var x={name:f,delta:g,target:w,should:y,shadowParent:xo(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),h=c.useCallback(function(f){n.current=me(f),r.current=void 0},[]),l=c.useCallback(function(f){u(f.type,kt(f),f.target,i(f,e.lockRef.current))},[]),d=c.useCallback(function(f){u(f.type,me(f),f.target,i(f,e.lockRef.current))},[]);c.useEffect(function(){return z.push(o),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",m,$),document.addEventListener("touchmove",m,$),document.addEventListener("touchstart",h,$),function(){z=z.filter(function(f){return f!==o}),document.removeEventListener("wheel",m,$),document.removeEventListener("touchmove",m,$),document.removeEventListener("touchstart",h,$)}},[]);var p=e.removeScrollBar,b=e.inert;return c.createElement(c.Fragment,null,b?c.createElement(o,{styles:bo(a)}):null,p?c.createElement(so,{gapMode:e.gapMode}):null)}function xo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wo=yr(vn,yo);var gn=c.forwardRef(function(e,t){return c.createElement(we,M({},e,{ref:t,sideCar:wo}))});gn.classNames=we.classNames;function So(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:a,blockScrollOnMount:o,allowPinchZoom:s,finalFocusRef:i,returnFocusOnClose:m,preserveScrollBarGap:u,lockFocusAcrossFrames:h,isOpen:l}=W(),[d,p]=Zn();c.useEffect(()=>{!d&&p&&setTimeout(p)},[d,p]);const b=dn(r,l);return v.jsx(cn,{autoFocus:t,isDisabled:!n,initialFocusRef:a,finalFocusRef:i,restoreFocus:m,contentRef:r,lockFocusAcrossFrames:h,children:v.jsx(gn,{removeScrollBar:!u,allowPinchZoom:s,enabled:b===1&&o,forwardProps:!0,children:e.children})})}const Co={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:a})=>({opacity:0,x:e,y:t,transition:(n==null?void 0:n.exit)??j.exit(B.exit,a),transitionEnd:r==null?void 0:r.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??j.enter(B.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:a,delay:o})=>{const s={x:t,y:e};return{opacity:0,transition:(n==null?void 0:n.exit)??j.exit(B.exit,o),...a?{...s,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...s,...r==null?void 0:r.exit}}}}},ne={initial:"initial",animate:"enter",exit:"exit",variants:Co},ko=c.forwardRef(function(t,n){const{unmountOnExit:r,in:a,reverse:o=!0,className:s,offsetX:i=0,offsetY:m=8,transition:u,transitionEnd:h,delay:l,animatePresenceProps:d,...p}=t,b=r?a&&r:!0,f=a||r?"enter":"exit",g={offsetX:i,offsetY:m,reverse:o,transition:u,transitionEnd:h,delay:l};return v.jsx(xe,{...d,custom:g,children:b&&v.jsx(se.div,{ref:n,className:I("chakra-offset-slide",s),custom:g,...ne,animate:f,...p})})});ko.displayName="SlideFade";const Fo={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:a})=>({opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(n==null?void 0:n.exit)??j.exit(B.exit,a)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??j.enter(B.enter,n),transitionEnd:e==null?void 0:e.enter})},yn={initial:"exit",animate:"enter",exit:"exit",variants:Fo},Po=c.forwardRef(function(t,n){const{unmountOnExit:r,in:a,reverse:o=!0,initialScale:s=.95,className:i,transition:m,transitionEnd:u,delay:h,animatePresenceProps:l,...d}=t,p=r?a&&r:!0,b=a||r?"enter":"exit",f={initialScale:s,reverse:o,transition:m,transitionEnd:u,delay:h};return v.jsx(xe,{...l,custom:f,children:p&&v.jsx(se.div,{ref:n,className:I("chakra-offset-slide",i),...yn,animate:b,custom:f,...d})})});Po.displayName="ScaleFade";const No={slideInBottom:{...ne,custom:{offsetY:16,reverse:!0}},slideInRight:{...ne,custom:{offsetX:16,reverse:!0}},slideInTop:{...ne,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...ne,custom:{offsetX:-16,reverse:!0}},scale:{...yn,custom:{initialScale:.95,reverse:!0}},none:{}},Eo=E(se.section),Io=e=>No[e||"none"],xn=c.forwardRef((e,t)=>{const{preset:n,motionProps:r=Io(n),...a}=e;return v.jsx(Eo,{ref:t,...r,...a})});xn.displayName="ModalTransition";const wn=O((e,t)=>{const{className:n,children:r,containerProps:a,motionProps:o,...s}=e,{getDialogProps:i,getDialogContainerProps:m}=W(),u=i(s,t),h=m(a),l=I("chakra-modal__content",n),d=ce(),p=be({display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...d.dialog}),b=be({display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...d.dialogContainer}),{motionPreset:f}=W();return v.jsx(So,{children:v.jsx(E.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:b,children:v.jsx(xn,{preset:f,motionProps:o,className:l,...u,__css:p,children:r})})})});wn.displayName="ModalContent";const Sn=O((e,t)=>{const{className:n,...r}=e,{bodyId:a,setBodyMounted:o}=W();c.useEffect(()=>(o(!0),()=>o(!1)),[o]);const s=I("chakra-modal__body",n),i=ce();return v.jsx(E.div,{ref:t,className:s,id:a,...r,__css:i.body})});Sn.displayName="ModalBody";const Cn=O((e,t)=>{const{onClick:n,className:r,...a}=e,{onClose:o}=W(),s=I("chakra-modal__close-btn",r),i=ce();return v.jsx(Qn,{ref:t,__css:i.closeButton,className:s,onClick:ee(n,m=>{m.stopPropagation(),o()}),...a})});Cn.displayName="ModalCloseButton";const kn=O((e,t)=>{const{className:n,...r}=e,{headerId:a,setHeaderMounted:o}=W();c.useEffect(()=>(o(!0),()=>o(!1)),[o]);const s=I("chakra-modal__header",n),i=ce(),m=be({flex:0,...i.header});return v.jsx(E.header,{ref:t,className:s,id:a,...r,__css:m})});kn.displayName="ModalHeader";const Oo={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??j.enter(B.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??j.exit(B.exit,n),transitionEnd:t==null?void 0:t.exit})},Fn={initial:"exit",animate:"enter",exit:"exit",variants:Oo},Mo=c.forwardRef(function(t,n){const{unmountOnExit:r,in:a,className:o,transition:s,transitionEnd:i,delay:m,animatePresenceProps:u,...h}=t,l=a||r?"enter":"exit",d=r?a&&r:!0,p={transition:s,transitionEnd:i,delay:m};return v.jsx(xe,{...u,custom:p,children:d&&v.jsx(se.div,{ref:n,className:I("chakra-fade",o),custom:p,...Fn,animate:l,...h})})});Mo.displayName="Fade";const Ao=E(se.div),Pn=O((e,t)=>{const{className:n,transition:r,motionProps:a,...o}=e,s=I("chakra-modal__overlay",n),m={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...ce().overlay},{motionPreset:u}=W(),l=a||(u==="none"?{}:Fn);return v.jsx(Ao,{...l,__css:m,ref:t,className:s,...o})});Pn.displayName="ModalOverlay";const Lo=O(function(t,n){const r=Pt("Text",t),{className:a,align:o,decoration:s,casing:i,...m}=Ue(t),u=Jn({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return v.jsx(E.p,{ref:n,className:I("chakra-text",t.className),...u,...m,__css:r})});Lo.displayName="Text";const To={BB:{attribution:"GeoBasis-DE/LGB",license:"dl-de/by-2-0",link:"https://geoportal.brandenburg.de/"},BY:{attribution:"Bayerische Vermessungsverwaltung – www.geodaten.bayern.de",license:"cc/by-4-0",link:"https://geodaten.bayern.de/opengeodata/OpenDataDetail.html?pn=lod2"},BW:{attribution:"Datenquelle: LGL, www.lgl-bw.de",license:"dl-de/by-2-0",link:"https://www.lgl-bw.de/Produkte/3D-Produkte/3D-Gebaeudemodelle/"},BE:{attribution:"Geoportal Berlin / 3D-Gebäudemodelle im Level of Detail 2 (LoD 2)",license:"dl-de/by-2-0",link:"https://www.berlin.de/sen/sbw/stadtdaten/geoportal/geoportal-daten-und-dienste/"},HB:{attribution:"Landesamt GeoInformation Bremen",license:"cc/by-4-0",link:"https://geoportal.bremen.de/geoportal/"},HE:{attribution:"Hessische Verwaltung für Bodenmanagement und Geoinformation",license:"dl-de/zero-2-0",link:"https://gds.hessen.de/INTERSHOP/web/WFS/HLBG-Geodaten-Site/de_DE/-/EUR/ViewDownloadcenter-Start?path=3D-Daten/3D-Geb%C3%A4udemodelle/3D-Geb%C3%A4udemodelle%20LoD2"},HH:{attribution:"Freie und Hansestadt Hamburg, Landesbetrieb Geoinformation und Vermessung (LGV)",license:"dl-de/by-2-0",link:"https://metaver.de/trefferanzeige?docuuid=2C1F2EEC-CF9F-4D8B-ACAC-79D8C1334D5E&q=3D-Geb%C3%A4udemodell+LoD2&f=type%3Aopendata%3B"},MV:{attribution:"GeoBasis-DE/M-V",license:"cc/by-4-0",link:"https://www.geoportal-mv.de/portal/Geowebdienste/INSPIRE-Themen/Gebaeude"},NI:{attribution:"Quelle: LGLN 2024",license:"cc/by-4-0",link:"https://metaver.de/trefferanzeige?docuuid=6c1ab9c0-02c0-4f0d-98af-caf9fec83cc3&q=3D-Geb%C3%A4udemodell+LoD2&rstart=10&f=type%3Aopendata%3B"},NW:{attribution:"Geobasis NRW",license:"dl-de/zero-2-0",link:"https://www.geoportal.nrw/?activetab=map#/datasets/iso/5d9a8abc-dfd0-4dda-b8fa-165cce4d8065"},SH:{attribution:"GeoBasis-DE/LVermGeo SH",license:"cc/by-4-0",link:"https://geodaten.schleswig-holstein.de/gaialight-sh/_apps/dladownload/dl-lod2.html"},SL:{attribution:"GeoBasis DE/LVGL-SL (2024)",license:"dl-de/by-2-0",link:"https://geoportal.saarland.de/spatial-objects/407"},SN:{attribution:"Landesamt für Geobasisinformation Sachsen (GeoSN)",license:"dl-de/by-2-0",link:"https://www.geodaten.sachsen.de/downloadbereich-digitale-3d-stadtmodelle-4875.html"},ST:{attribution:"GeoBasis-DE/LVermGeo ST",license:"dl-de/by-2-0",link:"https://metaver.de/trefferanzeige?docuuid=4D2501AB-6888-4B8A-A706-6B0755947B13&q=3D-Geb%C3%A4udemodell+LoD2&f=type%3Aopendata%3B"},TH:{attribution:"GDI-Th",license:"dl-de/by-2-0",link:"https://geoportal.thueringen.de/gdi-th/download-offene-geodaten/download-3d-gebaeudedaten"},RP:{attribution:"GeoBasis-DE/LVermGeoRP (2024)",license:"dl-de/by-2-0",link:"https://metaportal.rlp.de/gui/html/0b28684d-b2ce-4b0b-b080-928025588c61"}},_o={"dl-de/by-2-0":"https://www.govdata.de/dl-de/by-2-0","dl-de/zero-2-0":"https://www.govdata.de/dl-de/zero-2-0","cc/by-4-0":"https://creativecommons.org/licenses/by/4.0/deed","cc/by-3-0":"https://creativecommons.org/licenses/by/3.0/deed"},Do=({children:e})=>v.jsx("div",{className:"overlay",children:v.jsx("div",{className:"attribution",children:e})}),Bo=({children:e})=>{const{isOpen:t,onOpen:n,onClose:r}=ur();return v.jsx("div",{className:"overlay",children:v.jsxs("div",{className:"attribution",children:[v.jsx(Et,{variant:"link",onClick:n,children:"License Information"}),v.jsxs(fn,{isOpen:t,onClose:r,children:[v.jsx(Pn,{}),v.jsxs(wn,{children:[v.jsx(kn,{children:"License Information"}),v.jsx(Cn,{}),v.jsx(Sn,{children:e})]})]})]})})};function Wo({federalState:e,frontendState:t}){const n=e?To[e]:void 0,r=i=>{tr.changeLanguage(i)},{t:a}=er(),o=window.isTouchDevice?Bo:Do,s=v.jsxs(v.Fragment,{children:[(t=="Map"||t=="Results"||t=="DrawPV")&&v.jsxs("p",{className:"copyright",children:["Basiskarte ©"," ",v.jsx("a",{href:"https://www.bkg.bund.de",target:"_blank",children:"BKG"})," (",v.jsx("a",{href:"https://www.govdata.de/dl-de/by-2-0",target:"_blank",children:"dl-de/by-2-0"}),") | Geländemodell: ",v.jsx("a",{href:"https://sonny.4lima.de",target:"_blank",children:"© Sonny"})," (",v.jsx("a",{href:"https://creativecommons.org/licenses/by/4.0/deed.en",target:"_blank",children:"CC-BY-4.0"}),"), erstellt aus",v.jsx("a",{href:"https://drive.google.com/file/d/1rgGA22Ha42ulQORK9Pfp4JPpPAIKFx6Q/view",target:"_blank",children:"verschiedenen Quellen"})]},"map-attribution"),e&&v.jsx(v.Fragment,{children:v.jsxs("p",{className:"copyright",style:e?{}:{display:"none"},children:["Gebäudedaten ©"," ",v.jsx("a",{href:n.link,target:"_blank",children:n.attribution})," (",v.jsx("a",{href:_o[n.license],target:"_blank",children:n.license}),")"]},e)}),v.jsxs("p",{className:"copyright",children:["© ",v.jsx("a",{href:"https://github.com/open-pv",target:"_blank",children:"Team OpenPV"})," | ",v.jsx("a",{href:"/Impressum",children:"Impressum"})," | ",v.jsx("a",{href:"/Datenschutz",children:a("Footer.privacyPolicy")})," | ",v.jsx("a",{href:"",onClick:i=>{i.preventDefault(),r("en")},children:"English"})," | ",v.jsx("a",{href:"",onClick:i=>{i.preventDefault(),r("de")},children:"German"})]})]});return v.jsx(o,{children:s})}export{Et as B,Wo as F,rt as L,fn as M,Oa as O,Lo as T,Ma as U,Aa as a,Pn as b,wn as c,kn as d,Cn as e,Sn as f,ft as g,Ro as h,W as i,ce as j,So as k,To as l,nr as m,ur as u,j as w}; diff --git a/assets/Impressum-DBV6waNB.js b/assets/Impressum-B9uORefi.js similarity index 97% rename from assets/Impressum-DBV6waNB.js rename to assets/Impressum-B9uORefi.js index 4863455..f37c146 100644 --- a/assets/Impressum-DBV6waNB.js +++ b/assets/Impressum-B9uORefi.js @@ -1 +1 @@ -import{j as e,M as n}from"./index-CtCGTwpN.js";import{C as r,a as t,H as i,b as s}from"./heading-eSNaMiYV.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,{as:"h1",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-DZP_WaxS.js";import{C as r,a as t,H as i,b as s}from"./heading-D46BZoGw.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,{as:"h1",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-CC9rkVA0.js b/assets/Map-B8jw3anQ.js similarity index 98% rename from assets/Map-CC9rkVA0.js rename to assets/Map-B8jw3anQ.js index b5e714a..d127327 100644 --- a/assets/Map-CC9rkVA0.js +++ b/assets/Map-B8jw3anQ.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/maplibre-gl-CZHzs_cP.js","assets/index-CtCGTwpN.js","assets/index-CzQ50VWX.css"])))=>i.map(i=>d[i]); -import{f as N,j as d,B as Q,c as te,t as R,r as I,a as ne,u as oe,b as se,d as i,e as J,_ as re,g as P,h as ae,M as ie}from"./index-CtCGTwpN.js";import{T as le,B as j,L as ce,a as ue,u as de,M as fe,b as me,c as he,d as ge,e as pe,f as ve,F as ye}from"./Footer-BC_OGLFm.js";import{I as _e,r as O,M as xe}from"./location-Bzn15Ms3.js";import{I as be}from"./image-jfUXVBUx.js";const Y=N(function(t,s){const{size:n,centerContent:o=!0,...r}=t,a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return d.jsx(Q,{ref:s,boxSize:n,__css:{...a,flexShrink:0,flexGrow:0},...r})});Y.displayName="Square";const X=N(function(t,s){const{size:n,...o}=t;return d.jsx(Y,{size:n,ref:s,borderRadius:"9999px",...o})});X.displayName="Circle";const ee=N(function(t,s){const{direction:n,align:o,justify:r,wrap:a,basis:l,grow:u,shrink:c,...f}=t,_={display:"flex",flexDirection:n,alignItems:o,justifyContent:r,flexWrap:a,flexBasis:l,flexGrow:u,flexShrink:c};return d.jsx(te.div,{ref:s,__css:_,...f})});ee.displayName="Flex";function Ce(e,t){const s=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[s];return(o==null?void 0:o[t])??s}function Se(e,t){const s=o=>({...t,...o,position:Ce((o==null?void 0:o.position)??(t==null?void 0:t.position),e)}),n=o=>{const r=s(o),a=ne(r);return R.notify(a,r)};return n.update=(o,r)=>{R.update(o,s(r))},n.promise=(o,r)=>{const a=n({...r.loading,status:"loading",duration:null});o.then(l=>n.update(a,{status:"success",duration:5e3,...I(r.success,l)})).catch(l=>n.update(a,{status:"error",duration:5e3,...I(r.error,l)}))},n.closeAll=R.closeAll,n.close=R.close,n.isActive=R.isActive,n}function Me(e){const{theme:t}=oe(),s=se();return i.useMemo(()=>Se(t.direction,{...s,...e}),[e,t.direction,s])}const we=i.createContext(null);function Ee(e,t){const s=Array.isArray(e)?e[0]:e?e.x:0,n=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0;return s===o&&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 s=0;s{let o=null;"interactive"in n&&(o=Object.assign({},n),delete o.interactive);const r=t[n.ref];if(r){o=o||Object.assign({},n),delete o.ref;for(const a of Re)a in r&&(o[a]=r[a])}return o||n});return{...e,layers:s}}var Z={};const H={version:8,sources:{},layers:[]},q={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"},F={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"},$={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"},Te=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],je=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class L{constructor(t,s,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=o=>{const r=this.props[$[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const r=this.props[q[o.type]];r&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),r(o),delete o.features)},this._onCameraEvent=o=>{if(!this._internalUpdate){const r=this.props[F[o.type]];r&&r(o)}o.type in this._deferredEvents&&(this._deferredEvents[o.type]=!1)},this._MapClass=t,this.props=s,this._initialize(n)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const s=this.props;this.props=t;const n=this._updateSettings(t,s);n&&this._createShadowTransform(this._map);const o=this._updateSize(t),r=this._updateViewState(t,!0);this._updateStyle(t,s),this._updateStyleComponents(t,s),this._updateHandlers(t,s),(n||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(t,s){const n=L.savedMaps.pop();if(!n)return null;const o=n.map,r=o.getContainer();for(s.className=r.className;r.childNodes.length>0;)s.appendChild(r.childNodes[0]);o._container=s;const a=o._resizeObserver;a&&(a.disconnect(),a.observe(s)),n.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:l}=t;return l&&(l.bounds?o.fitBounds(l.bounds,{...l.fitBoundsOptions,duration:0}):n._updateViewState(l,!1)),o.isStyleLoaded()?o.fire("load"):o.once("styledata",()=>o.fire("load")),o._update(),n}_initialize(t){const{props:s}=this,{mapStyle:n=H}=s,o={...s,...s.initialViewState,accessToken:s.mapboxAccessToken||ke()||null,container:t,style:U(n)},r=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),s.gl){const f=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=f,s.gl)}const a=new this._MapClass(o);r.padding&&a.setPadding(r.padding),s.cursor&&(a.getCanvas().style.cursor=s.cursor),this._createShadowTransform(a);const l=a._render;a._render=f=>{this._inRender=!0,l.call(a,f),this._inRender=!1};const u=a._renderTaskQueue.run;a._renderTaskQueue.run=f=>{u.call(a._renderTaskQueue,f),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,{}),W(a.transform,this._renderTransform)}),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const f in q)a.on(f,this._onPointerEvent);for(const f in F)a.on(f,this._onCameraEvent);for(const f in $)a.on(f,this._onEvent);this._map=a}recycle(){const s=this.map.getContainer().querySelector("[mapboxgl-children]");s==null||s.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 s=Le(t.transform);t.painter.transform=s,this._renderTransform=s}_updateSize(t){const{viewState:s}=t;if(s){const n=this._map;if(s.width!==n.transform.width||s.height!==n.transform.height)return n.resize(),!0}return!1}_updateViewState(t,s){if(this._internalUpdate)return!1;const n=this._map,o=this._renderTransform,{zoom:r,pitch:a,bearing:l}=o,u=n.isMoving();u&&(o.cameraElevationReference="sea");const c=V(o,{...B(n.transform),...t});if(u&&(o.cameraElevationReference="ground"),c&&s){const f=this._deferredEvents;f.move=!0,f.zoom||(f.zoom=r!==o.zoom),f.rotate||(f.rotate=l!==o.bearing),f.pitch||(f.pitch=a!==o.pitch)}return u||V(n.transform,t),c}_updateSettings(t,s){const n=this._map;let o=!1;for(const r of Te)if(r in t&&!M(t[r],s[r])){o=!0;const a=n[`set${r[0].toUpperCase()}${r.slice(1)}`];a==null||a.call(n,t[r])}return o}_updateStyle(t,s){if(t.cursor!==s.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==s.mapStyle){const{mapStyle:n=H,styleDiffing:o=!0}=t,r={diff:o};return"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(U(n),r),!0}return!1}_updateStyleComponents(t,s){const n=this._map;let o=!1;return n.isStyleLoaded()&&("light"in t&&n.setLight&&!M(t.light,s.light)&&(o=!0,n.setLight(t.light)),"fog"in t&&n.setFog&&!M(t.fog,s.fog)&&(o=!0,n.setFog(t.fog)),"terrain"in t&&n.setTerrain&&!M(t.terrain,s.terrain)&&(!t.terrain||n.getSource(t.terrain.source))&&(o=!0,n.setTerrain(t.terrain))),o}_updateHandlers(t,s){var n,o;const r=this._map;let a=!1;for(const l of je){const u=(n=t[l])!==null&&n!==void 0?n:!0,c=(o=s[l])!==null&&o!==void 0?o:!0;M(u,c)||(a=!0,u?r[l].enable(u):r[l].disable())}return a}_queryRenderedFeatures(t){const s=this._map,n=s.transform,{interactiveLayerIds:o=[]}=this.props;try{return s.transform=this._renderTransform,s.queryRenderedFeatures(t,{layers:o.filter(s.getLayer.bind(s))})}catch{return[]}finally{s.transform=n}}_updateHover(t){var s;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const r=t.type,a=((s=this._hoveredFeatures)===null||s===void 0?void 0:s.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,s,n){const o=this._map,r=o.transform,a=typeof s=="string"?s:s.type;return a==="move"&&this._updateViewState(this.props,!1),a in F&&(typeof s=="object"&&(s.viewState=B(r)),this._map.isMoving())?(o.transform=this._renderTransform,t.call(o,s,n),o.transform=r,o):(t.call(o,s,n),o)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const n in this._deferredEvents)this._deferredEvents[n]&&t.fire(n);this._internalUpdate=!1;const s=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{W(this._renderTransform,s),t.transform=s}}}L.savedMaps=[];function ke(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||Z.MapboxAccessToken}catch{}try{e=e||Z.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const Pe=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function ze(e){if(!e)return null;const t=e.map,s={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 o=t.transform;t.transform=e.transform;const r=t.project(n);return t.transform=o,r},unproject:n=>{const o=t.transform;t.transform=e.transform;const r=t.unproject(n);return t.transform=o,r},queryTerrainElevation:(n,o)=>{const r=t.transform;t.transform=e.transform;const a=t.queryTerrainElevation(n,o);return t.transform=r,a},queryRenderedFeatures:(n,o)=>{const r=t.transform;t.transform=e.transform;const a=t.queryRenderedFeatures(n,o);return t.transform=r,a}};for(const n of Ae(t))!(n in s)&&!Pe.includes(n)&&(s[n]=t[n].bind(t));return s}function Ae(e){const t=new Set;let s=e;for(;s;){for(const n of Object.getOwnPropertyNames(s))n[0]!=="_"&&typeof e[n]=="function"&&n!=="fire"&&n!=="setEventedParent"&&t.add(n);s=Object.getPrototypeOf(s)}return Array.from(t)}const Fe=typeof document<"u"?i.useLayoutEffect:i.useEffect,Ne=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function De(e,t){for(const n of Ne)n in t&&(e[n]=t[n]);const{RTLTextPlugin:s="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;s&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(s,n=>{n&&console.error(n)},!0)}const z=i.createContext(null);function Ie(e,t,s){const n=i.useContext(we),[o,r]=i.useState(null),a=i.useRef(),{current:l}=i.useRef({mapLib:null,map:null});i.useEffect(()=>{const f=e.mapLib;let _=!0,v;return Promise.resolve(f||s).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(De(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=ze(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())}},[]),Fe(()=>{o&&o.setProps(e)}),i.useImperativeHandle(t,()=>l.map,[o]);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},o&&i.createElement(z.Provider,{value:l},i.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const Oe=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function w(e,t){if(!e||!t)return;const s=e.style;for(const n in t){const o=t[n];Number.isFinite(o)&&!Oe.test(n)?s[n]=`${o}px`:s[n]=o}}function We(e,t){const{map:s,mapLib:n}=i.useContext(z),o=i.useRef({props:e});o.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=o.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=o.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=o.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=o.current.props).onDragEnd)===null||y===void 0||y.call(h,b)}),x},[]);i.useEffect(()=>(r.addTo(s.getMap()),()=>{r.remove()}),[]);const{longitude:a,latitude:l,offset:u,style:c,draggable:f=!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&&!Ee(r.getOffset(),u)&&r.setOffset(u),r.isDraggable()!==f&&r.setDraggable(f),r.getRotation()!==v&&r.setRotation(v),r.getRotationAlignment()!==g&&r.setRotationAlignment(g),r.getPitchAlignment()!==p&&r.setPitchAlignment(p),r.getPopup()!==_&&r.setPopup(_),J.createPortal(e.children,r.getElement())}i.memo(i.forwardRef(We));function G(e){return new Set(e?e.trim().split(/\s+/):[])}function Be(e,t){const{map:s,mapLib:n}=i.useContext(z),o=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 f,_;(_=(f=r.current.props).onOpen)===null||_===void 0||_.call(f,c)}),u},[]);if(i.useEffect(()=>{const l=u=>{var c,f;(f=(c=r.current.props).onClose)===null||f===void 0||f.call(c,u)};return a.on("close",l),a.setDOMContent(o).addTo(s.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=G(a.options.className),u=G(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 J.createPortal(e.children,o)}const Ve=i.memo(i.forwardRef(Be));function k(e,t,s,n){const o=i.useContext(z),r=i.useMemo(()=>e(o),[]);return i.useEffect(()=>{const a=t,l=typeof t=="function"&&typeof s=="function"?t:null,u=typeof t=="function"?t:null,{map:c}=o;return c.hasControl(r)||(c.addControl(r,a==null?void 0:a.position),l&&l(o)),()=>{u&&u(o),c.hasControl(r)&&c.removeControl(r)}},[]),r}function Ue(e){const t=k(({mapLib:s})=>new s.AttributionControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}i.memo(Ue);function Ze(e){const t=k(({mapLib:s})=>new s.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return i.useEffect(()=>{w(t._controlContainer,e.style)},[e.style]),null}i.memo(Ze);function He(e,t){const s=i.useRef({props:e}),n=k(({mapLib:o})=>{const r=new o.GeolocateControl(e),a=r._setupUI;return r._setupUI=l=>{r._container.hasChildNodes()||a(l)},r.on("geolocate",l=>{var u,c;(c=(u=s.current.props).onGeolocate)===null||c===void 0||c.call(u,l)}),r.on("error",l=>{var u,c;(c=(u=s.current.props).onError)===null||c===void 0||c.call(u,l)}),r.on("outofmaxbounds",l=>{var u,c;(c=(u=s.current.props).onOutOfMaxBounds)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationstart",l=>{var u,c;(c=(u=s.current.props).onTrackUserLocationStart)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationend",l=>{var u,c;(c=(u=s.current.props).onTrackUserLocationEnd)===null||c===void 0||c.call(u,l)}),r},{position:e.position});return s.current.props=e,i.useImperativeHandle(t,()=>n,[]),i.useEffect(()=>{w(n._container,e.style)},[e.style]),null}i.memo(i.forwardRef(He));function qe(e){const t=k(({mapLib:s})=>new s.NavigationControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}const $e=i.memo(qe);function Ge(e){const t=k(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),s=i.useRef(e),n=s.current;s.current=e;const{style:o}=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,o)},[o]),null}i.memo(Ge);const Ke=re(()=>import("./maplibre-gl-CZHzs_cP.js").then(e=>e.m),__vite__mapDeps([0,1,2])),Qe=i.forwardRef(function(t,s){return Ie(t,s,Ke)}),Je=Ve,Ye=$e;function K({lat:e,lon:t,display_name:s}){const{t:n}=P(),o=ae(),r=()=>{o(`/simulation/${t}/${e}`)},[a,l]=i.useState(!0);return i.useEffect(()=>{console.log("effect changed"),l(!0)},[e,t]),d.jsx(d.Fragment,{children:a&&d.jsxs(Je,{latitude:e,longitude:t,closeOnClick:!1,onClose:()=>l(!1),children:[d.jsx(le,{children:s}),d.jsx(j,{onClick:r,children:n("startSimulation")})]})})}function Xe({callback:e}){const[t,s]=i.useState(""),[n,o]=i.useState([]),[r,a]=i.useState(!1),[l,u]=i.useState(!1),c=i.useRef([]),f=i.useRef(),_=i.useRef(),[v,g]=i.useState(-1);window.searchFieldInput=t;const{t:p}=P();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 D=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",D),o(D.features.map(C=>{let A=C.properties.name;return b&&(A+=" "+b),A+=", "+C.properties.postcode+" "+C.properties.city,A}))}catch(y){console.error("Error fetching suggestions:",y)}else o([]);a(n.length>0)}},200);return()=>clearTimeout(h)},[t,l]);const S=async m=>{m.preventDefault();const h=await O(t);console.warn(h),e(h)},E=m=>{s(m),O(m).then(h=>{console.warn(h),e(h)}),o([]),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&&f.current.focus()},[v]),d.jsxs("form",{ref:_,onSubmit:S,style:{display:"flex",flexDirection:"column",alignItems:"stretch",padding:"5px",position:"relative"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[d.jsx(_e,{ref:f,value:t,placeholder:p("searchField.placeholder"),onChange:m=>s(m.target.value),onKeyDown:x,margin:"5px",autoComplete:"street-address"}),d.jsx(j,{margin:"5px",minWidth:"150px",type:"submit",children:p("Search")})]}),r&&d.jsx(ce,{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)=>d.jsx(ue,{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 T({image:e,text:t}){return d.jsxs(Q,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",children:[e&&d.jsx(be,{src:e.src,alt:e.alt,style:{maxHeight:"200px",width:"auto",margin:"20px"}}),t]})}function et(){const{isOpen:e,onOpen:t,onClose:s}=de({defaultIsOpen:!0}),[n,o]=i.useState(1),{t:r,i18n:a}=P(),l=5,u=()=>{n{n>1&&o(n-1)};return d.jsxs(fe,{isOpen:e,onClose:s,size:"xl",children:[d.jsx(me,{}),d.jsxs(he,{children:[d.jsx(ge,{as:"h1",children:r("WelcomeMessage.title")}),d.jsx(pe,{}),d.jsxs(ve,{children:[n===1&&d.jsx(T,{image:{src:"images/WelcomeMessage1.png",alt:"Screenshot from the Search Input, where some address is written down."},text:r("WelcomeMessage.firstPage")}),n===2&&d.jsx(T,{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&&d.jsx(T,{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&&d.jsx(T,{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&&d.jsx(T,{text:r("WelcomeMessage.fifthPage")})]}),d.jsxs(xe,{children:[d.jsx(j,{mr:3,onClick:c,isDisabled:n===1,children:r("previous")}),n!=5&&d.jsx(j,{mr:3,onClick:u,isDisabled:n===l,children:r("next")}),n==5&&d.jsx(j,{mr:3,onClick:s,children:r("close")})]}),d.jsx(ee,{justifyContent:"center",mb:4,children:Array.from({length:l},(f,_)=>_+1).map(f=>d.jsx(X,{size:"10px",bg:n===f?"blue.500":"gray.300",m:1},f))})]})]})}function at(){const{t:e}=P(),t=[5.98,47.3,15.1,55],[s,n]=i.useState({bounds:t}),[o,r]=i.useState([]),a=Me(),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=>d.jsx(K,{...p},p.key)))},u=i.useRef(),c=i.useCallback(g=>{u.current=g,g!==null&&(g.getMap().dragRotate.disable(),g.getMap().touchZoomRotate.disableRotation())},[]),[f,_]=i.useState(null),v=i.useCallback(g=>{console.log(g);const{lng:p,lat:S}=g.lngLat;_([S,p])});return d.jsxs(ie,{description:e("mainDescription"),children:[d.jsx("header",{children:d.jsx("div",{className:"title",children:d.jsx(Xe,{callback:l})})}),d.jsx(et,{}),d.jsxs("div",{className:"content",children:[d.jsxs(Qe,{ref:c,...s,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:[d.jsx(d.Fragment,{children:o}),f&&d.jsx(K,{lat:f[0],lon:f[1],display_name:e("map.userSelection")},"userSelectiion"),d.jsx(Ye,{position:"bottom-right",showCompass:!1})]}),d.jsx(ye,{federalState:"",frontendState:"Map"})]})]})}export{at as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/maplibre-gl-w1doICML.js","assets/index-DZP_WaxS.js","assets/index-CzQ50VWX.css"])))=>i.map(i=>d[i]); +import{f as N,j as d,B as Q,c as te,t as R,r as I,a as ne,u as oe,b as se,d as i,e as J,_ as re,g as P,h as ae,M as ie}from"./index-DZP_WaxS.js";import{T as le,B as j,L as ce,a as ue,u as de,M as fe,b as me,c as he,d as ge,e as pe,f as ve,F as ye}from"./Footer-C3QM0Uoc.js";import{I as _e,r as O,M as xe}from"./location-BMuwxVaI.js";import{I as be}from"./image-x7XY6IFe.js";const Y=N(function(t,s){const{size:n,centerContent:o=!0,...r}=t,a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return d.jsx(Q,{ref:s,boxSize:n,__css:{...a,flexShrink:0,flexGrow:0},...r})});Y.displayName="Square";const X=N(function(t,s){const{size:n,...o}=t;return d.jsx(Y,{size:n,ref:s,borderRadius:"9999px",...o})});X.displayName="Circle";const ee=N(function(t,s){const{direction:n,align:o,justify:r,wrap:a,basis:l,grow:u,shrink:c,...f}=t,_={display:"flex",flexDirection:n,alignItems:o,justifyContent:r,flexWrap:a,flexBasis:l,flexGrow:u,flexShrink:c};return d.jsx(te.div,{ref:s,__css:_,...f})});ee.displayName="Flex";function Ce(e,t){const s=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[s];return(o==null?void 0:o[t])??s}function Se(e,t){const s=o=>({...t,...o,position:Ce((o==null?void 0:o.position)??(t==null?void 0:t.position),e)}),n=o=>{const r=s(o),a=ne(r);return R.notify(a,r)};return n.update=(o,r)=>{R.update(o,s(r))},n.promise=(o,r)=>{const a=n({...r.loading,status:"loading",duration:null});o.then(l=>n.update(a,{status:"success",duration:5e3,...I(r.success,l)})).catch(l=>n.update(a,{status:"error",duration:5e3,...I(r.error,l)}))},n.closeAll=R.closeAll,n.close=R.close,n.isActive=R.isActive,n}function Me(e){const{theme:t}=oe(),s=se();return i.useMemo(()=>Se(t.direction,{...s,...e}),[e,t.direction,s])}const we=i.createContext(null);function Ee(e,t){const s=Array.isArray(e)?e[0]:e?e.x:0,n=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0;return s===o&&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 s=0;s{let o=null;"interactive"in n&&(o=Object.assign({},n),delete o.interactive);const r=t[n.ref];if(r){o=o||Object.assign({},n),delete o.ref;for(const a of Re)a in r&&(o[a]=r[a])}return o||n});return{...e,layers:s}}var Z={};const H={version:8,sources:{},layers:[]},q={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"},F={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"},$={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"},Te=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],je=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class L{constructor(t,s,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=o=>{const r=this.props[$[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const r=this.props[q[o.type]];r&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),r(o),delete o.features)},this._onCameraEvent=o=>{if(!this._internalUpdate){const r=this.props[F[o.type]];r&&r(o)}o.type in this._deferredEvents&&(this._deferredEvents[o.type]=!1)},this._MapClass=t,this.props=s,this._initialize(n)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const s=this.props;this.props=t;const n=this._updateSettings(t,s);n&&this._createShadowTransform(this._map);const o=this._updateSize(t),r=this._updateViewState(t,!0);this._updateStyle(t,s),this._updateStyleComponents(t,s),this._updateHandlers(t,s),(n||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(t,s){const n=L.savedMaps.pop();if(!n)return null;const o=n.map,r=o.getContainer();for(s.className=r.className;r.childNodes.length>0;)s.appendChild(r.childNodes[0]);o._container=s;const a=o._resizeObserver;a&&(a.disconnect(),a.observe(s)),n.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:l}=t;return l&&(l.bounds?o.fitBounds(l.bounds,{...l.fitBoundsOptions,duration:0}):n._updateViewState(l,!1)),o.isStyleLoaded()?o.fire("load"):o.once("styledata",()=>o.fire("load")),o._update(),n}_initialize(t){const{props:s}=this,{mapStyle:n=H}=s,o={...s,...s.initialViewState,accessToken:s.mapboxAccessToken||ke()||null,container:t,style:U(n)},r=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),s.gl){const f=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=f,s.gl)}const a=new this._MapClass(o);r.padding&&a.setPadding(r.padding),s.cursor&&(a.getCanvas().style.cursor=s.cursor),this._createShadowTransform(a);const l=a._render;a._render=f=>{this._inRender=!0,l.call(a,f),this._inRender=!1};const u=a._renderTaskQueue.run;a._renderTaskQueue.run=f=>{u.call(a._renderTaskQueue,f),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,{}),W(a.transform,this._renderTransform)}),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const f in q)a.on(f,this._onPointerEvent);for(const f in F)a.on(f,this._onCameraEvent);for(const f in $)a.on(f,this._onEvent);this._map=a}recycle(){const s=this.map.getContainer().querySelector("[mapboxgl-children]");s==null||s.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 s=Le(t.transform);t.painter.transform=s,this._renderTransform=s}_updateSize(t){const{viewState:s}=t;if(s){const n=this._map;if(s.width!==n.transform.width||s.height!==n.transform.height)return n.resize(),!0}return!1}_updateViewState(t,s){if(this._internalUpdate)return!1;const n=this._map,o=this._renderTransform,{zoom:r,pitch:a,bearing:l}=o,u=n.isMoving();u&&(o.cameraElevationReference="sea");const c=V(o,{...B(n.transform),...t});if(u&&(o.cameraElevationReference="ground"),c&&s){const f=this._deferredEvents;f.move=!0,f.zoom||(f.zoom=r!==o.zoom),f.rotate||(f.rotate=l!==o.bearing),f.pitch||(f.pitch=a!==o.pitch)}return u||V(n.transform,t),c}_updateSettings(t,s){const n=this._map;let o=!1;for(const r of Te)if(r in t&&!M(t[r],s[r])){o=!0;const a=n[`set${r[0].toUpperCase()}${r.slice(1)}`];a==null||a.call(n,t[r])}return o}_updateStyle(t,s){if(t.cursor!==s.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==s.mapStyle){const{mapStyle:n=H,styleDiffing:o=!0}=t,r={diff:o};return"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(U(n),r),!0}return!1}_updateStyleComponents(t,s){const n=this._map;let o=!1;return n.isStyleLoaded()&&("light"in t&&n.setLight&&!M(t.light,s.light)&&(o=!0,n.setLight(t.light)),"fog"in t&&n.setFog&&!M(t.fog,s.fog)&&(o=!0,n.setFog(t.fog)),"terrain"in t&&n.setTerrain&&!M(t.terrain,s.terrain)&&(!t.terrain||n.getSource(t.terrain.source))&&(o=!0,n.setTerrain(t.terrain))),o}_updateHandlers(t,s){var n,o;const r=this._map;let a=!1;for(const l of je){const u=(n=t[l])!==null&&n!==void 0?n:!0,c=(o=s[l])!==null&&o!==void 0?o:!0;M(u,c)||(a=!0,u?r[l].enable(u):r[l].disable())}return a}_queryRenderedFeatures(t){const s=this._map,n=s.transform,{interactiveLayerIds:o=[]}=this.props;try{return s.transform=this._renderTransform,s.queryRenderedFeatures(t,{layers:o.filter(s.getLayer.bind(s))})}catch{return[]}finally{s.transform=n}}_updateHover(t){var s;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const r=t.type,a=((s=this._hoveredFeatures)===null||s===void 0?void 0:s.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,s,n){const o=this._map,r=o.transform,a=typeof s=="string"?s:s.type;return a==="move"&&this._updateViewState(this.props,!1),a in F&&(typeof s=="object"&&(s.viewState=B(r)),this._map.isMoving())?(o.transform=this._renderTransform,t.call(o,s,n),o.transform=r,o):(t.call(o,s,n),o)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const n in this._deferredEvents)this._deferredEvents[n]&&t.fire(n);this._internalUpdate=!1;const s=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{W(this._renderTransform,s),t.transform=s}}}L.savedMaps=[];function ke(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||Z.MapboxAccessToken}catch{}try{e=e||Z.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const Pe=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function ze(e){if(!e)return null;const t=e.map,s={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 o=t.transform;t.transform=e.transform;const r=t.project(n);return t.transform=o,r},unproject:n=>{const o=t.transform;t.transform=e.transform;const r=t.unproject(n);return t.transform=o,r},queryTerrainElevation:(n,o)=>{const r=t.transform;t.transform=e.transform;const a=t.queryTerrainElevation(n,o);return t.transform=r,a},queryRenderedFeatures:(n,o)=>{const r=t.transform;t.transform=e.transform;const a=t.queryRenderedFeatures(n,o);return t.transform=r,a}};for(const n of Ae(t))!(n in s)&&!Pe.includes(n)&&(s[n]=t[n].bind(t));return s}function Ae(e){const t=new Set;let s=e;for(;s;){for(const n of Object.getOwnPropertyNames(s))n[0]!=="_"&&typeof e[n]=="function"&&n!=="fire"&&n!=="setEventedParent"&&t.add(n);s=Object.getPrototypeOf(s)}return Array.from(t)}const Fe=typeof document<"u"?i.useLayoutEffect:i.useEffect,Ne=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function De(e,t){for(const n of Ne)n in t&&(e[n]=t[n]);const{RTLTextPlugin:s="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;s&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(s,n=>{n&&console.error(n)},!0)}const z=i.createContext(null);function Ie(e,t,s){const n=i.useContext(we),[o,r]=i.useState(null),a=i.useRef(),{current:l}=i.useRef({mapLib:null,map:null});i.useEffect(()=>{const f=e.mapLib;let _=!0,v;return Promise.resolve(f||s).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(De(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=ze(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())}},[]),Fe(()=>{o&&o.setProps(e)}),i.useImperativeHandle(t,()=>l.map,[o]);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},o&&i.createElement(z.Provider,{value:l},i.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const Oe=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function w(e,t){if(!e||!t)return;const s=e.style;for(const n in t){const o=t[n];Number.isFinite(o)&&!Oe.test(n)?s[n]=`${o}px`:s[n]=o}}function We(e,t){const{map:s,mapLib:n}=i.useContext(z),o=i.useRef({props:e});o.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=o.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=o.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=o.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=o.current.props).onDragEnd)===null||y===void 0||y.call(h,b)}),x},[]);i.useEffect(()=>(r.addTo(s.getMap()),()=>{r.remove()}),[]);const{longitude:a,latitude:l,offset:u,style:c,draggable:f=!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&&!Ee(r.getOffset(),u)&&r.setOffset(u),r.isDraggable()!==f&&r.setDraggable(f),r.getRotation()!==v&&r.setRotation(v),r.getRotationAlignment()!==g&&r.setRotationAlignment(g),r.getPitchAlignment()!==p&&r.setPitchAlignment(p),r.getPopup()!==_&&r.setPopup(_),J.createPortal(e.children,r.getElement())}i.memo(i.forwardRef(We));function G(e){return new Set(e?e.trim().split(/\s+/):[])}function Be(e,t){const{map:s,mapLib:n}=i.useContext(z),o=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 f,_;(_=(f=r.current.props).onOpen)===null||_===void 0||_.call(f,c)}),u},[]);if(i.useEffect(()=>{const l=u=>{var c,f;(f=(c=r.current.props).onClose)===null||f===void 0||f.call(c,u)};return a.on("close",l),a.setDOMContent(o).addTo(s.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=G(a.options.className),u=G(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 J.createPortal(e.children,o)}const Ve=i.memo(i.forwardRef(Be));function k(e,t,s,n){const o=i.useContext(z),r=i.useMemo(()=>e(o),[]);return i.useEffect(()=>{const a=t,l=typeof t=="function"&&typeof s=="function"?t:null,u=typeof t=="function"?t:null,{map:c}=o;return c.hasControl(r)||(c.addControl(r,a==null?void 0:a.position),l&&l(o)),()=>{u&&u(o),c.hasControl(r)&&c.removeControl(r)}},[]),r}function Ue(e){const t=k(({mapLib:s})=>new s.AttributionControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}i.memo(Ue);function Ze(e){const t=k(({mapLib:s})=>new s.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return i.useEffect(()=>{w(t._controlContainer,e.style)},[e.style]),null}i.memo(Ze);function He(e,t){const s=i.useRef({props:e}),n=k(({mapLib:o})=>{const r=new o.GeolocateControl(e),a=r._setupUI;return r._setupUI=l=>{r._container.hasChildNodes()||a(l)},r.on("geolocate",l=>{var u,c;(c=(u=s.current.props).onGeolocate)===null||c===void 0||c.call(u,l)}),r.on("error",l=>{var u,c;(c=(u=s.current.props).onError)===null||c===void 0||c.call(u,l)}),r.on("outofmaxbounds",l=>{var u,c;(c=(u=s.current.props).onOutOfMaxBounds)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationstart",l=>{var u,c;(c=(u=s.current.props).onTrackUserLocationStart)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationend",l=>{var u,c;(c=(u=s.current.props).onTrackUserLocationEnd)===null||c===void 0||c.call(u,l)}),r},{position:e.position});return s.current.props=e,i.useImperativeHandle(t,()=>n,[]),i.useEffect(()=>{w(n._container,e.style)},[e.style]),null}i.memo(i.forwardRef(He));function qe(e){const t=k(({mapLib:s})=>new s.NavigationControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}const $e=i.memo(qe);function Ge(e){const t=k(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),s=i.useRef(e),n=s.current;s.current=e;const{style:o}=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,o)},[o]),null}i.memo(Ge);const Ke=re(()=>import("./maplibre-gl-w1doICML.js").then(e=>e.m),__vite__mapDeps([0,1,2])),Qe=i.forwardRef(function(t,s){return Ie(t,s,Ke)}),Je=Ve,Ye=$e;function K({lat:e,lon:t,display_name:s}){const{t:n}=P(),o=ae(),r=()=>{o(`/simulation/${t}/${e}`)},[a,l]=i.useState(!0);return i.useEffect(()=>{console.log("effect changed"),l(!0)},[e,t]),d.jsx(d.Fragment,{children:a&&d.jsxs(Je,{latitude:e,longitude:t,closeOnClick:!1,onClose:()=>l(!1),children:[d.jsx(le,{children:s}),d.jsx(j,{onClick:r,children:n("startSimulation")})]})})}function Xe({callback:e}){const[t,s]=i.useState(""),[n,o]=i.useState([]),[r,a]=i.useState(!1),[l,u]=i.useState(!1),c=i.useRef([]),f=i.useRef(),_=i.useRef(),[v,g]=i.useState(-1);window.searchFieldInput=t;const{t:p}=P();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 D=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",D),o(D.features.map(C=>{let A=C.properties.name;return b&&(A+=" "+b),A+=", "+C.properties.postcode+" "+C.properties.city,A}))}catch(y){console.error("Error fetching suggestions:",y)}else o([]);a(n.length>0)}},200);return()=>clearTimeout(h)},[t,l]);const S=async m=>{m.preventDefault();const h=await O(t);console.warn(h),e(h)},E=m=>{s(m),O(m).then(h=>{console.warn(h),e(h)}),o([]),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&&f.current.focus()},[v]),d.jsxs("form",{ref:_,onSubmit:S,style:{display:"flex",flexDirection:"column",alignItems:"stretch",padding:"5px",position:"relative"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[d.jsx(_e,{ref:f,value:t,placeholder:p("searchField.placeholder"),onChange:m=>s(m.target.value),onKeyDown:x,margin:"5px",autoComplete:"street-address"}),d.jsx(j,{margin:"5px",minWidth:"150px",type:"submit",children:p("Search")})]}),r&&d.jsx(ce,{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)=>d.jsx(ue,{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 T({image:e,text:t}){return d.jsxs(Q,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",children:[e&&d.jsx(be,{src:e.src,alt:e.alt,style:{maxHeight:"200px",width:"auto",margin:"20px"}}),t]})}function et(){const{isOpen:e,onOpen:t,onClose:s}=de({defaultIsOpen:!0}),[n,o]=i.useState(1),{t:r,i18n:a}=P(),l=5,u=()=>{n{n>1&&o(n-1)};return d.jsxs(fe,{isOpen:e,onClose:s,size:"xl",children:[d.jsx(me,{}),d.jsxs(he,{children:[d.jsx(ge,{as:"h1",children:r("WelcomeMessage.title")}),d.jsx(pe,{}),d.jsxs(ve,{children:[n===1&&d.jsx(T,{image:{src:"images/WelcomeMessage1.png",alt:"Screenshot from the Search Input, where some address is written down."},text:r("WelcomeMessage.firstPage")}),n===2&&d.jsx(T,{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&&d.jsx(T,{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&&d.jsx(T,{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&&d.jsx(T,{text:r("WelcomeMessage.fifthPage")})]}),d.jsxs(xe,{children:[d.jsx(j,{mr:3,onClick:c,isDisabled:n===1,children:r("previous")}),n!=5&&d.jsx(j,{mr:3,onClick:u,isDisabled:n===l,children:r("next")}),n==5&&d.jsx(j,{mr:3,onClick:s,children:r("close")})]}),d.jsx(ee,{justifyContent:"center",mb:4,children:Array.from({length:l},(f,_)=>_+1).map(f=>d.jsx(X,{size:"10px",bg:n===f?"blue.500":"gray.300",m:1},f))})]})]})}function at(){const{t:e}=P(),t=[5.98,47.3,15.1,55],[s,n]=i.useState({bounds:t}),[o,r]=i.useState([]),a=Me(),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=>d.jsx(K,{...p},p.key)))},u=i.useRef(),c=i.useCallback(g=>{u.current=g,g!==null&&(g.getMap().dragRotate.disable(),g.getMap().touchZoomRotate.disableRotation())},[]),[f,_]=i.useState(null),v=i.useCallback(g=>{console.log(g);const{lng:p,lat:S}=g.lngLat;_([S,p])});return d.jsxs(ie,{description:e("mainDescription"),children:[d.jsx("header",{children:d.jsx("div",{className:"title",children:d.jsx(Xe,{callback:l})})}),d.jsx(et,{}),d.jsxs("div",{className:"content",children:[d.jsxs(Qe,{ref:c,...s,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:[d.jsx(d.Fragment,{children:o}),f&&d.jsx(K,{lat:f[0],lon:f[1],display_name:e("map.userSelection")},"userSelectiion"),d.jsx(Ye,{position:"bottom-right",showCompass:!1})]}),d.jsx(ye,{federalState:"",frontendState:"Map"})]})]})}export{at as default}; diff --git a/assets/NotFound-D-mYvcMO.js b/assets/NotFound-DujQ5K-T.js similarity index 84% rename from assets/NotFound-D-mYvcMO.js rename to assets/NotFound-DujQ5K-T.js index 92a62f2..b615bb4 100644 --- a/assets/NotFound-D-mYvcMO.js +++ b/assets/NotFound-DujQ5K-T.js @@ -1 +1 @@ -import{j as e,S as n,T as o,U as t}from"./index-CtCGTwpN.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,S as n,T as o,U as t}from"./index-DZP_WaxS.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-x5IYgVeF.js b/assets/Simulation-Bjnv8os2.js similarity index 87% rename from assets/Simulation-x5IYgVeF.js rename to assets/Simulation-Bjnv8os2.js index 2d85cd1..015afaf 100644 --- a/assets/Simulation-x5IYgVeF.js +++ b/assets/Simulation-Bjnv8os2.js @@ -1,13 +1,13 @@ -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-BY1gll4A.js","assets/index-CtCGTwpN.js","assets/index-CzQ50VWX.css","assets/heading-eSNaMiYV.js","assets/Footer-BC_OGLFm.js","assets/location-Bzn15Ms3.js","assets/stack-DvvG7f8C.js","assets/packbits-DQnG8s9w.js","assets/lerc-DtKC9ro-.js","assets/webimage-BcnuJlio.js"])))=>i.map(i=>d[i]); -var iI=Object.defineProperty;var sI=(n,t,e)=>t in n?iI(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var cr=(n,t,e)=>sI(n,typeof t!="symbol"?t+"":t,e);import{i as rI,k as Ko,d as J,j as V,A as Lv,m as Dv,l as os,o as ST,n as By,p as ET,q as Ye,s as Ln,v as Ha,f as Gi,w as AT,x as _f,c as cn,y as U0,z as Nv,C as k0,D as Ov,E as aI,F as Hy,G as oI,P as lI,g as Qa,I as cI,R as z0,H as xf,_ as xl,B as ca,J as TT,K as CT,L as hI,N as uI,O as fI,M as dI}from"./index-CtCGTwpN.js";import{C as pI,a as mI,H as gI,b as yI}from"./heading-eSNaMiYV.js";import{w as Um,g as uu,M as Fv,h as Fx,i as _I,j as xI,k as vI,u as sl,B as yr,l as MI,b as Uv,c as RT,d as kv,e as zv,f as Bv,T as Bo,U as PT,a as Go,F as bI}from"./Footer-BC_OGLFm.js";import{u as wI,a as IT,b as SI,c as EI,p as AI,d as km,F as Gy,I as Vy,M as TI,e as CI,x as RI}from"./location-Bzn15Ms3.js";import{S as PI}from"./stack-DvvG7f8C.js";function II(n,t,e,i){return n.addEventListener(t,e,i),()=>{n.removeEventListener(t,e,i)}}function LI(n){return n.view??window}function DI(n){const t=LI(n);return typeof t.PointerEvent<"u"&&n instanceof t.PointerEvent?n.pointerType==="mouse":n instanceof t.MouseEvent}function LT(n){return!!n.touches}function NI(n){return LT(n)&&n.touches.length>1}function OI(n,t="page"){const e=n.touches[0]||n.changedTouches[0];return{x:e[`${t}X`],y:e[`${t}Y`]}}function FI(n,t="page"){return{x:n[`${t}X`],y:n[`${t}Y`]}}function DT(n,t="page"){return LT(n)?OI(n,t):FI(n,t)}function UI(n){return t=>{const e=DI(t);(!e||e&&t.button===0)&&n(t)}}function kI(n,t=!1){function e(s){n(s,{point:DT(s)})}return t?UI(e):e}function Mm(n,t,e,i){return II(n,t,kI(e,t==="pointerdown"),i)}function zI(n){const t=parseFloat(n);return typeof t!="number"||Number.isNaN(t)?0:t}function BI(n,t){let e=zI(n);const i=10**(t??10);return e=Math.round(e*i)/i,t?e.toFixed(t):e.toString()}function HI(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 sw(n,t,e){return(n-t)*100/(e-t)}function GI(n,t,e){return(e-t)*n+t}function rw(n,t,e){const i=Math.round((n-t)/e)*e+t,s=HI(e);return BI(i,s)}function Wy(n,t,e){return n==null?n:(e{const{condition:t,message:e}=n};function jy(n,t,e,i){const s=Ko(e);return J.useEffect(()=>{const r=typeof n=="function"?n():n??document;if(!(!e||!r))return r.addEventListener(t,s,i),()=>{r.removeEventListener(t,s,i)}},[t,n,i,s,e]),()=>{const r=typeof n=="function"?n():n??document;r==null||r.removeEventListener(t,s,i)}}function OT(n){const t=J.useRef(null);return t.current=n,t}function XI(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(s=>{if(!Array.isArray(s)||!s.length)return;const[r]=s;let a,o;if("borderBoxSize"in r){const l=r.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)}const qI=globalThis!=null&&globalThis.document?J.useLayoutEffect:J.useEffect;function YI(n,t){var s;if(!n||!n.parentElement)return;const e=((s=n.ownerDocument)==null?void 0:s.defaultView)??window,i=new e.MutationObserver(()=>{t()});return i.observe(n.parentElement,{childList:!0}),()=>{i.disconnect()}}function $I({getNodes:n,observeMutation:t=!0}){const[e,i]=J.useState([]),[s,r]=J.useState(0);return qI(()=>{const a=n(),o=a.map((l,c)=>XI(l,h=>{i(u=>[...u.slice(0,c),h,...u.slice(c+1)])}));if(t){const l=a[0];o.push(YI(l,()=>{r(c=>c+1)}))}return()=>{o.forEach(l=>{l==null||l()})}},[s]),e}function ZI(n){return typeof n=="object"&&n!==null&&"current"in n}function KI(n){const[t]=$I({observeMutation:!1,getNodes(){return[ZI(n)?n.current:n]}});return t}const FT=1/60*1e3,JI=typeof performance<"u"?()=>performance.now():()=>Date.now(),UT=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(JI()),FT);function QI(n){let t=[],e=[],i=0,s=!1,r=!1;const a=new WeakSet,o={schedule:(l,c=!1,h=!1)=>{const u=h&&s,p=u?t:e;return c&&a.add(l),p.indexOf(l)===-1&&(p.push(l),u&&s&&(i=t.length)),l},cancel:l=>{const c=e.indexOf(l);c!==-1&&e.splice(c,1),a.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,e]=[e,t],e.length=0,i=t.length,i)for(let c=0;c(n[t]=QI(()=>Gu=!0),n),{}),eL=vf.reduce((n,t)=>{const e=B0[t];return n[t]=(i,s=!1,r=!1)=>(Gu||sL(),e.schedule(i,s,r)),n},{}),nL=vf.reduce((n,t)=>(n[t]=B0[t].cancel,n),{});vf.reduce((n,t)=>(n[t]=()=>B0[t].process(Oc),n),{});const iL=n=>B0[n].process(Oc),kT=n=>{Gu=!1,Oc.delta=Ux?FT:Math.max(Math.min(n-Oc.timestamp,tL),1),Oc.timestamp=n,kx=!0,vf.forEach(iL),kx=!1,Gu&&(Ux=!1,UT(kT))},sL=()=>{Gu=!0,Ux=!0,kx||UT(kT)},aw=()=>Oc;var rL=Object.defineProperty,aL=(n,t,e)=>t in n?rL(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ls=(n,t,e)=>(aL(n,typeof t!="symbol"?t+"":t,e),e);class oL{constructor(t,e,i){if(Ls(this,"history",[]),Ls(this,"startEvent",null),Ls(this,"lastEvent",null),Ls(this,"lastEventInfo",null),Ls(this,"handlers",{}),Ls(this,"removeListeners",()=>{}),Ls(this,"threshold",3),Ls(this,"win"),Ls(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const o=Xy(this.lastEventInfo,this.history),l=this.startEvent!==null,c=uL(o.offset,{x:0,y:0})>=this.threshold;if(!l&&!c)return;const{timestamp:h}=aw();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)}),Ls(this,"onPointerMove",(o,l)=>{this.lastEvent=o,this.lastEventInfo=l,eL.update(this.updatePoint,!0)}),Ls(this,"onPointerUp",(o,l)=>{const c=Xy(l,this.history),{onEnd:h,onSessionEnd:u}=this.handlers;u==null||u(o,c),this.end(),!(!h||!this.startEvent)&&(h==null||h(o,c))}),this.win=t.view??window,NI(t))return;this.handlers=e,i&&(this.threshold=i),t.stopPropagation(),t.preventDefault();const s={point:DT(t)},{timestamp:r}=aw();this.history=[{...s.point,timestamp:r}];const{onSessionStart:a}=e;a==null||a(t,Xy(s,this.history)),this.removeListeners=hL(Mm(this.win,"pointermove",this.onPointerMove),Mm(this.win,"pointerup",this.onPointerUp),Mm(this.win,"pointercancel",this.onPointerUp))}updateHandlers(t){this.handlers=t}end(){var t;(t=this.removeListeners)==null||t.call(this),nL.update(this.updatePoint)}}function ow(n,t){return{x:n.x-t.x,y:n.y-t.y}}function Xy(n,t){return{point:n.point,delta:ow(n.point,t[t.length-1]),offset:ow(n.point,t[0]),velocity:cL(t,.1)}}const lL=n=>n*1e3;function cL(n,t){if(n.length<2)return{x:0,y:0};let e=n.length-1,i=null;const s=n[n.length-1];for(;e>=0&&(i=n[e],!(s.timestamp-i.timestamp>lL(t)));)e--;if(!i)return{x:0,y:0};const r=(s.timestamp-i.timestamp)/1e3;if(r===0)return{x:0,y:0};const a={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function hL(...n){return t=>n.reduce((e,i)=>i(e),t)}function qy(n,t){return Math.abs(n-t)}function lw(n){return"x"in n&&"y"in n}function uL(n,t){if(typeof n=="number"&&typeof t=="number")return qy(n,t);if(lw(n)&&lw(t)){const e=qy(n.x,t.x),i=qy(n.y,t.y);return Math.sqrt(e**2+i**2)}return 0}function fL(n,t){const{onPan:e,onPanStart:i,onPanEnd:s,onPanSessionStart:r,onPanSessionEnd:a,threshold:o}=t,l=!!(e||i||s||r||a),c=J.useRef(null),h=OT({onSessionStart:r,onSessionEnd:a,onStart:i,onMove:e,onEnd(u,p){c.current=null,s==null||s(u,p)}});J.useEffect(()=>{var u;(u=c.current)==null||u.updateHandlers(h.current)}),J.useEffect(()=>{const u=n.current;if(!u||!l)return;function p(m){c.current=new oL(m,h.current,o)}return Mm(u,"pointerdown",p)},[n,l,h,o]),J.useEffect(()=>()=>{var u;(u=c.current)==null||u.end(),c.current=null},[])}function dL(n,t,e){var i,s;return((s=(i=n.__cssMap)==null?void 0:i[`${t}.${e}`])==null?void 0:s.varRef)??e}const pL=n=>n!=null&&parseInt(n.toString(),10)>0,cw={exit:{height:{duration:.2,ease:uu.ease},opacity:{duration:.3,ease:uu.ease}},enter:{height:{duration:.3,ease:uu.ease},opacity:{duration:.4,ease:uu.ease}}},mL={exit:({animateOpacity:n,startingHeight:t,transition:e,transitionEnd:i,delay:s})=>({...n&&{opacity:pL(t)?1:0},height:t,transitionEnd:i==null?void 0:i.exit,transition:(e==null?void 0:e.exit)??Um.exit(cw.exit,s)}),enter:({animateOpacity:n,endingHeight:t,transition:e,transitionEnd:i,delay:s})=>({...n&&{opacity:1},height:t,transitionEnd:i==null?void 0:i.enter,transition:(e==null?void 0:e.enter)??Um.enter(cw.enter,s)})},zT=J.forwardRef((n,t)=>{const{in:e,unmountOnExit:i,animateOpacity:s=!0,startingHeight:r=0,endingHeight:a="auto",style:o,className:l,transition:c,transitionEnd:h,animatePresenceProps:u,...p}=n,[m,g]=J.useState(!1);J.useEffect(()=>{const S=setTimeout(()=>{g(!0)});return()=>clearTimeout(S)},[]),jI({condition:Number(r)>0&&!!i,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const x=parseFloat(r.toString())>0,y={startingHeight:r,endingHeight:a,animateOpacity:s,transition:m?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:x?"block":"none"}}},_=i?e:!0,b=e||i?"enter":"exit";return V.jsx(Lv,{...u,initial:!1,custom:y,children:_&&V.jsx(Dv.div,{ref:t,...p,className:os("chakra-collapse",l),style:{overflow:"hidden",display:"block",...o},custom:y,variants:mL,initial:i?"exit":!1,animate:b,exit:"exit"})})});zT.displayName="Collapse";var gL=()=>typeof document<"u",hw=!1,Mf=null,rl=!1,zx=!1,Bx=new Set;function Hv(n,t){Bx.forEach(e=>e(n,t))}var yL=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function _L(n){return!(n.metaKey||!yL&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function uw(n){rl=!0,_L(n)&&(Mf="keyboard",Hv("keyboard",n))}function kl(n){if(Mf="pointer",n.type==="mousedown"||n.type==="pointerdown"){rl=!0;const t=n.composedPath?n.composedPath()[0]:n.target;let e=!1;try{e=t.matches(":focus-visible")}catch{}if(e)return;Hv("pointer",n)}}function xL(n){return n.mozInputSource===0&&n.isTrusted?!0:n.detail===0&&!n.pointerType}function vL(n){xL(n)&&(rl=!0,Mf="virtual")}function ML(n){n.target===window||n.target===document||n.target instanceof Element&&n.target.hasAttribute("tabindex")||(!rl&&!zx&&(Mf="virtual",Hv("virtual",n)),rl=!1,zx=!1)}function bL(){rl=!1,zx=!0}function fw(){return Mf!=="pointer"}function wL(){if(!gL()||hw)return;const{focus:n}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...e){rl=!0,n.apply(this,e)},document.addEventListener("keydown",uw,!0),document.addEventListener("keyup",uw,!0),document.addEventListener("click",vL,!0),window.addEventListener("focus",ML,!0),window.addEventListener("blur",bL,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",kl,!0),document.addEventListener("pointermove",kl,!0),document.addEventListener("pointerup",kl,!0)):(document.addEventListener("mousedown",kl,!0),document.addEventListener("mousemove",kl,!0),document.addEventListener("mouseup",kl,!0)),hw=!0}function SL(n){wL(),n(fw());const t=()=>n(fw());return Bx.add(t),()=>{Bx.delete(t)}}const EL={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function AL(n={}){const t=wI(n),{isDisabled:e,isReadOnly:i,isRequired:s,isInvalid:r,id:a,onBlur:o,onFocus:l,"aria-describedby":c}=t,{defaultChecked:h,isChecked:u,isFocusable:p,onChange:m,isIndeterminate:g,name:x,value:y,tabIndex:_=void 0,"aria-label":b,"aria-labelledby":S,"aria-invalid":w,...R}=n,T=ST(R,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),C=Ko(m),L=Ko(o),P=Ko(l),[E,D]=J.useState(!1),[z,G]=J.useState(!1),[W,Q]=J.useState(!1),[Y,ot]=J.useState(!1);J.useEffect(()=>SL(D),[]);const H=J.useRef(null),[Z,it]=J.useState(!0),[$,lt]=J.useState(!!h),_t=u!==void 0,q=_t?u:$,rt=J.useCallback(Et=>{if(i||e){Et.preventDefault();return}_t||lt(q?Et.currentTarget.checked:g?!0:Et.currentTarget.checked),C==null||C(Et)},[i,e,q,_t,g,C]);By(()=>{H.current&&(H.current.indeterminate=!!g)},[g]),ET(()=>{e&&G(!1)},[e,G]),By(()=>{const Et=H.current;if(!(Et!=null&&Et.form))return;const wt=()=>{lt(!!h)};return Et.form.addEventListener("reset",wt),()=>{var Lt;return(Lt=Et.form)==null?void 0:Lt.removeEventListener("reset",wt)}},[]);const St=e&&!p,dt=J.useCallback(Et=>{Et.key===" "&&ot(!0)},[ot]),It=J.useCallback(Et=>{Et.key===" "&&ot(!1)},[ot]);By(()=>{if(!H.current)return;H.current.checked!==q&<(H.current.checked)},[H.current]);const Ht=J.useCallback((Et={},wt=null)=>{const Lt=Ct=>{z&&Ct.preventDefault(),ot(!0)};return{...Et,ref:wt,"data-active":Ye(Y),"data-hover":Ye(W),"data-checked":Ye(q),"data-focus":Ye(z),"data-focus-visible":Ye(z&&E),"data-indeterminate":Ye(g),"data-disabled":Ye(e),"data-invalid":Ye(r),"data-readonly":Ye(i),"aria-hidden":!0,onMouseDown:Ln(Et.onMouseDown,Lt),onMouseUp:Ln(Et.onMouseUp,()=>ot(!1)),onMouseEnter:Ln(Et.onMouseEnter,()=>Q(!0)),onMouseLeave:Ln(Et.onMouseLeave,()=>Q(!1))}},[Y,q,e,z,E,W,g,r,i]),Bt=J.useCallback((Et={},wt=null)=>({...Et,ref:wt,"data-active":Ye(Y),"data-hover":Ye(W),"data-checked":Ye(q),"data-focus":Ye(z),"data-focus-visible":Ye(z&&E),"data-indeterminate":Ye(g),"data-disabled":Ye(e),"data-invalid":Ye(r),"data-readonly":Ye(i)}),[Y,q,e,z,E,W,g,r,i]),Qt=J.useCallback((Et={},wt=null)=>({...T,...Et,ref:Ha(wt,Lt=>{Lt&&it(Lt.tagName==="LABEL")}),htmlFor:Et.htmlFor!==void 0?Et.htmlFor:Z?a:void 0,onClick:Ln(Et.onClick,()=>{var Lt;Z||((Lt=H.current)==null||Lt.click(),requestAnimationFrame(()=>{var Ct;(Ct=H.current)==null||Ct.focus({preventScroll:!0})}))}),"data-disabled":Ye(e),"data-checked":Ye(q),"data-invalid":Ye(r)}),[T,e,q,r,Z,a]),ht=J.useCallback((Et={},wt=null)=>({...Et,ref:Ha(H,wt),type:"checkbox",name:x,value:y,id:a,tabIndex:_,onChange:Ln(Et.onChange,rt),onBlur:Ln(Et.onBlur,L,()=>G(!1)),onFocus:Ln(Et.onFocus,P,()=>G(!0)),onKeyDown:Ln(Et.onKeyDown,dt),onKeyUp:Ln(Et.onKeyUp,It),required:s,checked:q,disabled:St,readOnly:i,"aria-label":b,"aria-labelledby":S,"aria-invalid":w?!!w:r,"aria-describedby":c,"aria-disabled":e,style:EL}),[x,y,a,rt,L,P,dt,It,s,q,St,i,b,S,w,r,c,e,_]),gt=J.useCallback((Et={},wt=null)=>({...Et,ref:wt,onMouseDown:Ln(Et.onMouseDown,TL),"data-disabled":Ye(e),"data-checked":Ye(q),"data-invalid":Ye(r)}),[q,e,r]);return{state:{isInvalid:r,isFocused:z,isChecked:q,isActive:Y,isHovered:W,isIndeterminate:g,isDisabled:e,isReadOnly:i,isRequired:s},getRootProps:Qt,getCheckboxProps:Ht,getIndicatorProps:Bt,getInputProps:ht,getLabelProps:gt,htmlProps:T}}function TL(n){n.preventDefault(),n.stopPropagation()}const vu=Gi(function(t,e){const i=AT("FormLabel",t),s=_f(t),{className:r,children:a,requiredIndicator:o=V.jsx(BT,{}),optionalIndicator:l=null,...c}=s,h=IT(),u=(h==null?void 0:h.getLabelProps(c,e))??{ref:e,...c};return V.jsxs(cn.label,{...u,className:os("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...i},children:[a,h!=null&&h.isRequired?o:l]})});vu.displayName="FormLabel";const BT=Gi(function(t,e){const i=IT(),s=SI();if(!(i!=null&&i.isRequired))return null;const r=os("chakra-form__required-indicator",t.className);return V.jsx(cn.span,{...i==null?void 0:i.getRequiredIndicatorProps(t,e),__css:s.requiredIndicator,className:r})});BT.displayName="RequiredIndicator";var Bi="top",Es="bottom",As="right",Hi="left",Gv="auto",bf=[Bi,Es,As,Hi],Wc="start",Vu="end",CL="clippingParents",HT="viewport",Gh="popper",RL="reference",dw=bf.reduce(function(n,t){return n.concat([t+"-"+Wc,t+"-"+Vu])},[]),GT=[].concat(bf,[Gv]).reduce(function(n,t){return n.concat([t,t+"-"+Wc,t+"-"+Vu])},[]),PL="beforeRead",IL="read",LL="afterRead",DL="beforeMain",NL="main",OL="afterMain",FL="beforeWrite",UL="write",kL="afterWrite",zL=[PL,IL,LL,DL,NL,OL,FL,UL,kL];function Rr(n){return n?(n.nodeName||"").toLowerCase():null}function rs(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function al(n){var t=rs(n).Element;return n instanceof t||n instanceof Element}function Ss(n){var t=rs(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function Vv(n){if(typeof ShadowRoot>"u")return!1;var t=rs(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function BL(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},s=t.attributes[e]||{},r=t.elements[e];!Ss(r)||!Rr(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(a){var o=s[a];o===!1?r.removeAttribute(a):r.setAttribute(a,o===!0?"":o)}))})}function HL(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 s=t.elements[i],r=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},{});!Ss(s)||!Rr(s)||(Object.assign(s.style,o),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const GL={name:"applyStyles",enabled:!0,phase:"write",fn:BL,effect:HL,requires:["computeStyles"]};function br(n){return n.split("-")[0]}var Jo=Math.max,zm=Math.min,jc=Math.round;function Hx(){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 VT(){return!/^((?!chrome|android).)*safari/i.test(Hx())}function Xc(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var i=n.getBoundingClientRect(),s=1,r=1;t&&Ss(n)&&(s=n.offsetWidth>0&&jc(i.width)/n.offsetWidth||1,r=n.offsetHeight>0&&jc(i.height)/n.offsetHeight||1);var a=al(n)?rs(n):window,o=a.visualViewport,l=!VT()&&e,c=(i.left+(l&&o?o.offsetLeft:0))/s,h=(i.top+(l&&o?o.offsetTop:0))/r,u=i.width/s,p=i.height/r;return{width:u,height:p,top:h,right:c+u,bottom:h+p,left:c,x:c,y:h}}function Wv(n){var t=Xc(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 WT(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&Vv(e)){var i=t;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ha(n){return rs(n).getComputedStyle(n)}function VL(n){return["table","td","th"].indexOf(Rr(n))>=0}function to(n){return((al(n)?n.ownerDocument:n.document)||window.document).documentElement}function H0(n){return Rr(n)==="html"?n:n.assignedSlot||n.parentNode||(Vv(n)?n.host:null)||to(n)}function pw(n){return!Ss(n)||ha(n).position==="fixed"?null:n.offsetParent}function WL(n){var t=/firefox/i.test(Hx()),e=/Trident/i.test(Hx());if(e&&Ss(n)){var i=ha(n);if(i.position==="fixed")return null}var s=H0(n);for(Vv(s)&&(s=s.host);Ss(s)&&["html","body"].indexOf(Rr(s))<0;){var r=ha(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function wf(n){for(var t=rs(n),e=pw(n);e&&VL(e)&&ha(e).position==="static";)e=pw(e);return e&&(Rr(e)==="html"||Rr(e)==="body"&&ha(e).position==="static")?t:e||WL(n)||t}function jv(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Mu(n,t,e){return Jo(n,zm(t,e))}function jL(n,t,e){var i=Mu(n,t,e);return i>e?e:i}function jT(){return{top:0,right:0,bottom:0,left:0}}function XT(n){return Object.assign({},jT(),n)}function qT(n,t){return t.reduce(function(e,i){return e[i]=n,e},{})}var XL=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,XT(typeof t!="number"?t:qT(t,bf))};function qL(n){var t,e=n.state,i=n.name,s=n.options,r=e.elements.arrow,a=e.modifiersData.popperOffsets,o=br(e.placement),l=jv(o),c=[Hi,As].indexOf(o)>=0,h=c?"height":"width";if(!(!r||!a)){var u=XL(s.padding,e),p=Wv(r),m=l==="y"?Bi:Hi,g=l==="y"?Es:As,x=e.rects.reference[h]+e.rects.reference[l]-a[l]-e.rects.popper[h],y=a[l]-e.rects.reference[l],_=wf(r),b=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,S=x/2-y/2,w=u[m],R=b-p[h]-u[g],T=b/2-p[h]/2+S,C=Mu(w,T,R),L=l;e.modifiersData[i]=(t={},t[L]=C,t.centerOffset=C-T,t)}}function YL(n){var t=n.state,e=n.options,i=e.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||WT(t.elements.popper,s)&&(t.elements.arrow=s))}const $L={name:"arrow",enabled:!0,phase:"main",fn:qL,effect:YL,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qc(n){return n.split("-")[1]}var ZL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function KL(n,t){var e=n.x,i=n.y,s=t.devicePixelRatio||1;return{x:jc(e*s)/s||0,y:jc(i*s)/s||0}}function mw(n){var t,e=n.popper,i=n.popperRect,s=n.placement,r=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,x=g===void 0?0:g,y=typeof h=="function"?h({x:m,y:x}):{x:m,y:x};m=y.x,x=y.y;var _=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),S=Hi,w=Bi,R=window;if(c){var T=wf(e),C="clientHeight",L="clientWidth";if(T===rs(e)&&(T=to(e),ha(T).position!=="static"&&o==="absolute"&&(C="scrollHeight",L="scrollWidth")),T=T,s===Bi||(s===Hi||s===As)&&r===Vu){w=Es;var P=u&&T===R&&R.visualViewport?R.visualViewport.height:T[C];x-=P-i.height,x*=l?1:-1}if(s===Hi||(s===Bi||s===Es)&&r===Vu){S=As;var E=u&&T===R&&R.visualViewport?R.visualViewport.width:T[L];m-=E-i.width,m*=l?1:-1}}var D=Object.assign({position:o},c&&ZL),z=h===!0?KL({x:m,y:x},rs(e)):{x:m,y:x};if(m=z.x,x=z.y,l){var G;return Object.assign({},D,(G={},G[w]=b?"0":"",G[S]=_?"0":"",G.transform=(R.devicePixelRatio||1)<=1?"translate("+m+"px, "+x+"px)":"translate3d("+m+"px, "+x+"px, 0)",G))}return Object.assign({},D,(t={},t[w]=b?x+"px":"",t[S]=_?m+"px":"",t.transform="",t))}function JL(n){var t=n.state,e=n.options,i=e.gpuAcceleration,s=i===void 0?!0:i,r=e.adaptive,a=r===void 0?!0:r,o=e.roundOffsets,l=o===void 0?!0:o,c={placement:br(t.placement),variation:qc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,mw(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,mw(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 QL={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:JL,data:{}};var Yd={passive:!0};function tD(n){var t=n.state,e=n.instance,i=n.options,s=i.scroll,r=s===void 0?!0:s,a=i.resize,o=a===void 0?!0:a,l=rs(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(h){h.addEventListener("scroll",e.update,Yd)}),o&&l.addEventListener("resize",e.update,Yd),function(){r&&c.forEach(function(h){h.removeEventListener("scroll",e.update,Yd)}),o&&l.removeEventListener("resize",e.update,Yd)}}const eD={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:tD,data:{}};var nD={left:"right",right:"left",bottom:"top",top:"bottom"};function bm(n){return n.replace(/left|right|bottom|top/g,function(t){return nD[t]})}var iD={start:"end",end:"start"};function gw(n){return n.replace(/start|end/g,function(t){return iD[t]})}function Xv(n){var t=rs(n),e=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:e,scrollTop:i}}function qv(n){return Xc(to(n)).left+Xv(n).scrollLeft}function sD(n,t){var e=rs(n),i=to(n),s=e.visualViewport,r=i.clientWidth,a=i.clientHeight,o=0,l=0;if(s){r=s.width,a=s.height;var c=VT();(c||!c&&t==="fixed")&&(o=s.offsetLeft,l=s.offsetTop)}return{width:r,height:a,x:o+qv(n),y:l}}function rD(n){var t,e=to(n),i=Xv(n),s=(t=n.ownerDocument)==null?void 0:t.body,r=Jo(e.scrollWidth,e.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=Jo(e.scrollHeight,e.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),o=-i.scrollLeft+qv(n),l=-i.scrollTop;return ha(s||e).direction==="rtl"&&(o+=Jo(e.clientWidth,s?s.clientWidth:0)-r),{width:r,height:a,x:o,y:l}}function Yv(n){var t=ha(n),e=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+s+i)}function YT(n){return["html","body","#document"].indexOf(Rr(n))>=0?n.ownerDocument.body:Ss(n)&&Yv(n)?n:YT(H0(n))}function bu(n,t){var e;t===void 0&&(t=[]);var i=YT(n),s=i===((e=n.ownerDocument)==null?void 0:e.body),r=rs(i),a=s?[r].concat(r.visualViewport||[],Yv(i)?i:[]):i,o=t.concat(a);return s?o:o.concat(bu(H0(a)))}function Gx(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function aD(n,t){var e=Xc(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 yw(n,t,e){return t===HT?Gx(sD(n,e)):al(t)?aD(t,e):Gx(rD(to(n)))}function oD(n){var t=bu(H0(n)),e=["absolute","fixed"].indexOf(ha(n).position)>=0,i=e&&Ss(n)?wf(n):n;return al(i)?t.filter(function(s){return al(s)&&WT(s,i)&&Rr(s)!=="body"}):[]}function lD(n,t,e,i){var s=t==="clippingParents"?oD(n):[].concat(t),r=[].concat(s,[e]),a=r[0],o=r.reduce(function(l,c){var h=yw(n,c,i);return l.top=Jo(h.top,l.top),l.right=zm(h.right,l.right),l.bottom=zm(h.bottom,l.bottom),l.left=Jo(h.left,l.left),l},yw(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 $T(n){var t=n.reference,e=n.element,i=n.placement,s=i?br(i):null,r=i?qc(i):null,a=t.x+t.width/2-e.width/2,o=t.y+t.height/2-e.height/2,l;switch(s){case Bi:l={x:a,y:t.y-e.height};break;case Es:l={x:a,y:t.y+t.height};break;case As:l={x:t.x+t.width,y:o};break;case Hi:l={x:t.x-e.width,y:o};break;default:l={x:t.x,y:t.y}}var c=s?jv(s):null;if(c!=null){var h=c==="y"?"height":"width";switch(r){case Wc:l[c]=l[c]-(t[h]/2-e[h]/2);break;case Vu:l[c]=l[c]+(t[h]/2-e[h]/2);break}}return l}function Wu(n,t){t===void 0&&(t={});var e=t,i=e.placement,s=i===void 0?n.placement:i,r=e.strategy,a=r===void 0?n.strategy:r,o=e.boundary,l=o===void 0?CL:o,c=e.rootBoundary,h=c===void 0?HT:c,u=e.elementContext,p=u===void 0?Gh:u,m=e.altBoundary,g=m===void 0?!1:m,x=e.padding,y=x===void 0?0:x,_=XT(typeof y!="number"?y:qT(y,bf)),b=p===Gh?RL:Gh,S=n.rects.popper,w=n.elements[g?b:p],R=lD(al(w)?w:w.contextElement||to(n.elements.popper),l,h,a),T=Xc(n.elements.reference),C=$T({reference:T,element:S,strategy:"absolute",placement:s}),L=Gx(Object.assign({},S,C)),P=p===Gh?L:T,E={top:R.top-P.top+_.top,bottom:P.bottom-R.bottom+_.bottom,left:R.left-P.left+_.left,right:P.right-R.right+_.right},D=n.modifiersData.offset;if(p===Gh&&D){var z=D[s];Object.keys(E).forEach(function(G){var W=[As,Es].indexOf(G)>=0?1:-1,Q=[Bi,Es].indexOf(G)>=0?"y":"x";E[G]+=z[Q]*W})}return E}function cD(n,t){t===void 0&&(t={});var e=t,i=e.placement,s=e.boundary,r=e.rootBoundary,a=e.padding,o=e.flipVariations,l=e.allowedAutoPlacements,c=l===void 0?GT:l,h=qc(i),u=h?o?dw:dw.filter(function(g){return qc(g)===h}):bf,p=u.filter(function(g){return c.indexOf(g)>=0});p.length===0&&(p=u);var m=p.reduce(function(g,x){return g[x]=Wu(n,{placement:x,boundary:s,rootBoundary:r,padding:a})[br(x)],g},{});return Object.keys(m).sort(function(g,x){return m[g]-m[x]})}function hD(n){if(br(n)===Gv)return[];var t=bm(n);return[gw(n),t,gw(t)]}function uD(n){var t=n.state,e=n.options,i=n.name;if(!t.modifiersData[i]._skip){for(var s=e.mainAxis,r=s===void 0?!0:s,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,x=e.allowedAutoPlacements,y=t.options.placement,_=br(y),b=_===y,S=l||(b||!g?[bm(y)]:hD(y)),w=[y].concat(S).reduce(function(q,rt){return q.concat(br(rt)===Gv?cD(t,{placement:rt,boundary:h,rootBoundary:u,padding:c,flipVariations:g,allowedAutoPlacements:x}):rt)},[]),R=t.rects.reference,T=t.rects.popper,C=new Map,L=!0,P=w[0],E=0;E=0,Q=W?"width":"height",Y=Wu(t,{placement:D,boundary:h,rootBoundary:u,altBoundary:p,padding:c}),ot=W?G?As:Hi:G?Es:Bi;R[Q]>T[Q]&&(ot=bm(ot));var H=bm(ot),Z=[];if(r&&Z.push(Y[z]<=0),o&&Z.push(Y[ot]<=0,Y[H]<=0),Z.every(function(q){return q})){P=D,L=!1;break}C.set(D,Z)}if(L)for(var it=g?3:1,$=function(rt){var St=w.find(function(dt){var It=C.get(dt);if(It)return It.slice(0,rt).every(function(Ht){return Ht})});if(St)return P=St,"break"},lt=it;lt>0;lt--){var _t=$(lt);if(_t==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const fD={name:"flip",enabled:!0,phase:"main",fn:uD,requiresIfExists:["offset"],data:{_skip:!1}};function _w(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 xw(n){return[Bi,As,Es,Hi].some(function(t){return n[t]>=0})}function dD(n){var t=n.state,e=n.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,a=Wu(t,{elementContext:"reference"}),o=Wu(t,{altBoundary:!0}),l=_w(a,i),c=_w(o,s,r),h=xw(l),u=xw(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 pD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dD};function mD(n,t,e){var i=br(n),s=[Hi,Bi].indexOf(i)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,a=r[0],o=r[1];return a=a||0,o=(o||0)*s,[Hi,As].indexOf(i)>=0?{x:o,y:a}:{x:a,y:o}}function gD(n){var t=n.state,e=n.options,i=n.name,s=e.offset,r=s===void 0?[0,0]:s,a=GT.reduce(function(h,u){return h[u]=mD(u,t.rects,r),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 yD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:gD};function _D(n){var t=n.state,e=n.name;t.modifiersData[e]=$T({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const xD={name:"popperOffsets",enabled:!0,phase:"read",fn:_D,data:{}};function vD(n){return n==="x"?"y":"x"}function MD(n){var t=n.state,e=n.options,i=n.name,s=e.mainAxis,r=s===void 0?!0:s,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,x=g===void 0?0:g,y=Wu(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:h}),_=br(t.placement),b=qc(t.placement),S=!b,w=jv(_),R=vD(w),T=t.modifiersData.popperOffsets,C=t.rects.reference,L=t.rects.popper,P=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,E=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,z={x:0,y:0};if(T){if(r){var G,W=w==="y"?Bi:Hi,Q=w==="y"?Es:As,Y=w==="y"?"height":"width",ot=T[w],H=ot+y[W],Z=ot-y[Q],it=m?-L[Y]/2:0,$=b===Wc?C[Y]:L[Y],lt=b===Wc?-L[Y]:-C[Y],_t=t.elements.arrow,q=m&&_t?Wv(_t):{width:0,height:0},rt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jT(),St=rt[W],dt=rt[Q],It=Mu(0,C[Y],q[Y]),Ht=S?C[Y]/2-it-It-St-E.mainAxis:$-It-St-E.mainAxis,Bt=S?-C[Y]/2+it+It+dt+E.mainAxis:lt+It+dt+E.mainAxis,Qt=t.elements.arrow&&wf(t.elements.arrow),ht=Qt?w==="y"?Qt.clientTop||0:Qt.clientLeft||0:0,gt=(G=D==null?void 0:D[w])!=null?G:0,k=ot+Ht-gt-ht,Et=ot+Bt-gt,wt=Mu(m?zm(H,k):H,ot,m?Jo(Z,Et):Z);T[w]=wt,z[w]=wt-ot}if(o){var Lt,Ct=w==="x"?Bi:Hi,ne=w==="x"?Es:As,Ft=T[R],U=R==="y"?"height":"width",N=Ft+y[Ct],st=Ft-y[ne],yt=[Bi,Hi].indexOf(_)!==-1,Rt=(Lt=D==null?void 0:D[R])!=null?Lt:0,Mt=yt?N:Ft-C[U]-L[U]-Rt+E.altAxis,te=yt?Ft+C[U]+L[U]-Rt-E.altAxis:st,zt=m&&yt?jL(Mt,Ft,te):Mu(m?Mt:N,Ft,m?te:st);T[R]=zt,z[R]=zt-Ft}t.modifiersData[i]=z}}const bD={name:"preventOverflow",enabled:!0,phase:"main",fn:MD,requiresIfExists:["offset"]};function wD(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function SD(n){return n===rs(n)||!Ss(n)?Xv(n):wD(n)}function ED(n){var t=n.getBoundingClientRect(),e=jc(t.width)/n.offsetWidth||1,i=jc(t.height)/n.offsetHeight||1;return e!==1||i!==1}function AD(n,t,e){e===void 0&&(e=!1);var i=Ss(t),s=Ss(t)&&ED(t),r=to(t),a=Xc(n,s,e),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!e)&&((Rr(t)!=="body"||Yv(r))&&(o=SD(t)),Ss(t)?(l=Xc(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=qv(r))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function TD(n){var t=new Map,e=new Set,i=[];n.forEach(function(r){t.set(r.name,r)});function s(r){e.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(o){if(!e.has(o)){var l=t.get(o);l&&s(l)}}),i.push(r)}return n.forEach(function(r){e.has(r.name)||s(r)}),i}function CD(n){var t=TD(n);return zL.reduce(function(e,i){return e.concat(t.filter(function(s){return s.phase===i}))},[])}function RD(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function PD(n){var t=n.reduce(function(e,i){var s=e[i.name];return e[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,e},{});return Object.keys(t).map(function(e){return t[e]})}var vw={placement:"bottom",modifiers:[],strategy:"absolute"};function Mw(){for(var n=arguments.length,t=new Array(n),e=0;e({var:n,varRef:t?`var(${n}, ${t})`:`var(${n})`}),qn={arrowShadowColor:zl("--popper-arrow-shadow-color"),arrowSize:zl("--popper-arrow-size","8px"),arrowSizeHalf:zl("--popper-arrow-size-half"),arrowBg:zl("--popper-arrow-bg"),transformOrigin:zl("--popper-transform-origin"),arrowOffset:zl("--popper-arrow-offset")};function ND(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)"}const OD={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"},FD=n=>OD[n],bw={scroll:!0,resize:!0};function UD(n){let t;return typeof n=="object"?t={enabled:!0,options:{...bw,...n}}:t={enabled:n,options:bw},t}const kD={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`}},zD={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:n})=>{ww(n)},effect:({state:n})=>()=>{ww(n)}},ww=n=>{n.elements.popper.style.setProperty(qn.transformOrigin.var,FD(n.placement))},BD={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:n})=>{HD(n)}},HD=n=>{var e;if(!n.placement)return;const t=GD(n.placement);if((e=n.elements)!=null&&e.arrow&&t){Object.assign(n.elements.arrow.style,{[t.property]:t.value,width:qn.arrowSize.varRef,height:qn.arrowSize.varRef,zIndex:-1});const i={[qn.arrowSizeHalf.var]:`calc(${qn.arrowSize.varRef} / 2 - 1px)`,[qn.arrowOffset.var]:`calc(${qn.arrowSizeHalf.varRef} * -1)`};for(const s in i)n.elements.arrow.style.setProperty(s,i[s])}},GD=n=>{if(n.startsWith("top"))return{property:"bottom",value:qn.arrowOffset.varRef};if(n.startsWith("bottom"))return{property:"top",value:qn.arrowOffset.varRef};if(n.startsWith("left"))return{property:"right",value:qn.arrowOffset.varRef};if(n.startsWith("right"))return{property:"left",value:qn.arrowOffset.varRef}},VD={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:n})=>{Sw(n)},effect:({state:n})=>()=>{Sw(n)}},Sw=n=>{if(!n.elements.arrow)return;const t=n.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const e=ND(n.placement);e&&t.style.setProperty("--popper-arrow-default-shadow",e),Object.assign(t.style,{transform:"rotate(45deg)",background:qn.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},WD={"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"}},jD={"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 XD(n,t="ltr"){var i;const e=((i=WD[n])==null?void 0:i[t])||n;return t==="ltr"?e:jD[n]??e}function qD(n={}){const{enabled:t=!0,modifiers:e,placement:i="bottom",strategy:s="absolute",arrowPadding:r=8,eventListeners:a=!0,offset:o,gutter:l=8,flip:c=!0,boundary:h="clippingParents",preventOverflow:u=!0,matchWidth:p,direction:m="ltr"}=n,g=J.useRef(null),x=J.useRef(null),y=J.useRef(null),_=XD(i,m),b=J.useRef(()=>{}),S=J.useCallback(()=>{var E;!t||!g.current||!x.current||((E=b.current)==null||E.call(b),y.current=DD(g.current,x.current,{placement:_,modifiers:[VD,BD,zD,{...kD,enabled:!!p},{name:"eventListeners",...UD(a)},{name:"arrow",options:{padding:r}},{name:"offset",options:{offset:o??[0,l]}},{name:"flip",enabled:!!c,options:{padding:8}},{name:"preventOverflow",enabled:!!u,options:{boundary:h}},...e??[]],strategy:s}),y.current.forceUpdate(),b.current=y.current.destroy)},[_,t,e,p,a,r,o,l,c,u,h,s]);J.useEffect(()=>()=>{var E;!g.current&&!x.current&&((E=y.current)==null||E.destroy(),y.current=null)},[]);const w=J.useCallback(E=>{g.current=E,S()},[S]),R=J.useCallback((E={},D=null)=>({...E,ref:Ha(w,D)}),[w]),T=J.useCallback(E=>{x.current=E,S()},[S]),C=J.useCallback((E={},D=null)=>({...E,ref:Ha(T,D),style:{...E.style,position:s,minWidth:p?void 0:"max-content",inset:"0 auto auto 0"}}),[s,T,p]),L=J.useCallback((E={},D=null)=>{const{size:z,shadowColor:G,bg:W,style:Q,...Y}=E;return{...Y,ref:D,"data-popper-arrow":"",style:YD(E)}},[]),P=J.useCallback((E={},D=null)=>({...E,ref:D,"data-popper-arrow-inner":""}),[]);return{update(){var E;(E=y.current)==null||E.update()},forceUpdate(){var E;(E=y.current)==null||E.forceUpdate()},transformOrigin:qn.transformOrigin.varRef,referenceRef:w,popperRef:T,getPopperProps:C,getArrowProps:L,getArrowInnerProps:P,getReferenceProps:R}}function YD(n){const{size:t,shadowColor:e,bg:i,style:s}=n,r={...s,position:"absolute"};return t&&(r["--popper-arrow-size"]=t),e&&(r["--popper-arrow-shadow-color"]=e),i&&(r["--popper-arrow-bg"]=i),r}const[$D,ZD]=U0(),KD={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function JD(n,t){var e;if(n)return((e=KD[n])==null?void 0:e[t])??n}function QD(n){var c;const{isOpen:t,onClose:e,placement:i="right",children:s,...r}=n,a=Nv(),o=(c=a.components)==null?void 0:c.Drawer,l=JD(i,a.direction);return V.jsx($D,{value:{placement:l},children:V.jsx(Fv,{isOpen:t,onClose:e,styleConfig:o,...r,children:s})})}const Ew={exit:{duration:.15,ease:uu.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},tN={exit:({direction:n,transition:t,transitionEnd:e,delay:i})=>{const{exit:s}=Fx({direction:n});return{...s,transition:(t==null?void 0:t.exit)??Um.exit(Ew.exit,i),transitionEnd:e==null?void 0:e.exit}},enter:({direction:n,transitionEnd:t,transition:e,delay:i})=>{const{enter:s}=Fx({direction:n});return{...s,transition:(e==null?void 0:e.enter)??Um.enter(Ew.enter,i),transitionEnd:t==null?void 0:t.enter}}},ZT=J.forwardRef(function(t,e){const{direction:i="right",style:s,unmountOnExit:r,in:a,className:o,transition:l,transitionEnd:c,delay:h,motionProps:u,animatePresenceProps:p,...m}=t,g=Fx({direction:i}),x=Object.assign({position:"fixed"},g.position,s),y=r?a&&r:!0,_=a||r?"enter":"exit",b={transitionEnd:c,transition:l,direction:i,delay:h};return V.jsx(Lv,{...p,custom:b,children:y&&V.jsx(Dv.div,{...m,ref:e,initial:"exit",className:os("chakra-slide",o),animate:_,exit:"exit",custom:b,variants:tN,style:x,...u})})});ZT.displayName="Slide";const eN=cn(ZT),KT=Gi((n,t)=>{const{className:e,children:i,motionProps:s,containerProps:r,...a}=n,{getDialogProps:o,getDialogContainerProps:l,isOpen:c}=_I(),h=o(a,t),u=l(r),p=os("chakra-modal__content",e),m=xI(),g={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},x={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{placement:y}=ZD();return V.jsx(vI,{children:V.jsx(cn.div,{...u,className:"chakra-modal__content-container",__css:x,children:V.jsx(eN,{motionProps:s,direction:y,in:c,className:p,...h,__css:g,children:i})})})});KT.displayName="DrawerContent";function nN(n,t,e){return(n-t)*100/(e-t)}k0({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});k0({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});const iN=k0({"0%":{left:"-40%"},"100%":{left:"100%"}}),sN=k0({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function rN(n){const{value:t=0,min:e,max:i,valueText:s,getValueText:r,isIndeterminate:a,role:o="progressbar"}=n,l=nN(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 r=="function"?r(t,l):s})(),role:o},percent:l,value:t}}const[aN,oN]=U0({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),lN=Gi((n,t)=>{const{min:e,max:i,value:s,isIndeterminate:r,role:a,...o}=n,l=rN({value:s,min:e,max:i,isIndeterminate:r,role:a}),h={height:"100%",...oN().filledTrack};return V.jsx(cn.div,{ref:t,style:{width:`${l.percent}%`,...o.style},...l.bind,...o,__css:h})}),JT=Gi((n,t)=>{var C;const{value:e,min:i=0,max:s=100,hasStripe:r,isAnimated:a,children:o,borderRadius:l,isIndeterminate:c,"aria-label":h,"aria-labelledby":u,"aria-valuetext":p,title:m,role:g,...x}=_f(n),y=Ov("Progress",n),_=l??((C=y.track)==null?void 0:C.borderRadius),b={animation:`${sN} 1s linear infinite`},R={...!c&&r&&a&&b,...c&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${iN} 1s ease infinite normal none running`}},T={overflow:"hidden",position:"relative",...y.track};return V.jsx(cn.div,{ref:t,borderRadius:_,__css:T,...x,children:V.jsxs(aN,{value:y,children:[V.jsx(lN,{"aria-label":h,"aria-labelledby":u,"aria-valuetext":p,min:i,max:s,value:e,isIndeterminate:c,css:R,borderRadius:_,title:m,role:g}),o]})})});JT.displayName="Progress";function $d(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}const wm={width:0,height:0},Zd=n=>n||wm;function cN(n){const{orientation:t,thumbPercents:e,thumbRects:i,isReversed:s}=n,r=x=>{const y=i[x]??wm;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...$d({orientation:t,vertical:{bottom:`calc(${e[x]}% - ${y.height/2}px)`},horizontal:{left:`calc(${e[x]}% - ${y.width/2}px)`}})}},a=t==="vertical"?i.reduce((x,y)=>Zd(x).height>Zd(y).height?x:y,wm):i.reduce((x,y)=>Zd(x).width>Zd(y).width?x:y,wm),o={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...$d({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",...$d({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},c=e.length===1,h=[0,s?100-e[0]:e[0]],u=c?h:e;let p=u[0];!c&&s&&(p=100-p);const m=Math.abs(u[u.length-1]-u[0]),g={...l,...$d({orientation:t,vertical:s?{height:`${m}%`,top:`${p}%`}:{height:`${m}%`,bottom:`${p}%`},horizontal:s?{width:`${m}%`,right:`${p}%`}:{width:`${m}%`,left:`${p}%`}})};return{trackStyle:l,innerTrackStyle:g,rootStyle:o,getThumbStyle:r}}function hN(n){const{isReversed:t,direction:e,orientation:i}=n;return e==="ltr"||i==="vertical"?t:!t}function uN(n){const{min:t=0,max:e=100,onChange:i,value:s,defaultValue:r,isReversed:a,direction:o="ltr",orientation:l="horizontal",id:c,isDisabled:h,isReadOnly:u,onChangeStart:p,onChangeEnd:m,step:g=1,getAriaValueText:x,"aria-valuetext":y,"aria-label":_,"aria-labelledby":b,name:S,focusThumbOnChange:w=!0,...R}=n,T=Ko(p),C=Ko(m),L=Ko(x),P=hN({isReversed:a,direction:o,orientation:l}),[E,D]=aI({value:s,defaultValue:r??dN(t,e),onChange:i}),[z,G]=J.useState(!1),[W,Q]=J.useState(!1),Y=!(h||u),ot=(e-t)/10,H=g||(e-t)/100,Z=Wy(E,t,e),it=e-Z+t,lt=sw(P?it:Z,t,e),_t=l==="vertical",q=OT({min:t,max:e,step:g,isDisabled:h,value:Z,isInteractive:Y,isReversed:P,isVertical:_t,eventSource:null,focusThumbOnChange:w,orientation:l}),rt=J.useRef(null),St=J.useRef(null),dt=J.useRef(null),It=J.useId(),Ht=c??It,[Bt,Qt]=[`slider-thumb-${Ht}`,`slider-track-${Ht}`],ht=J.useCallback(at=>{var Ot;if(!rt.current)return;const Tt=q.current;Tt.eventSource="pointer";const ae=rt.current.getBoundingClientRect(),{clientX:ue,clientY:Vt}=((Ot=at.touches)==null?void 0:Ot[0])??at,X=_t?ae.bottom-Vt:ue-ae.left,bt=_t?ae.height:ae.width;let Gt=X/bt;P&&(Gt=1-Gt);let j=GI(Gt,Tt.min,Tt.max);return Tt.step&&(j=parseFloat(rw(j,Tt.min,Tt.step))),j=Wy(j,Tt.min,Tt.max),j},[_t,P,q]),gt=J.useCallback(at=>{const Tt=q.current;Tt.isInteractive&&(at=parseFloat(rw(at,Tt.min,H)),at=Wy(at,Tt.min,Tt.max),D(at))},[H,D,q]),k=J.useMemo(()=>({stepUp(at=H){const Tt=P?Z-at:Z+at;gt(Tt)},stepDown(at=H){const Tt=P?Z+at:Z-at;gt(Tt)},reset(){gt(r||0)},stepTo(at){gt(at)}}),[gt,P,Z,H,r]),Et=J.useCallback(at=>{const Tt=q.current,ue={ArrowRight:()=>k.stepUp(),ArrowUp:()=>k.stepUp(),ArrowLeft:()=>k.stepDown(),ArrowDown:()=>k.stepDown(),PageUp:()=>k.stepUp(ot),PageDown:()=>k.stepDown(ot),Home:()=>gt(Tt.min),End:()=>gt(Tt.max)}[at.key];ue&&(at.preventDefault(),at.stopPropagation(),ue(at),Tt.eventSource="keyboard")},[k,gt,ot,q]),wt=(L==null?void 0:L(Z))??y,Lt=KI(St),{getThumbStyle:Ct,rootStyle:ne,trackStyle:Ft,innerTrackStyle:U}=J.useMemo(()=>{const at=q.current,Tt=Lt??{width:0,height:0};return cN({isReversed:P,orientation:at.orientation,thumbRects:[Tt],thumbPercents:[lt]})},[P,Lt,lt,q]),N=J.useCallback(()=>{q.current.focusThumbOnChange&&setTimeout(()=>{var Tt;return(Tt=St.current)==null?void 0:Tt.focus()})},[q]);ET(()=>{const at=q.current;N(),at.eventSource==="keyboard"&&(C==null||C(at.value))},[Z,C]);function st(at){const Tt=ht(at);Tt!=null&&Tt!==q.current.value&&D(Tt)}fL(dt,{onPanSessionStart(at){const Tt=q.current;Tt.isInteractive&&(G(!0),N(),st(at),T==null||T(Tt.value))},onPanSessionEnd(){const at=q.current;at.isInteractive&&(G(!1),C==null||C(at.value))},onPan(at){q.current.isInteractive&&st(at)}});const yt=J.useCallback((at={},Tt=null)=>({...at,...R,ref:Ha(Tt,dt),tabIndex:-1,"aria-disabled":Hy(h),"data-focused":Ye(W),style:{...at.style,...ne}}),[R,h,W,ne]),Rt=J.useCallback((at={},Tt=null)=>({...at,ref:Ha(Tt,rt),id:Qt,"data-disabled":Ye(h),style:{...at.style,...Ft}}),[h,Qt,Ft]),Mt=J.useCallback((at={},Tt=null)=>({...at,ref:Tt,style:{...at.style,...U}}),[U]),te=J.useCallback((at={},Tt=null)=>({...at,ref:Ha(Tt,St),role:"slider",tabIndex:Y?0:void 0,id:Bt,"data-active":Ye(z),"aria-valuetext":wt,"aria-valuemin":t,"aria-valuemax":e,"aria-valuenow":Z,"aria-orientation":l,"aria-disabled":Hy(h),"aria-readonly":Hy(u),"aria-label":_,"aria-labelledby":_?void 0:b,style:{...at.style,...Ct(0)},onKeyDown:Ln(at.onKeyDown,Et),onFocus:Ln(at.onFocus,()=>Q(!0)),onBlur:Ln(at.onBlur,()=>Q(!1))}),[Y,Bt,z,wt,t,e,Z,l,h,u,_,b,Ct,Et]),zt=J.useCallback((at,Tt=null)=>{const ae=!(at.valuee),ue=Z>=at.value,Vt=sw(at.value,t,e),X={position:"absolute",pointerEvents:"none",...fN({orientation:l,vertical:{bottom:P?`${100-Vt}%`:`${Vt}%`},horizontal:{left:P?`${100-Vt}%`:`${Vt}%`}})};return{...at,ref:Tt,role:"presentation","aria-hidden":!0,"data-disabled":Ye(h),"data-invalid":Ye(!ae),"data-highlighted":Ye(ue),style:{...at.style,...X}}},[h,P,e,t,l,Z]),Zt=J.useCallback((at={},Tt=null)=>({...at,ref:Tt,type:"hidden",value:Z,name:S}),[S,Z]);return{state:{value:Z,isFocused:W,isDragging:z},actions:k,getRootProps:yt,getTrackProps:Rt,getInnerTrackProps:Mt,getThumbProps:te,getMarkerProps:zt,getInputProps:Zt}}function fN(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}function dN(n,t){return t"}),[mN,V0]=U0({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),QT=Gi((n,t)=>{const e={...n,orientation:(n==null?void 0:n.orientation)??"horizontal"},i=Ov("Slider",e),s=_f(e),{direction:r}=Nv();s.direction=r;const{getInputProps:a,getRootProps:o,...l}=uN(s),c=o(),h=a({},t);return V.jsx(pN,{value:l,children:V.jsx(mN,{value:i,children:V.jsxs(cn.div,{...c,className:os("chakra-slider",e.className),__css:i.container,children:[e.children,V.jsx("input",{...h})]})})})});QT.displayName="Slider";const t2=Gi((n,t)=>{const{getThumbProps:e}=G0(),i=V0(),s=e(n,t);return V.jsx(cn.div,{...s,className:os("chakra-slider__thumb",n.className),__css:i.thumb})});t2.displayName="SliderThumb";const e2=Gi((n,t)=>{const{getTrackProps:e}=G0(),i=V0(),s=e(n,t);return V.jsx(cn.div,{...s,className:os("chakra-slider__track",n.className),__css:i.track})});e2.displayName="SliderTrack";const n2=Gi((n,t)=>{const{getInnerTrackProps:e}=G0(),i=V0(),s=e(n,t);return V.jsx(cn.div,{...s,className:os("chakra-slider__filled-track",n.className),__css:i.filledTrack})});n2.displayName="SliderFilledTrack";const gN=Gi((n,t)=>{const{getMarkerProps:e}=G0(),i=V0(),s=e(n,t);return V.jsx(cn.div,{...s,className:os("chakra-slider__marker",n.className),__css:i.mark})});gN.displayName="SliderMark";const i2=Gi(function(t,e){const i=Ov("Switch",t),{spacing:s="0.5rem",children:r,...a}=_f(t),{getIndicatorProps:o,getInputProps:l,getCheckboxProps:c,getRootProps:h,getLabelProps:u}=AL(a),p=J.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...i.container}),[i.container]),m=J.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...i.track}),[i.track]),g=J.useMemo(()=>({userSelect:"none",marginStart:s,...i.label}),[s,i.label]);return V.jsxs(cn.label,{...h(),className:os("chakra-switch",t.className),__css:p,children:[V.jsx("input",{className:"chakra-switch__input",...l({},e)}),V.jsx(cn.span,{...c(),className:"chakra-switch__track",__css:m,children:V.jsx(cn.span,{__css:i.thumb,className:"chakra-switch__thumb",...o()})}),r&&V.jsx(cn.span,{className:"chakra-switch__label",...u(),__css:g,children:r})]})});i2.displayName="Switch";const yN={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]}}}},Vx=n=>{var t;return((t=n.current)==null?void 0:t.ownerDocument)||document},Sm=n=>{var t,e;return((e=(t=n.current)==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)||window};function _N(n={}){const{openDelay:t=0,closeDelay:e=0,closeOnClick:i=!0,closeOnMouseDown:s,closeOnScroll:r,closeOnPointerDown:a=s,closeOnEsc:o=!0,onOpen:l,onClose:c,placement:h,id:u,isOpen:p,defaultIsOpen:m,arrowSize:g=10,arrowShadowColor:x,arrowPadding:y,modifiers:_,isDisabled:b,gutter:S,offset:w,direction:R,...T}=n,{isOpen:C,onOpen:L,onClose:P}=sl({isOpen:p,defaultIsOpen:m,onOpen:l,onClose:c}),{referenceRef:E,getPopperProps:D,getArrowInnerProps:z,getArrowProps:G}=qD({enabled:C,placement:h,arrowPadding:y,modifiers:_,gutter:S,offset:w,direction:R}),W=J.useId(),Y=`tooltip-${u??W}`,ot=J.useRef(null),H=J.useRef(),Z=J.useCallback(()=>{H.current&&(clearTimeout(H.current),H.current=void 0)},[]),it=J.useRef(),$=J.useCallback(()=>{it.current&&(clearTimeout(it.current),it.current=void 0)},[]),lt=J.useCallback(()=>{$(),P()},[P,$]),_t=xN(ot,lt),q=J.useCallback(()=>{if(!b&&!H.current){C&&_t();const ht=Sm(ot);H.current=ht.setTimeout(L,t)}},[_t,b,C,L,t]),rt=J.useCallback(()=>{Z();const ht=Sm(ot);it.current=ht.setTimeout(lt,e)},[e,lt,Z]),St=J.useCallback(()=>{C&&i&&rt()},[i,rt,C]),dt=J.useCallback(()=>{C&&a&&rt()},[a,rt,C]),It=J.useCallback(ht=>{C&&ht.key==="Escape"&&rt()},[C,rt]);jy(()=>Vx(ot),"keydown",o?It:void 0),jy(()=>{if(!r)return null;const ht=ot.current;if(!ht)return null;const gt=NT(ht);return gt.localName==="body"?Sm(ot):gt},"scroll",()=>{C&&r&<()},{passive:!0,capture:!0}),J.useEffect(()=>{b&&(Z(),C&&P())},[b,C,P,Z]),J.useEffect(()=>()=>{Z(),$()},[Z,$]),jy(()=>ot.current,"pointerleave",rt);const Ht=J.useCallback((ht={},gt=null)=>({...ht,ref:Ha(ot,gt,E),onPointerEnter:Ln(ht.onPointerEnter,Et=>{Et.pointerType!=="touch"&&q()}),onClick:Ln(ht.onClick,St),onPointerDown:Ln(ht.onPointerDown,dt),onFocus:Ln(ht.onFocus,q),onBlur:Ln(ht.onBlur,rt),"aria-describedby":C?Y:void 0}),[q,rt,dt,C,Y,St,E]),Bt=J.useCallback((ht={},gt=null)=>D({...ht,style:{...ht.style,[qn.arrowSize.var]:g?`${g}px`:void 0,[qn.arrowShadowColor.var]:x}},gt),[D,g,x]),Qt=J.useCallback((ht={},gt=null)=>{const k={...ht.style,position:"relative",transformOrigin:qn.transformOrigin.varRef};return{ref:gt,...T,...ht,id:Y,role:"tooltip",style:k}},[T,Y]);return{isOpen:C,show:q,hide:rt,getTriggerProps:Ht,getTooltipProps:Qt,getTooltipPositionerProps:Bt,getArrowProps:G,getArrowInnerProps:z}}const Yy="chakra-ui:close-tooltip";function xN(n,t){return J.useEffect(()=>{const e=Vx(n);return e.addEventListener(Yy,t),()=>e.removeEventListener(Yy,t)},[t,n]),()=>{const e=Vx(n),i=Sm(n);e.dispatchEvent(new i.CustomEvent(Yy))}}const vN=cn(Dv.div),Sf=Gi((n,t)=>{const e=AT("Tooltip",n),i=_f(n),s=Nv(),{children:r,label:a,shouldWrapChildren:o,"aria-label":l,hasArrow:c,bg:h,portalProps:u,background:p,backgroundColor:m,bgColor:g,motionProps:x,animatePresenceProps:y,..._}=i,b=p??m??h??g;if(b){e.bg=b;const E=dL(s,"colors",b);e[qn.arrowBg.var]=E}const S=_N({..._,direction:s.direction}),w=typeof r=="string"||o;let R;if(w)R=V.jsx(cn.span,{display:"inline-block",tabIndex:0,...S.getTriggerProps(),children:r});else{const E=J.Children.only(r);R=J.cloneElement(E,S.getTriggerProps(E.props,E.ref))}const T=!!l,C=S.getTooltipProps({},t),L=T?ST(C,["role","id"]):C,P=oI(C,["role","id"]);return a?V.jsxs(V.Fragment,{children:[R,V.jsx(Lv,{...y,children:S.isOpen&&V.jsx(lI,{...u,children:V.jsx(cn.div,{...S.getTooltipPositionerProps(),__css:{zIndex:e.zIndex,pointerEvents:"none"},children:V.jsxs(vN,{variants:yN,initial:"exit",animate:"enter",exit:"exit",...x,...L,__css:e,children:[a,T&&V.jsx(cn.span,{srOnly:!0,...P,children:l}),c&&V.jsx(cn.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:V.jsx(cn.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:e.bg}})})]})})})})]}):V.jsx(V.Fragment,{children:r})});Sf.displayName="Tooltip";const $v=Gi(function(t,e){const{spacing:i="0.5rem",spacingX:s,spacingY:r,children:a,justify:o,direction:l,align:c,className:h,shouldWrapChildren:u,...p}=t,m=J.useMemo(()=>u?J.Children.map(a,(g,x)=>V.jsx(s2,{children:g},x)):a,[a,u]);return V.jsx(cn.div,{ref:e,className:os("chakra-wrap",h),...p,children:V.jsx(cn.ul,{className:"chakra-wrap__list",__css:{display:"flex",flexWrap:"wrap",justifyContent:o,alignItems:c,flexDirection:l,listStyleType:"none",gap:i,columnGap:s,rowGap:r,padding:"0"},children:m})})});$v.displayName="Wrap";const s2=Gi(function(t,e){const{className:i,...s}=t;return V.jsx(cn.li,{ref:e,__css:{display:"flex",alignItems:"flex-start"},className:os("chakra-wrap__listitem",i),...s})});s2.displayName="WrapItem";/** +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-DVinku8x.js","assets/index-DZP_WaxS.js","assets/index-CzQ50VWX.css","assets/heading-D46BZoGw.js","assets/Footer-C3QM0Uoc.js","assets/location-BMuwxVaI.js","assets/stack-D-KFs-Nt.js","assets/packbits-DQnG8s9w.js","assets/lerc-BoocAjbe.js","assets/webimage-BcnuJlio.js"])))=>i.map(i=>d[i]); +var iI=Object.defineProperty;var sI=(n,t,e)=>t in n?iI(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var cr=(n,t,e)=>sI(n,typeof t!="symbol"?t+"":t,e);import{i as rI,k as Ko,d as J,j as V,A as Lv,m as Dv,l as os,o as ST,n as By,p as ET,q as Ye,s as Ln,v as Ha,f as Gi,w as AT,x as _f,c as cn,y as U0,z as Nv,C as k0,D as Ov,E as aI,F as Hy,G as oI,P as lI,g as Qa,H as xf,I as cI,J as hI,R as z0,_ as xl,B as ca,K as TT,L as CT,N as uI,O as fI,M as dI}from"./index-DZP_WaxS.js";import{C as pI,a as mI,H as gI,b as yI}from"./heading-D46BZoGw.js";import{w as Um,g as uu,M as Fv,h as Fx,i as _I,j as xI,k as vI,u as sl,B as yr,l as MI,b as Uv,c as RT,d as kv,e as zv,f as Bv,T as Bo,U as PT,a as Go,F as bI}from"./Footer-C3QM0Uoc.js";import{u as wI,a as IT,b as SI,c as EI,p as AI,d as km,F as Gy,I as Vy,M as TI,e as CI,x as RI}from"./location-BMuwxVaI.js";import{S as PI}from"./stack-D-KFs-Nt.js";function II(n,t,e,i){return n.addEventListener(t,e,i),()=>{n.removeEventListener(t,e,i)}}function LI(n){return n.view??window}function DI(n){const t=LI(n);return typeof t.PointerEvent<"u"&&n instanceof t.PointerEvent?n.pointerType==="mouse":n instanceof t.MouseEvent}function LT(n){return!!n.touches}function NI(n){return LT(n)&&n.touches.length>1}function OI(n,t="page"){const e=n.touches[0]||n.changedTouches[0];return{x:e[`${t}X`],y:e[`${t}Y`]}}function FI(n,t="page"){return{x:n[`${t}X`],y:n[`${t}Y`]}}function DT(n,t="page"){return LT(n)?OI(n,t):FI(n,t)}function UI(n){return t=>{const e=DI(t);(!e||e&&t.button===0)&&n(t)}}function kI(n,t=!1){function e(s){n(s,{point:DT(s)})}return t?UI(e):e}function Mm(n,t,e,i){return II(n,t,kI(e,t==="pointerdown"),i)}function zI(n){const t=parseFloat(n);return typeof t!="number"||Number.isNaN(t)?0:t}function BI(n,t){let e=zI(n);const i=10**(t??10);return e=Math.round(e*i)/i,t?e.toFixed(t):e.toString()}function HI(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 sw(n,t,e){return(n-t)*100/(e-t)}function GI(n,t,e){return(e-t)*n+t}function rw(n,t,e){const i=Math.round((n-t)/e)*e+t,s=HI(e);return BI(i,s)}function Wy(n,t,e){return n==null?n:(e{const{condition:t,message:e}=n};function jy(n,t,e,i){const s=Ko(e);return J.useEffect(()=>{const r=typeof n=="function"?n():n??document;if(!(!e||!r))return r.addEventListener(t,s,i),()=>{r.removeEventListener(t,s,i)}},[t,n,i,s,e]),()=>{const r=typeof n=="function"?n():n??document;r==null||r.removeEventListener(t,s,i)}}function OT(n){const t=J.useRef(null);return t.current=n,t}function XI(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(s=>{if(!Array.isArray(s)||!s.length)return;const[r]=s;let a,o;if("borderBoxSize"in r){const l=r.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)}const qI=globalThis!=null&&globalThis.document?J.useLayoutEffect:J.useEffect;function YI(n,t){var s;if(!n||!n.parentElement)return;const e=((s=n.ownerDocument)==null?void 0:s.defaultView)??window,i=new e.MutationObserver(()=>{t()});return i.observe(n.parentElement,{childList:!0}),()=>{i.disconnect()}}function $I({getNodes:n,observeMutation:t=!0}){const[e,i]=J.useState([]),[s,r]=J.useState(0);return qI(()=>{const a=n(),o=a.map((l,c)=>XI(l,h=>{i(u=>[...u.slice(0,c),h,...u.slice(c+1)])}));if(t){const l=a[0];o.push(YI(l,()=>{r(c=>c+1)}))}return()=>{o.forEach(l=>{l==null||l()})}},[s]),e}function ZI(n){return typeof n=="object"&&n!==null&&"current"in n}function KI(n){const[t]=$I({observeMutation:!1,getNodes(){return[ZI(n)?n.current:n]}});return t}const FT=1/60*1e3,JI=typeof performance<"u"?()=>performance.now():()=>Date.now(),UT=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(JI()),FT);function QI(n){let t=[],e=[],i=0,s=!1,r=!1;const a=new WeakSet,o={schedule:(l,c=!1,h=!1)=>{const u=h&&s,p=u?t:e;return c&&a.add(l),p.indexOf(l)===-1&&(p.push(l),u&&s&&(i=t.length)),l},cancel:l=>{const c=e.indexOf(l);c!==-1&&e.splice(c,1),a.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,e]=[e,t],e.length=0,i=t.length,i)for(let c=0;c(n[t]=QI(()=>Gu=!0),n),{}),eL=vf.reduce((n,t)=>{const e=B0[t];return n[t]=(i,s=!1,r=!1)=>(Gu||sL(),e.schedule(i,s,r)),n},{}),nL=vf.reduce((n,t)=>(n[t]=B0[t].cancel,n),{});vf.reduce((n,t)=>(n[t]=()=>B0[t].process(Oc),n),{});const iL=n=>B0[n].process(Oc),kT=n=>{Gu=!1,Oc.delta=Ux?FT:Math.max(Math.min(n-Oc.timestamp,tL),1),Oc.timestamp=n,kx=!0,vf.forEach(iL),kx=!1,Gu&&(Ux=!1,UT(kT))},sL=()=>{Gu=!0,Ux=!0,kx||UT(kT)},aw=()=>Oc;var rL=Object.defineProperty,aL=(n,t,e)=>t in n?rL(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ls=(n,t,e)=>(aL(n,typeof t!="symbol"?t+"":t,e),e);class oL{constructor(t,e,i){if(Ls(this,"history",[]),Ls(this,"startEvent",null),Ls(this,"lastEvent",null),Ls(this,"lastEventInfo",null),Ls(this,"handlers",{}),Ls(this,"removeListeners",()=>{}),Ls(this,"threshold",3),Ls(this,"win"),Ls(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const o=Xy(this.lastEventInfo,this.history),l=this.startEvent!==null,c=uL(o.offset,{x:0,y:0})>=this.threshold;if(!l&&!c)return;const{timestamp:h}=aw();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)}),Ls(this,"onPointerMove",(o,l)=>{this.lastEvent=o,this.lastEventInfo=l,eL.update(this.updatePoint,!0)}),Ls(this,"onPointerUp",(o,l)=>{const c=Xy(l,this.history),{onEnd:h,onSessionEnd:u}=this.handlers;u==null||u(o,c),this.end(),!(!h||!this.startEvent)&&(h==null||h(o,c))}),this.win=t.view??window,NI(t))return;this.handlers=e,i&&(this.threshold=i),t.stopPropagation(),t.preventDefault();const s={point:DT(t)},{timestamp:r}=aw();this.history=[{...s.point,timestamp:r}];const{onSessionStart:a}=e;a==null||a(t,Xy(s,this.history)),this.removeListeners=hL(Mm(this.win,"pointermove",this.onPointerMove),Mm(this.win,"pointerup",this.onPointerUp),Mm(this.win,"pointercancel",this.onPointerUp))}updateHandlers(t){this.handlers=t}end(){var t;(t=this.removeListeners)==null||t.call(this),nL.update(this.updatePoint)}}function ow(n,t){return{x:n.x-t.x,y:n.y-t.y}}function Xy(n,t){return{point:n.point,delta:ow(n.point,t[t.length-1]),offset:ow(n.point,t[0]),velocity:cL(t,.1)}}const lL=n=>n*1e3;function cL(n,t){if(n.length<2)return{x:0,y:0};let e=n.length-1,i=null;const s=n[n.length-1];for(;e>=0&&(i=n[e],!(s.timestamp-i.timestamp>lL(t)));)e--;if(!i)return{x:0,y:0};const r=(s.timestamp-i.timestamp)/1e3;if(r===0)return{x:0,y:0};const a={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function hL(...n){return t=>n.reduce((e,i)=>i(e),t)}function qy(n,t){return Math.abs(n-t)}function lw(n){return"x"in n&&"y"in n}function uL(n,t){if(typeof n=="number"&&typeof t=="number")return qy(n,t);if(lw(n)&&lw(t)){const e=qy(n.x,t.x),i=qy(n.y,t.y);return Math.sqrt(e**2+i**2)}return 0}function fL(n,t){const{onPan:e,onPanStart:i,onPanEnd:s,onPanSessionStart:r,onPanSessionEnd:a,threshold:o}=t,l=!!(e||i||s||r||a),c=J.useRef(null),h=OT({onSessionStart:r,onSessionEnd:a,onStart:i,onMove:e,onEnd(u,p){c.current=null,s==null||s(u,p)}});J.useEffect(()=>{var u;(u=c.current)==null||u.updateHandlers(h.current)}),J.useEffect(()=>{const u=n.current;if(!u||!l)return;function p(m){c.current=new oL(m,h.current,o)}return Mm(u,"pointerdown",p)},[n,l,h,o]),J.useEffect(()=>()=>{var u;(u=c.current)==null||u.end(),c.current=null},[])}function dL(n,t,e){var i,s;return((s=(i=n.__cssMap)==null?void 0:i[`${t}.${e}`])==null?void 0:s.varRef)??e}const pL=n=>n!=null&&parseInt(n.toString(),10)>0,cw={exit:{height:{duration:.2,ease:uu.ease},opacity:{duration:.3,ease:uu.ease}},enter:{height:{duration:.3,ease:uu.ease},opacity:{duration:.4,ease:uu.ease}}},mL={exit:({animateOpacity:n,startingHeight:t,transition:e,transitionEnd:i,delay:s})=>({...n&&{opacity:pL(t)?1:0},height:t,transitionEnd:i==null?void 0:i.exit,transition:(e==null?void 0:e.exit)??Um.exit(cw.exit,s)}),enter:({animateOpacity:n,endingHeight:t,transition:e,transitionEnd:i,delay:s})=>({...n&&{opacity:1},height:t,transitionEnd:i==null?void 0:i.enter,transition:(e==null?void 0:e.enter)??Um.enter(cw.enter,s)})},zT=J.forwardRef((n,t)=>{const{in:e,unmountOnExit:i,animateOpacity:s=!0,startingHeight:r=0,endingHeight:a="auto",style:o,className:l,transition:c,transitionEnd:h,animatePresenceProps:u,...p}=n,[m,g]=J.useState(!1);J.useEffect(()=>{const S=setTimeout(()=>{g(!0)});return()=>clearTimeout(S)},[]),jI({condition:Number(r)>0&&!!i,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const x=parseFloat(r.toString())>0,y={startingHeight:r,endingHeight:a,animateOpacity:s,transition:m?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:x?"block":"none"}}},_=i?e:!0,b=e||i?"enter":"exit";return V.jsx(Lv,{...u,initial:!1,custom:y,children:_&&V.jsx(Dv.div,{ref:t,...p,className:os("chakra-collapse",l),style:{overflow:"hidden",display:"block",...o},custom:y,variants:mL,initial:i?"exit":!1,animate:b,exit:"exit"})})});zT.displayName="Collapse";var gL=()=>typeof document<"u",hw=!1,Mf=null,rl=!1,zx=!1,Bx=new Set;function Hv(n,t){Bx.forEach(e=>e(n,t))}var yL=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function _L(n){return!(n.metaKey||!yL&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function uw(n){rl=!0,_L(n)&&(Mf="keyboard",Hv("keyboard",n))}function kl(n){if(Mf="pointer",n.type==="mousedown"||n.type==="pointerdown"){rl=!0;const t=n.composedPath?n.composedPath()[0]:n.target;let e=!1;try{e=t.matches(":focus-visible")}catch{}if(e)return;Hv("pointer",n)}}function xL(n){return n.mozInputSource===0&&n.isTrusted?!0:n.detail===0&&!n.pointerType}function vL(n){xL(n)&&(rl=!0,Mf="virtual")}function ML(n){n.target===window||n.target===document||n.target instanceof Element&&n.target.hasAttribute("tabindex")||(!rl&&!zx&&(Mf="virtual",Hv("virtual",n)),rl=!1,zx=!1)}function bL(){rl=!1,zx=!0}function fw(){return Mf!=="pointer"}function wL(){if(!gL()||hw)return;const{focus:n}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...e){rl=!0,n.apply(this,e)},document.addEventListener("keydown",uw,!0),document.addEventListener("keyup",uw,!0),document.addEventListener("click",vL,!0),window.addEventListener("focus",ML,!0),window.addEventListener("blur",bL,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",kl,!0),document.addEventListener("pointermove",kl,!0),document.addEventListener("pointerup",kl,!0)):(document.addEventListener("mousedown",kl,!0),document.addEventListener("mousemove",kl,!0),document.addEventListener("mouseup",kl,!0)),hw=!0}function SL(n){wL(),n(fw());const t=()=>n(fw());return Bx.add(t),()=>{Bx.delete(t)}}const EL={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function AL(n={}){const t=wI(n),{isDisabled:e,isReadOnly:i,isRequired:s,isInvalid:r,id:a,onBlur:o,onFocus:l,"aria-describedby":c}=t,{defaultChecked:h,isChecked:u,isFocusable:p,onChange:m,isIndeterminate:g,name:x,value:y,tabIndex:_=void 0,"aria-label":b,"aria-labelledby":S,"aria-invalid":w,...R}=n,T=ST(R,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),C=Ko(m),L=Ko(o),P=Ko(l),[E,D]=J.useState(!1),[z,G]=J.useState(!1),[W,Q]=J.useState(!1),[Y,ot]=J.useState(!1);J.useEffect(()=>SL(D),[]);const H=J.useRef(null),[Z,it]=J.useState(!0),[$,lt]=J.useState(!!h),_t=u!==void 0,q=_t?u:$,rt=J.useCallback(Et=>{if(i||e){Et.preventDefault();return}_t||lt(q?Et.currentTarget.checked:g?!0:Et.currentTarget.checked),C==null||C(Et)},[i,e,q,_t,g,C]);By(()=>{H.current&&(H.current.indeterminate=!!g)},[g]),ET(()=>{e&&G(!1)},[e,G]),By(()=>{const Et=H.current;if(!(Et!=null&&Et.form))return;const wt=()=>{lt(!!h)};return Et.form.addEventListener("reset",wt),()=>{var Lt;return(Lt=Et.form)==null?void 0:Lt.removeEventListener("reset",wt)}},[]);const St=e&&!p,dt=J.useCallback(Et=>{Et.key===" "&&ot(!0)},[ot]),It=J.useCallback(Et=>{Et.key===" "&&ot(!1)},[ot]);By(()=>{if(!H.current)return;H.current.checked!==q&<(H.current.checked)},[H.current]);const Ht=J.useCallback((Et={},wt=null)=>{const Lt=Ct=>{z&&Ct.preventDefault(),ot(!0)};return{...Et,ref:wt,"data-active":Ye(Y),"data-hover":Ye(W),"data-checked":Ye(q),"data-focus":Ye(z),"data-focus-visible":Ye(z&&E),"data-indeterminate":Ye(g),"data-disabled":Ye(e),"data-invalid":Ye(r),"data-readonly":Ye(i),"aria-hidden":!0,onMouseDown:Ln(Et.onMouseDown,Lt),onMouseUp:Ln(Et.onMouseUp,()=>ot(!1)),onMouseEnter:Ln(Et.onMouseEnter,()=>Q(!0)),onMouseLeave:Ln(Et.onMouseLeave,()=>Q(!1))}},[Y,q,e,z,E,W,g,r,i]),Bt=J.useCallback((Et={},wt=null)=>({...Et,ref:wt,"data-active":Ye(Y),"data-hover":Ye(W),"data-checked":Ye(q),"data-focus":Ye(z),"data-focus-visible":Ye(z&&E),"data-indeterminate":Ye(g),"data-disabled":Ye(e),"data-invalid":Ye(r),"data-readonly":Ye(i)}),[Y,q,e,z,E,W,g,r,i]),Qt=J.useCallback((Et={},wt=null)=>({...T,...Et,ref:Ha(wt,Lt=>{Lt&&it(Lt.tagName==="LABEL")}),htmlFor:Et.htmlFor!==void 0?Et.htmlFor:Z?a:void 0,onClick:Ln(Et.onClick,()=>{var Lt;Z||((Lt=H.current)==null||Lt.click(),requestAnimationFrame(()=>{var Ct;(Ct=H.current)==null||Ct.focus({preventScroll:!0})}))}),"data-disabled":Ye(e),"data-checked":Ye(q),"data-invalid":Ye(r)}),[T,e,q,r,Z,a]),ht=J.useCallback((Et={},wt=null)=>({...Et,ref:Ha(H,wt),type:"checkbox",name:x,value:y,id:a,tabIndex:_,onChange:Ln(Et.onChange,rt),onBlur:Ln(Et.onBlur,L,()=>G(!1)),onFocus:Ln(Et.onFocus,P,()=>G(!0)),onKeyDown:Ln(Et.onKeyDown,dt),onKeyUp:Ln(Et.onKeyUp,It),required:s,checked:q,disabled:St,readOnly:i,"aria-label":b,"aria-labelledby":S,"aria-invalid":w?!!w:r,"aria-describedby":c,"aria-disabled":e,style:EL}),[x,y,a,rt,L,P,dt,It,s,q,St,i,b,S,w,r,c,e,_]),gt=J.useCallback((Et={},wt=null)=>({...Et,ref:wt,onMouseDown:Ln(Et.onMouseDown,TL),"data-disabled":Ye(e),"data-checked":Ye(q),"data-invalid":Ye(r)}),[q,e,r]);return{state:{isInvalid:r,isFocused:z,isChecked:q,isActive:Y,isHovered:W,isIndeterminate:g,isDisabled:e,isReadOnly:i,isRequired:s},getRootProps:Qt,getCheckboxProps:Ht,getIndicatorProps:Bt,getInputProps:ht,getLabelProps:gt,htmlProps:T}}function TL(n){n.preventDefault(),n.stopPropagation()}const vu=Gi(function(t,e){const i=AT("FormLabel",t),s=_f(t),{className:r,children:a,requiredIndicator:o=V.jsx(BT,{}),optionalIndicator:l=null,...c}=s,h=IT(),u=(h==null?void 0:h.getLabelProps(c,e))??{ref:e,...c};return V.jsxs(cn.label,{...u,className:os("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...i},children:[a,h!=null&&h.isRequired?o:l]})});vu.displayName="FormLabel";const BT=Gi(function(t,e){const i=IT(),s=SI();if(!(i!=null&&i.isRequired))return null;const r=os("chakra-form__required-indicator",t.className);return V.jsx(cn.span,{...i==null?void 0:i.getRequiredIndicatorProps(t,e),__css:s.requiredIndicator,className:r})});BT.displayName="RequiredIndicator";var Bi="top",Es="bottom",As="right",Hi="left",Gv="auto",bf=[Bi,Es,As,Hi],Wc="start",Vu="end",CL="clippingParents",HT="viewport",Gh="popper",RL="reference",dw=bf.reduce(function(n,t){return n.concat([t+"-"+Wc,t+"-"+Vu])},[]),GT=[].concat(bf,[Gv]).reduce(function(n,t){return n.concat([t,t+"-"+Wc,t+"-"+Vu])},[]),PL="beforeRead",IL="read",LL="afterRead",DL="beforeMain",NL="main",OL="afterMain",FL="beforeWrite",UL="write",kL="afterWrite",zL=[PL,IL,LL,DL,NL,OL,FL,UL,kL];function Rr(n){return n?(n.nodeName||"").toLowerCase():null}function rs(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function al(n){var t=rs(n).Element;return n instanceof t||n instanceof Element}function Ss(n){var t=rs(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function Vv(n){if(typeof ShadowRoot>"u")return!1;var t=rs(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function BL(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},s=t.attributes[e]||{},r=t.elements[e];!Ss(r)||!Rr(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(a){var o=s[a];o===!1?r.removeAttribute(a):r.setAttribute(a,o===!0?"":o)}))})}function HL(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 s=t.elements[i],r=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},{});!Ss(s)||!Rr(s)||(Object.assign(s.style,o),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const GL={name:"applyStyles",enabled:!0,phase:"write",fn:BL,effect:HL,requires:["computeStyles"]};function br(n){return n.split("-")[0]}var Jo=Math.max,zm=Math.min,jc=Math.round;function Hx(){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 VT(){return!/^((?!chrome|android).)*safari/i.test(Hx())}function Xc(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var i=n.getBoundingClientRect(),s=1,r=1;t&&Ss(n)&&(s=n.offsetWidth>0&&jc(i.width)/n.offsetWidth||1,r=n.offsetHeight>0&&jc(i.height)/n.offsetHeight||1);var a=al(n)?rs(n):window,o=a.visualViewport,l=!VT()&&e,c=(i.left+(l&&o?o.offsetLeft:0))/s,h=(i.top+(l&&o?o.offsetTop:0))/r,u=i.width/s,p=i.height/r;return{width:u,height:p,top:h,right:c+u,bottom:h+p,left:c,x:c,y:h}}function Wv(n){var t=Xc(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 WT(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&Vv(e)){var i=t;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ha(n){return rs(n).getComputedStyle(n)}function VL(n){return["table","td","th"].indexOf(Rr(n))>=0}function to(n){return((al(n)?n.ownerDocument:n.document)||window.document).documentElement}function H0(n){return Rr(n)==="html"?n:n.assignedSlot||n.parentNode||(Vv(n)?n.host:null)||to(n)}function pw(n){return!Ss(n)||ha(n).position==="fixed"?null:n.offsetParent}function WL(n){var t=/firefox/i.test(Hx()),e=/Trident/i.test(Hx());if(e&&Ss(n)){var i=ha(n);if(i.position==="fixed")return null}var s=H0(n);for(Vv(s)&&(s=s.host);Ss(s)&&["html","body"].indexOf(Rr(s))<0;){var r=ha(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function wf(n){for(var t=rs(n),e=pw(n);e&&VL(e)&&ha(e).position==="static";)e=pw(e);return e&&(Rr(e)==="html"||Rr(e)==="body"&&ha(e).position==="static")?t:e||WL(n)||t}function jv(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Mu(n,t,e){return Jo(n,zm(t,e))}function jL(n,t,e){var i=Mu(n,t,e);return i>e?e:i}function jT(){return{top:0,right:0,bottom:0,left:0}}function XT(n){return Object.assign({},jT(),n)}function qT(n,t){return t.reduce(function(e,i){return e[i]=n,e},{})}var XL=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,XT(typeof t!="number"?t:qT(t,bf))};function qL(n){var t,e=n.state,i=n.name,s=n.options,r=e.elements.arrow,a=e.modifiersData.popperOffsets,o=br(e.placement),l=jv(o),c=[Hi,As].indexOf(o)>=0,h=c?"height":"width";if(!(!r||!a)){var u=XL(s.padding,e),p=Wv(r),m=l==="y"?Bi:Hi,g=l==="y"?Es:As,x=e.rects.reference[h]+e.rects.reference[l]-a[l]-e.rects.popper[h],y=a[l]-e.rects.reference[l],_=wf(r),b=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,S=x/2-y/2,w=u[m],R=b-p[h]-u[g],T=b/2-p[h]/2+S,C=Mu(w,T,R),L=l;e.modifiersData[i]=(t={},t[L]=C,t.centerOffset=C-T,t)}}function YL(n){var t=n.state,e=n.options,i=e.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||WT(t.elements.popper,s)&&(t.elements.arrow=s))}const $L={name:"arrow",enabled:!0,phase:"main",fn:qL,effect:YL,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qc(n){return n.split("-")[1]}var ZL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function KL(n,t){var e=n.x,i=n.y,s=t.devicePixelRatio||1;return{x:jc(e*s)/s||0,y:jc(i*s)/s||0}}function mw(n){var t,e=n.popper,i=n.popperRect,s=n.placement,r=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,x=g===void 0?0:g,y=typeof h=="function"?h({x:m,y:x}):{x:m,y:x};m=y.x,x=y.y;var _=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),S=Hi,w=Bi,R=window;if(c){var T=wf(e),C="clientHeight",L="clientWidth";if(T===rs(e)&&(T=to(e),ha(T).position!=="static"&&o==="absolute"&&(C="scrollHeight",L="scrollWidth")),T=T,s===Bi||(s===Hi||s===As)&&r===Vu){w=Es;var P=u&&T===R&&R.visualViewport?R.visualViewport.height:T[C];x-=P-i.height,x*=l?1:-1}if(s===Hi||(s===Bi||s===Es)&&r===Vu){S=As;var E=u&&T===R&&R.visualViewport?R.visualViewport.width:T[L];m-=E-i.width,m*=l?1:-1}}var D=Object.assign({position:o},c&&ZL),z=h===!0?KL({x:m,y:x},rs(e)):{x:m,y:x};if(m=z.x,x=z.y,l){var G;return Object.assign({},D,(G={},G[w]=b?"0":"",G[S]=_?"0":"",G.transform=(R.devicePixelRatio||1)<=1?"translate("+m+"px, "+x+"px)":"translate3d("+m+"px, "+x+"px, 0)",G))}return Object.assign({},D,(t={},t[w]=b?x+"px":"",t[S]=_?m+"px":"",t.transform="",t))}function JL(n){var t=n.state,e=n.options,i=e.gpuAcceleration,s=i===void 0?!0:i,r=e.adaptive,a=r===void 0?!0:r,o=e.roundOffsets,l=o===void 0?!0:o,c={placement:br(t.placement),variation:qc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,mw(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,mw(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 QL={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:JL,data:{}};var Yd={passive:!0};function tD(n){var t=n.state,e=n.instance,i=n.options,s=i.scroll,r=s===void 0?!0:s,a=i.resize,o=a===void 0?!0:a,l=rs(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(h){h.addEventListener("scroll",e.update,Yd)}),o&&l.addEventListener("resize",e.update,Yd),function(){r&&c.forEach(function(h){h.removeEventListener("scroll",e.update,Yd)}),o&&l.removeEventListener("resize",e.update,Yd)}}const eD={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:tD,data:{}};var nD={left:"right",right:"left",bottom:"top",top:"bottom"};function bm(n){return n.replace(/left|right|bottom|top/g,function(t){return nD[t]})}var iD={start:"end",end:"start"};function gw(n){return n.replace(/start|end/g,function(t){return iD[t]})}function Xv(n){var t=rs(n),e=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:e,scrollTop:i}}function qv(n){return Xc(to(n)).left+Xv(n).scrollLeft}function sD(n,t){var e=rs(n),i=to(n),s=e.visualViewport,r=i.clientWidth,a=i.clientHeight,o=0,l=0;if(s){r=s.width,a=s.height;var c=VT();(c||!c&&t==="fixed")&&(o=s.offsetLeft,l=s.offsetTop)}return{width:r,height:a,x:o+qv(n),y:l}}function rD(n){var t,e=to(n),i=Xv(n),s=(t=n.ownerDocument)==null?void 0:t.body,r=Jo(e.scrollWidth,e.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=Jo(e.scrollHeight,e.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),o=-i.scrollLeft+qv(n),l=-i.scrollTop;return ha(s||e).direction==="rtl"&&(o+=Jo(e.clientWidth,s?s.clientWidth:0)-r),{width:r,height:a,x:o,y:l}}function Yv(n){var t=ha(n),e=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+s+i)}function YT(n){return["html","body","#document"].indexOf(Rr(n))>=0?n.ownerDocument.body:Ss(n)&&Yv(n)?n:YT(H0(n))}function bu(n,t){var e;t===void 0&&(t=[]);var i=YT(n),s=i===((e=n.ownerDocument)==null?void 0:e.body),r=rs(i),a=s?[r].concat(r.visualViewport||[],Yv(i)?i:[]):i,o=t.concat(a);return s?o:o.concat(bu(H0(a)))}function Gx(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function aD(n,t){var e=Xc(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 yw(n,t,e){return t===HT?Gx(sD(n,e)):al(t)?aD(t,e):Gx(rD(to(n)))}function oD(n){var t=bu(H0(n)),e=["absolute","fixed"].indexOf(ha(n).position)>=0,i=e&&Ss(n)?wf(n):n;return al(i)?t.filter(function(s){return al(s)&&WT(s,i)&&Rr(s)!=="body"}):[]}function lD(n,t,e,i){var s=t==="clippingParents"?oD(n):[].concat(t),r=[].concat(s,[e]),a=r[0],o=r.reduce(function(l,c){var h=yw(n,c,i);return l.top=Jo(h.top,l.top),l.right=zm(h.right,l.right),l.bottom=zm(h.bottom,l.bottom),l.left=Jo(h.left,l.left),l},yw(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 $T(n){var t=n.reference,e=n.element,i=n.placement,s=i?br(i):null,r=i?qc(i):null,a=t.x+t.width/2-e.width/2,o=t.y+t.height/2-e.height/2,l;switch(s){case Bi:l={x:a,y:t.y-e.height};break;case Es:l={x:a,y:t.y+t.height};break;case As:l={x:t.x+t.width,y:o};break;case Hi:l={x:t.x-e.width,y:o};break;default:l={x:t.x,y:t.y}}var c=s?jv(s):null;if(c!=null){var h=c==="y"?"height":"width";switch(r){case Wc:l[c]=l[c]-(t[h]/2-e[h]/2);break;case Vu:l[c]=l[c]+(t[h]/2-e[h]/2);break}}return l}function Wu(n,t){t===void 0&&(t={});var e=t,i=e.placement,s=i===void 0?n.placement:i,r=e.strategy,a=r===void 0?n.strategy:r,o=e.boundary,l=o===void 0?CL:o,c=e.rootBoundary,h=c===void 0?HT:c,u=e.elementContext,p=u===void 0?Gh:u,m=e.altBoundary,g=m===void 0?!1:m,x=e.padding,y=x===void 0?0:x,_=XT(typeof y!="number"?y:qT(y,bf)),b=p===Gh?RL:Gh,S=n.rects.popper,w=n.elements[g?b:p],R=lD(al(w)?w:w.contextElement||to(n.elements.popper),l,h,a),T=Xc(n.elements.reference),C=$T({reference:T,element:S,strategy:"absolute",placement:s}),L=Gx(Object.assign({},S,C)),P=p===Gh?L:T,E={top:R.top-P.top+_.top,bottom:P.bottom-R.bottom+_.bottom,left:R.left-P.left+_.left,right:P.right-R.right+_.right},D=n.modifiersData.offset;if(p===Gh&&D){var z=D[s];Object.keys(E).forEach(function(G){var W=[As,Es].indexOf(G)>=0?1:-1,Q=[Bi,Es].indexOf(G)>=0?"y":"x";E[G]+=z[Q]*W})}return E}function cD(n,t){t===void 0&&(t={});var e=t,i=e.placement,s=e.boundary,r=e.rootBoundary,a=e.padding,o=e.flipVariations,l=e.allowedAutoPlacements,c=l===void 0?GT:l,h=qc(i),u=h?o?dw:dw.filter(function(g){return qc(g)===h}):bf,p=u.filter(function(g){return c.indexOf(g)>=0});p.length===0&&(p=u);var m=p.reduce(function(g,x){return g[x]=Wu(n,{placement:x,boundary:s,rootBoundary:r,padding:a})[br(x)],g},{});return Object.keys(m).sort(function(g,x){return m[g]-m[x]})}function hD(n){if(br(n)===Gv)return[];var t=bm(n);return[gw(n),t,gw(t)]}function uD(n){var t=n.state,e=n.options,i=n.name;if(!t.modifiersData[i]._skip){for(var s=e.mainAxis,r=s===void 0?!0:s,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,x=e.allowedAutoPlacements,y=t.options.placement,_=br(y),b=_===y,S=l||(b||!g?[bm(y)]:hD(y)),w=[y].concat(S).reduce(function(q,rt){return q.concat(br(rt)===Gv?cD(t,{placement:rt,boundary:h,rootBoundary:u,padding:c,flipVariations:g,allowedAutoPlacements:x}):rt)},[]),R=t.rects.reference,T=t.rects.popper,C=new Map,L=!0,P=w[0],E=0;E=0,Q=W?"width":"height",Y=Wu(t,{placement:D,boundary:h,rootBoundary:u,altBoundary:p,padding:c}),ot=W?G?As:Hi:G?Es:Bi;R[Q]>T[Q]&&(ot=bm(ot));var H=bm(ot),Z=[];if(r&&Z.push(Y[z]<=0),o&&Z.push(Y[ot]<=0,Y[H]<=0),Z.every(function(q){return q})){P=D,L=!1;break}C.set(D,Z)}if(L)for(var it=g?3:1,$=function(rt){var St=w.find(function(dt){var It=C.get(dt);if(It)return It.slice(0,rt).every(function(Ht){return Ht})});if(St)return P=St,"break"},lt=it;lt>0;lt--){var _t=$(lt);if(_t==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const fD={name:"flip",enabled:!0,phase:"main",fn:uD,requiresIfExists:["offset"],data:{_skip:!1}};function _w(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 xw(n){return[Bi,As,Es,Hi].some(function(t){return n[t]>=0})}function dD(n){var t=n.state,e=n.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,a=Wu(t,{elementContext:"reference"}),o=Wu(t,{altBoundary:!0}),l=_w(a,i),c=_w(o,s,r),h=xw(l),u=xw(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 pD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dD};function mD(n,t,e){var i=br(n),s=[Hi,Bi].indexOf(i)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,a=r[0],o=r[1];return a=a||0,o=(o||0)*s,[Hi,As].indexOf(i)>=0?{x:o,y:a}:{x:a,y:o}}function gD(n){var t=n.state,e=n.options,i=n.name,s=e.offset,r=s===void 0?[0,0]:s,a=GT.reduce(function(h,u){return h[u]=mD(u,t.rects,r),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 yD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:gD};function _D(n){var t=n.state,e=n.name;t.modifiersData[e]=$T({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const xD={name:"popperOffsets",enabled:!0,phase:"read",fn:_D,data:{}};function vD(n){return n==="x"?"y":"x"}function MD(n){var t=n.state,e=n.options,i=n.name,s=e.mainAxis,r=s===void 0?!0:s,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,x=g===void 0?0:g,y=Wu(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:h}),_=br(t.placement),b=qc(t.placement),S=!b,w=jv(_),R=vD(w),T=t.modifiersData.popperOffsets,C=t.rects.reference,L=t.rects.popper,P=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,E=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,z={x:0,y:0};if(T){if(r){var G,W=w==="y"?Bi:Hi,Q=w==="y"?Es:As,Y=w==="y"?"height":"width",ot=T[w],H=ot+y[W],Z=ot-y[Q],it=m?-L[Y]/2:0,$=b===Wc?C[Y]:L[Y],lt=b===Wc?-L[Y]:-C[Y],_t=t.elements.arrow,q=m&&_t?Wv(_t):{width:0,height:0},rt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jT(),St=rt[W],dt=rt[Q],It=Mu(0,C[Y],q[Y]),Ht=S?C[Y]/2-it-It-St-E.mainAxis:$-It-St-E.mainAxis,Bt=S?-C[Y]/2+it+It+dt+E.mainAxis:lt+It+dt+E.mainAxis,Qt=t.elements.arrow&&wf(t.elements.arrow),ht=Qt?w==="y"?Qt.clientTop||0:Qt.clientLeft||0:0,gt=(G=D==null?void 0:D[w])!=null?G:0,k=ot+Ht-gt-ht,Et=ot+Bt-gt,wt=Mu(m?zm(H,k):H,ot,m?Jo(Z,Et):Z);T[w]=wt,z[w]=wt-ot}if(o){var Lt,Ct=w==="x"?Bi:Hi,ne=w==="x"?Es:As,Ft=T[R],U=R==="y"?"height":"width",N=Ft+y[Ct],st=Ft-y[ne],yt=[Bi,Hi].indexOf(_)!==-1,Rt=(Lt=D==null?void 0:D[R])!=null?Lt:0,Mt=yt?N:Ft-C[U]-L[U]-Rt+E.altAxis,te=yt?Ft+C[U]+L[U]-Rt-E.altAxis:st,zt=m&&yt?jL(Mt,Ft,te):Mu(m?Mt:N,Ft,m?te:st);T[R]=zt,z[R]=zt-Ft}t.modifiersData[i]=z}}const bD={name:"preventOverflow",enabled:!0,phase:"main",fn:MD,requiresIfExists:["offset"]};function wD(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function SD(n){return n===rs(n)||!Ss(n)?Xv(n):wD(n)}function ED(n){var t=n.getBoundingClientRect(),e=jc(t.width)/n.offsetWidth||1,i=jc(t.height)/n.offsetHeight||1;return e!==1||i!==1}function AD(n,t,e){e===void 0&&(e=!1);var i=Ss(t),s=Ss(t)&&ED(t),r=to(t),a=Xc(n,s,e),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!e)&&((Rr(t)!=="body"||Yv(r))&&(o=SD(t)),Ss(t)?(l=Xc(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=qv(r))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function TD(n){var t=new Map,e=new Set,i=[];n.forEach(function(r){t.set(r.name,r)});function s(r){e.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(o){if(!e.has(o)){var l=t.get(o);l&&s(l)}}),i.push(r)}return n.forEach(function(r){e.has(r.name)||s(r)}),i}function CD(n){var t=TD(n);return zL.reduce(function(e,i){return e.concat(t.filter(function(s){return s.phase===i}))},[])}function RD(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function PD(n){var t=n.reduce(function(e,i){var s=e[i.name];return e[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,e},{});return Object.keys(t).map(function(e){return t[e]})}var vw={placement:"bottom",modifiers:[],strategy:"absolute"};function Mw(){for(var n=arguments.length,t=new Array(n),e=0;e({var:n,varRef:t?`var(${n}, ${t})`:`var(${n})`}),qn={arrowShadowColor:zl("--popper-arrow-shadow-color"),arrowSize:zl("--popper-arrow-size","8px"),arrowSizeHalf:zl("--popper-arrow-size-half"),arrowBg:zl("--popper-arrow-bg"),transformOrigin:zl("--popper-transform-origin"),arrowOffset:zl("--popper-arrow-offset")};function ND(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)"}const OD={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"},FD=n=>OD[n],bw={scroll:!0,resize:!0};function UD(n){let t;return typeof n=="object"?t={enabled:!0,options:{...bw,...n}}:t={enabled:n,options:bw},t}const kD={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`}},zD={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:n})=>{ww(n)},effect:({state:n})=>()=>{ww(n)}},ww=n=>{n.elements.popper.style.setProperty(qn.transformOrigin.var,FD(n.placement))},BD={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:n})=>{HD(n)}},HD=n=>{var e;if(!n.placement)return;const t=GD(n.placement);if((e=n.elements)!=null&&e.arrow&&t){Object.assign(n.elements.arrow.style,{[t.property]:t.value,width:qn.arrowSize.varRef,height:qn.arrowSize.varRef,zIndex:-1});const i={[qn.arrowSizeHalf.var]:`calc(${qn.arrowSize.varRef} / 2 - 1px)`,[qn.arrowOffset.var]:`calc(${qn.arrowSizeHalf.varRef} * -1)`};for(const s in i)n.elements.arrow.style.setProperty(s,i[s])}},GD=n=>{if(n.startsWith("top"))return{property:"bottom",value:qn.arrowOffset.varRef};if(n.startsWith("bottom"))return{property:"top",value:qn.arrowOffset.varRef};if(n.startsWith("left"))return{property:"right",value:qn.arrowOffset.varRef};if(n.startsWith("right"))return{property:"left",value:qn.arrowOffset.varRef}},VD={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:n})=>{Sw(n)},effect:({state:n})=>()=>{Sw(n)}},Sw=n=>{if(!n.elements.arrow)return;const t=n.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const e=ND(n.placement);e&&t.style.setProperty("--popper-arrow-default-shadow",e),Object.assign(t.style,{transform:"rotate(45deg)",background:qn.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},WD={"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"}},jD={"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 XD(n,t="ltr"){var i;const e=((i=WD[n])==null?void 0:i[t])||n;return t==="ltr"?e:jD[n]??e}function qD(n={}){const{enabled:t=!0,modifiers:e,placement:i="bottom",strategy:s="absolute",arrowPadding:r=8,eventListeners:a=!0,offset:o,gutter:l=8,flip:c=!0,boundary:h="clippingParents",preventOverflow:u=!0,matchWidth:p,direction:m="ltr"}=n,g=J.useRef(null),x=J.useRef(null),y=J.useRef(null),_=XD(i,m),b=J.useRef(()=>{}),S=J.useCallback(()=>{var E;!t||!g.current||!x.current||((E=b.current)==null||E.call(b),y.current=DD(g.current,x.current,{placement:_,modifiers:[VD,BD,zD,{...kD,enabled:!!p},{name:"eventListeners",...UD(a)},{name:"arrow",options:{padding:r}},{name:"offset",options:{offset:o??[0,l]}},{name:"flip",enabled:!!c,options:{padding:8}},{name:"preventOverflow",enabled:!!u,options:{boundary:h}},...e??[]],strategy:s}),y.current.forceUpdate(),b.current=y.current.destroy)},[_,t,e,p,a,r,o,l,c,u,h,s]);J.useEffect(()=>()=>{var E;!g.current&&!x.current&&((E=y.current)==null||E.destroy(),y.current=null)},[]);const w=J.useCallback(E=>{g.current=E,S()},[S]),R=J.useCallback((E={},D=null)=>({...E,ref:Ha(w,D)}),[w]),T=J.useCallback(E=>{x.current=E,S()},[S]),C=J.useCallback((E={},D=null)=>({...E,ref:Ha(T,D),style:{...E.style,position:s,minWidth:p?void 0:"max-content",inset:"0 auto auto 0"}}),[s,T,p]),L=J.useCallback((E={},D=null)=>{const{size:z,shadowColor:G,bg:W,style:Q,...Y}=E;return{...Y,ref:D,"data-popper-arrow":"",style:YD(E)}},[]),P=J.useCallback((E={},D=null)=>({...E,ref:D,"data-popper-arrow-inner":""}),[]);return{update(){var E;(E=y.current)==null||E.update()},forceUpdate(){var E;(E=y.current)==null||E.forceUpdate()},transformOrigin:qn.transformOrigin.varRef,referenceRef:w,popperRef:T,getPopperProps:C,getArrowProps:L,getArrowInnerProps:P,getReferenceProps:R}}function YD(n){const{size:t,shadowColor:e,bg:i,style:s}=n,r={...s,position:"absolute"};return t&&(r["--popper-arrow-size"]=t),e&&(r["--popper-arrow-shadow-color"]=e),i&&(r["--popper-arrow-bg"]=i),r}const[$D,ZD]=U0(),KD={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function JD(n,t){var e;if(n)return((e=KD[n])==null?void 0:e[t])??n}function QD(n){var c;const{isOpen:t,onClose:e,placement:i="right",children:s,...r}=n,a=Nv(),o=(c=a.components)==null?void 0:c.Drawer,l=JD(i,a.direction);return V.jsx($D,{value:{placement:l},children:V.jsx(Fv,{isOpen:t,onClose:e,styleConfig:o,...r,children:s})})}const Ew={exit:{duration:.15,ease:uu.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},tN={exit:({direction:n,transition:t,transitionEnd:e,delay:i})=>{const{exit:s}=Fx({direction:n});return{...s,transition:(t==null?void 0:t.exit)??Um.exit(Ew.exit,i),transitionEnd:e==null?void 0:e.exit}},enter:({direction:n,transitionEnd:t,transition:e,delay:i})=>{const{enter:s}=Fx({direction:n});return{...s,transition:(e==null?void 0:e.enter)??Um.enter(Ew.enter,i),transitionEnd:t==null?void 0:t.enter}}},ZT=J.forwardRef(function(t,e){const{direction:i="right",style:s,unmountOnExit:r,in:a,className:o,transition:l,transitionEnd:c,delay:h,motionProps:u,animatePresenceProps:p,...m}=t,g=Fx({direction:i}),x=Object.assign({position:"fixed"},g.position,s),y=r?a&&r:!0,_=a||r?"enter":"exit",b={transitionEnd:c,transition:l,direction:i,delay:h};return V.jsx(Lv,{...p,custom:b,children:y&&V.jsx(Dv.div,{...m,ref:e,initial:"exit",className:os("chakra-slide",o),animate:_,exit:"exit",custom:b,variants:tN,style:x,...u})})});ZT.displayName="Slide";const eN=cn(ZT),KT=Gi((n,t)=>{const{className:e,children:i,motionProps:s,containerProps:r,...a}=n,{getDialogProps:o,getDialogContainerProps:l,isOpen:c}=_I(),h=o(a,t),u=l(r),p=os("chakra-modal__content",e),m=xI(),g={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},x={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{placement:y}=ZD();return V.jsx(vI,{children:V.jsx(cn.div,{...u,className:"chakra-modal__content-container",__css:x,children:V.jsx(eN,{motionProps:s,direction:y,in:c,className:p,...h,__css:g,children:i})})})});KT.displayName="DrawerContent";function nN(n,t,e){return(n-t)*100/(e-t)}k0({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});k0({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});const iN=k0({"0%":{left:"-40%"},"100%":{left:"100%"}}),sN=k0({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function rN(n){const{value:t=0,min:e,max:i,valueText:s,getValueText:r,isIndeterminate:a,role:o="progressbar"}=n,l=nN(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 r=="function"?r(t,l):s})(),role:o},percent:l,value:t}}const[aN,oN]=U0({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),lN=Gi((n,t)=>{const{min:e,max:i,value:s,isIndeterminate:r,role:a,...o}=n,l=rN({value:s,min:e,max:i,isIndeterminate:r,role:a}),h={height:"100%",...oN().filledTrack};return V.jsx(cn.div,{ref:t,style:{width:`${l.percent}%`,...o.style},...l.bind,...o,__css:h})}),JT=Gi((n,t)=>{var C;const{value:e,min:i=0,max:s=100,hasStripe:r,isAnimated:a,children:o,borderRadius:l,isIndeterminate:c,"aria-label":h,"aria-labelledby":u,"aria-valuetext":p,title:m,role:g,...x}=_f(n),y=Ov("Progress",n),_=l??((C=y.track)==null?void 0:C.borderRadius),b={animation:`${sN} 1s linear infinite`},R={...!c&&r&&a&&b,...c&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${iN} 1s ease infinite normal none running`}},T={overflow:"hidden",position:"relative",...y.track};return V.jsx(cn.div,{ref:t,borderRadius:_,__css:T,...x,children:V.jsxs(aN,{value:y,children:[V.jsx(lN,{"aria-label":h,"aria-labelledby":u,"aria-valuetext":p,min:i,max:s,value:e,isIndeterminate:c,css:R,borderRadius:_,title:m,role:g}),o]})})});JT.displayName="Progress";function $d(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}const wm={width:0,height:0},Zd=n=>n||wm;function cN(n){const{orientation:t,thumbPercents:e,thumbRects:i,isReversed:s}=n,r=x=>{const y=i[x]??wm;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...$d({orientation:t,vertical:{bottom:`calc(${e[x]}% - ${y.height/2}px)`},horizontal:{left:`calc(${e[x]}% - ${y.width/2}px)`}})}},a=t==="vertical"?i.reduce((x,y)=>Zd(x).height>Zd(y).height?x:y,wm):i.reduce((x,y)=>Zd(x).width>Zd(y).width?x:y,wm),o={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...$d({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",...$d({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},c=e.length===1,h=[0,s?100-e[0]:e[0]],u=c?h:e;let p=u[0];!c&&s&&(p=100-p);const m=Math.abs(u[u.length-1]-u[0]),g={...l,...$d({orientation:t,vertical:s?{height:`${m}%`,top:`${p}%`}:{height:`${m}%`,bottom:`${p}%`},horizontal:s?{width:`${m}%`,right:`${p}%`}:{width:`${m}%`,left:`${p}%`}})};return{trackStyle:l,innerTrackStyle:g,rootStyle:o,getThumbStyle:r}}function hN(n){const{isReversed:t,direction:e,orientation:i}=n;return e==="ltr"||i==="vertical"?t:!t}function uN(n){const{min:t=0,max:e=100,onChange:i,value:s,defaultValue:r,isReversed:a,direction:o="ltr",orientation:l="horizontal",id:c,isDisabled:h,isReadOnly:u,onChangeStart:p,onChangeEnd:m,step:g=1,getAriaValueText:x,"aria-valuetext":y,"aria-label":_,"aria-labelledby":b,name:S,focusThumbOnChange:w=!0,...R}=n,T=Ko(p),C=Ko(m),L=Ko(x),P=hN({isReversed:a,direction:o,orientation:l}),[E,D]=aI({value:s,defaultValue:r??dN(t,e),onChange:i}),[z,G]=J.useState(!1),[W,Q]=J.useState(!1),Y=!(h||u),ot=(e-t)/10,H=g||(e-t)/100,Z=Wy(E,t,e),it=e-Z+t,lt=sw(P?it:Z,t,e),_t=l==="vertical",q=OT({min:t,max:e,step:g,isDisabled:h,value:Z,isInteractive:Y,isReversed:P,isVertical:_t,eventSource:null,focusThumbOnChange:w,orientation:l}),rt=J.useRef(null),St=J.useRef(null),dt=J.useRef(null),It=J.useId(),Ht=c??It,[Bt,Qt]=[`slider-thumb-${Ht}`,`slider-track-${Ht}`],ht=J.useCallback(at=>{var Ot;if(!rt.current)return;const Tt=q.current;Tt.eventSource="pointer";const ae=rt.current.getBoundingClientRect(),{clientX:ue,clientY:Vt}=((Ot=at.touches)==null?void 0:Ot[0])??at,X=_t?ae.bottom-Vt:ue-ae.left,bt=_t?ae.height:ae.width;let Gt=X/bt;P&&(Gt=1-Gt);let j=GI(Gt,Tt.min,Tt.max);return Tt.step&&(j=parseFloat(rw(j,Tt.min,Tt.step))),j=Wy(j,Tt.min,Tt.max),j},[_t,P,q]),gt=J.useCallback(at=>{const Tt=q.current;Tt.isInteractive&&(at=parseFloat(rw(at,Tt.min,H)),at=Wy(at,Tt.min,Tt.max),D(at))},[H,D,q]),k=J.useMemo(()=>({stepUp(at=H){const Tt=P?Z-at:Z+at;gt(Tt)},stepDown(at=H){const Tt=P?Z+at:Z-at;gt(Tt)},reset(){gt(r||0)},stepTo(at){gt(at)}}),[gt,P,Z,H,r]),Et=J.useCallback(at=>{const Tt=q.current,ue={ArrowRight:()=>k.stepUp(),ArrowUp:()=>k.stepUp(),ArrowLeft:()=>k.stepDown(),ArrowDown:()=>k.stepDown(),PageUp:()=>k.stepUp(ot),PageDown:()=>k.stepDown(ot),Home:()=>gt(Tt.min),End:()=>gt(Tt.max)}[at.key];ue&&(at.preventDefault(),at.stopPropagation(),ue(at),Tt.eventSource="keyboard")},[k,gt,ot,q]),wt=(L==null?void 0:L(Z))??y,Lt=KI(St),{getThumbStyle:Ct,rootStyle:ne,trackStyle:Ft,innerTrackStyle:U}=J.useMemo(()=>{const at=q.current,Tt=Lt??{width:0,height:0};return cN({isReversed:P,orientation:at.orientation,thumbRects:[Tt],thumbPercents:[lt]})},[P,Lt,lt,q]),N=J.useCallback(()=>{q.current.focusThumbOnChange&&setTimeout(()=>{var Tt;return(Tt=St.current)==null?void 0:Tt.focus()})},[q]);ET(()=>{const at=q.current;N(),at.eventSource==="keyboard"&&(C==null||C(at.value))},[Z,C]);function st(at){const Tt=ht(at);Tt!=null&&Tt!==q.current.value&&D(Tt)}fL(dt,{onPanSessionStart(at){const Tt=q.current;Tt.isInteractive&&(G(!0),N(),st(at),T==null||T(Tt.value))},onPanSessionEnd(){const at=q.current;at.isInteractive&&(G(!1),C==null||C(at.value))},onPan(at){q.current.isInteractive&&st(at)}});const yt=J.useCallback((at={},Tt=null)=>({...at,...R,ref:Ha(Tt,dt),tabIndex:-1,"aria-disabled":Hy(h),"data-focused":Ye(W),style:{...at.style,...ne}}),[R,h,W,ne]),Rt=J.useCallback((at={},Tt=null)=>({...at,ref:Ha(Tt,rt),id:Qt,"data-disabled":Ye(h),style:{...at.style,...Ft}}),[h,Qt,Ft]),Mt=J.useCallback((at={},Tt=null)=>({...at,ref:Tt,style:{...at.style,...U}}),[U]),te=J.useCallback((at={},Tt=null)=>({...at,ref:Ha(Tt,St),role:"slider",tabIndex:Y?0:void 0,id:Bt,"data-active":Ye(z),"aria-valuetext":wt,"aria-valuemin":t,"aria-valuemax":e,"aria-valuenow":Z,"aria-orientation":l,"aria-disabled":Hy(h),"aria-readonly":Hy(u),"aria-label":_,"aria-labelledby":_?void 0:b,style:{...at.style,...Ct(0)},onKeyDown:Ln(at.onKeyDown,Et),onFocus:Ln(at.onFocus,()=>Q(!0)),onBlur:Ln(at.onBlur,()=>Q(!1))}),[Y,Bt,z,wt,t,e,Z,l,h,u,_,b,Ct,Et]),zt=J.useCallback((at,Tt=null)=>{const ae=!(at.valuee),ue=Z>=at.value,Vt=sw(at.value,t,e),X={position:"absolute",pointerEvents:"none",...fN({orientation:l,vertical:{bottom:P?`${100-Vt}%`:`${Vt}%`},horizontal:{left:P?`${100-Vt}%`:`${Vt}%`}})};return{...at,ref:Tt,role:"presentation","aria-hidden":!0,"data-disabled":Ye(h),"data-invalid":Ye(!ae),"data-highlighted":Ye(ue),style:{...at.style,...X}}},[h,P,e,t,l,Z]),Zt=J.useCallback((at={},Tt=null)=>({...at,ref:Tt,type:"hidden",value:Z,name:S}),[S,Z]);return{state:{value:Z,isFocused:W,isDragging:z},actions:k,getRootProps:yt,getTrackProps:Rt,getInnerTrackProps:Mt,getThumbProps:te,getMarkerProps:zt,getInputProps:Zt}}function fN(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}function dN(n,t){return t"}),[mN,V0]=U0({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),QT=Gi((n,t)=>{const e={...n,orientation:(n==null?void 0:n.orientation)??"horizontal"},i=Ov("Slider",e),s=_f(e),{direction:r}=Nv();s.direction=r;const{getInputProps:a,getRootProps:o,...l}=uN(s),c=o(),h=a({},t);return V.jsx(pN,{value:l,children:V.jsx(mN,{value:i,children:V.jsxs(cn.div,{...c,className:os("chakra-slider",e.className),__css:i.container,children:[e.children,V.jsx("input",{...h})]})})})});QT.displayName="Slider";const t2=Gi((n,t)=>{const{getThumbProps:e}=G0(),i=V0(),s=e(n,t);return V.jsx(cn.div,{...s,className:os("chakra-slider__thumb",n.className),__css:i.thumb})});t2.displayName="SliderThumb";const e2=Gi((n,t)=>{const{getTrackProps:e}=G0(),i=V0(),s=e(n,t);return V.jsx(cn.div,{...s,className:os("chakra-slider__track",n.className),__css:i.track})});e2.displayName="SliderTrack";const n2=Gi((n,t)=>{const{getInnerTrackProps:e}=G0(),i=V0(),s=e(n,t);return V.jsx(cn.div,{...s,className:os("chakra-slider__filled-track",n.className),__css:i.filledTrack})});n2.displayName="SliderFilledTrack";const gN=Gi((n,t)=>{const{getMarkerProps:e}=G0(),i=V0(),s=e(n,t);return V.jsx(cn.div,{...s,className:os("chakra-slider__marker",n.className),__css:i.mark})});gN.displayName="SliderMark";const i2=Gi(function(t,e){const i=Ov("Switch",t),{spacing:s="0.5rem",children:r,...a}=_f(t),{getIndicatorProps:o,getInputProps:l,getCheckboxProps:c,getRootProps:h,getLabelProps:u}=AL(a),p=J.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...i.container}),[i.container]),m=J.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...i.track}),[i.track]),g=J.useMemo(()=>({userSelect:"none",marginStart:s,...i.label}),[s,i.label]);return V.jsxs(cn.label,{...h(),className:os("chakra-switch",t.className),__css:p,children:[V.jsx("input",{className:"chakra-switch__input",...l({},e)}),V.jsx(cn.span,{...c(),className:"chakra-switch__track",__css:m,children:V.jsx(cn.span,{__css:i.thumb,className:"chakra-switch__thumb",...o()})}),r&&V.jsx(cn.span,{className:"chakra-switch__label",...u(),__css:g,children:r})]})});i2.displayName="Switch";const yN={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]}}}},Vx=n=>{var t;return((t=n.current)==null?void 0:t.ownerDocument)||document},Sm=n=>{var t,e;return((e=(t=n.current)==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)||window};function _N(n={}){const{openDelay:t=0,closeDelay:e=0,closeOnClick:i=!0,closeOnMouseDown:s,closeOnScroll:r,closeOnPointerDown:a=s,closeOnEsc:o=!0,onOpen:l,onClose:c,placement:h,id:u,isOpen:p,defaultIsOpen:m,arrowSize:g=10,arrowShadowColor:x,arrowPadding:y,modifiers:_,isDisabled:b,gutter:S,offset:w,direction:R,...T}=n,{isOpen:C,onOpen:L,onClose:P}=sl({isOpen:p,defaultIsOpen:m,onOpen:l,onClose:c}),{referenceRef:E,getPopperProps:D,getArrowInnerProps:z,getArrowProps:G}=qD({enabled:C,placement:h,arrowPadding:y,modifiers:_,gutter:S,offset:w,direction:R}),W=J.useId(),Y=`tooltip-${u??W}`,ot=J.useRef(null),H=J.useRef(),Z=J.useCallback(()=>{H.current&&(clearTimeout(H.current),H.current=void 0)},[]),it=J.useRef(),$=J.useCallback(()=>{it.current&&(clearTimeout(it.current),it.current=void 0)},[]),lt=J.useCallback(()=>{$(),P()},[P,$]),_t=xN(ot,lt),q=J.useCallback(()=>{if(!b&&!H.current){C&&_t();const ht=Sm(ot);H.current=ht.setTimeout(L,t)}},[_t,b,C,L,t]),rt=J.useCallback(()=>{Z();const ht=Sm(ot);it.current=ht.setTimeout(lt,e)},[e,lt,Z]),St=J.useCallback(()=>{C&&i&&rt()},[i,rt,C]),dt=J.useCallback(()=>{C&&a&&rt()},[a,rt,C]),It=J.useCallback(ht=>{C&&ht.key==="Escape"&&rt()},[C,rt]);jy(()=>Vx(ot),"keydown",o?It:void 0),jy(()=>{if(!r)return null;const ht=ot.current;if(!ht)return null;const gt=NT(ht);return gt.localName==="body"?Sm(ot):gt},"scroll",()=>{C&&r&<()},{passive:!0,capture:!0}),J.useEffect(()=>{b&&(Z(),C&&P())},[b,C,P,Z]),J.useEffect(()=>()=>{Z(),$()},[Z,$]),jy(()=>ot.current,"pointerleave",rt);const Ht=J.useCallback((ht={},gt=null)=>({...ht,ref:Ha(ot,gt,E),onPointerEnter:Ln(ht.onPointerEnter,Et=>{Et.pointerType!=="touch"&&q()}),onClick:Ln(ht.onClick,St),onPointerDown:Ln(ht.onPointerDown,dt),onFocus:Ln(ht.onFocus,q),onBlur:Ln(ht.onBlur,rt),"aria-describedby":C?Y:void 0}),[q,rt,dt,C,Y,St,E]),Bt=J.useCallback((ht={},gt=null)=>D({...ht,style:{...ht.style,[qn.arrowSize.var]:g?`${g}px`:void 0,[qn.arrowShadowColor.var]:x}},gt),[D,g,x]),Qt=J.useCallback((ht={},gt=null)=>{const k={...ht.style,position:"relative",transformOrigin:qn.transformOrigin.varRef};return{ref:gt,...T,...ht,id:Y,role:"tooltip",style:k}},[T,Y]);return{isOpen:C,show:q,hide:rt,getTriggerProps:Ht,getTooltipProps:Qt,getTooltipPositionerProps:Bt,getArrowProps:G,getArrowInnerProps:z}}const Yy="chakra-ui:close-tooltip";function xN(n,t){return J.useEffect(()=>{const e=Vx(n);return e.addEventListener(Yy,t),()=>e.removeEventListener(Yy,t)},[t,n]),()=>{const e=Vx(n),i=Sm(n);e.dispatchEvent(new i.CustomEvent(Yy))}}const vN=cn(Dv.div),Sf=Gi((n,t)=>{const e=AT("Tooltip",n),i=_f(n),s=Nv(),{children:r,label:a,shouldWrapChildren:o,"aria-label":l,hasArrow:c,bg:h,portalProps:u,background:p,backgroundColor:m,bgColor:g,motionProps:x,animatePresenceProps:y,..._}=i,b=p??m??h??g;if(b){e.bg=b;const E=dL(s,"colors",b);e[qn.arrowBg.var]=E}const S=_N({..._,direction:s.direction}),w=typeof r=="string"||o;let R;if(w)R=V.jsx(cn.span,{display:"inline-block",tabIndex:0,...S.getTriggerProps(),children:r});else{const E=J.Children.only(r);R=J.cloneElement(E,S.getTriggerProps(E.props,E.ref))}const T=!!l,C=S.getTooltipProps({},t),L=T?ST(C,["role","id"]):C,P=oI(C,["role","id"]);return a?V.jsxs(V.Fragment,{children:[R,V.jsx(Lv,{...y,children:S.isOpen&&V.jsx(lI,{...u,children:V.jsx(cn.div,{...S.getTooltipPositionerProps(),__css:{zIndex:e.zIndex,pointerEvents:"none"},children:V.jsxs(vN,{variants:yN,initial:"exit",animate:"enter",exit:"exit",...x,...L,__css:e,children:[a,T&&V.jsx(cn.span,{srOnly:!0,...P,children:l}),c&&V.jsx(cn.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:V.jsx(cn.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:e.bg}})})]})})})})]}):V.jsx(V.Fragment,{children:r})});Sf.displayName="Tooltip";const $v=Gi(function(t,e){const{spacing:i="0.5rem",spacingX:s,spacingY:r,children:a,justify:o,direction:l,align:c,className:h,shouldWrapChildren:u,...p}=t,m=J.useMemo(()=>u?J.Children.map(a,(g,x)=>V.jsx(s2,{children:g},x)):a,[a,u]);return V.jsx(cn.div,{ref:e,className:os("chakra-wrap",h),...p,children:V.jsx(cn.ul,{className:"chakra-wrap__list",__css:{display:"flex",flexWrap:"wrap",justifyContent:o,alignItems:c,flexDirection:l,listStyleType:"none",gap:i,columnGap:s,rowGap:r,padding:"0"},children:m})})});$v.displayName="Wrap";const s2=Gi(function(t,e){const{className:i,...s}=t;return V.jsx(cn.li,{ref:e,__css:{display:"flex",alignItems:"flex-start"},className:os("chakra-wrap__listitem",i),...s})});s2.displayName="WrapItem";function MN(){const{t:n}=Qa();return V.jsxs(pI,{children:[V.jsx(mI,{children:V.jsx(gI,{children:n("errorMessage.header")})}),V.jsx(yI,{children:n("errorMessage.wrongAdress")})]})}const bN=({progress:n})=>{const{t}=Qa(),e=3,[i,s]=J.useState(0);return J.useEffect(()=>{const r=Math.floor(Math.random()*e)+1;s(r)},[]),V.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%"},children:[V.jsx("p",{style:{margin:"20px"},children:t("loadingMessage.tip"+i.toString())}),V.jsx("div",{style:{width:"80%",maxWidth:"600px",margin:"0 auto"},children:V.jsx(JT,{value:n,width:"100%",hasStripe:!0})})]})};/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT - */const W0="171",Gn={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},ts={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},r2=0,Wx=1,a2=2,MN=3,o2=0,j0=1,wu=2,Bs=3,js=0,Si=1,fi=2,sa=0,Qo=1,jx=2,Xx=3,qx=4,l2=5,ka=100,c2=101,h2=102,u2=103,f2=104,d2=200,p2=201,m2=202,g2=203,Bm=204,Hm=205,y2=206,_2=207,x2=208,v2=209,M2=210,b2=211,w2=212,S2=213,E2=214,Gm=0,Vm=1,Wm=2,ol=3,jm=4,Xm=5,qm=6,Ym=7,Ef=0,A2=1,T2=2,wr=0,C2=1,R2=2,P2=3,Zv=4,I2=5,L2=6,D2=7,Yx="attached",N2="detached",X0=300,ua=301,Ya=302,ju=303,Xu=304,ch=306,$a=1e3,es=1001,Yc=1002,Dn=1003,q0=1004,bN=1004,Vo=1005,wN=1005,yn=1006,Fc=1007,SN=1007,ws=1008,EN=1008,Xs=1009,Kv=1010,Jv=1011,$c=1012,Y0=1013,fa=1014,ki=1015,hh=1016,$0=1017,Z0=1018,ll=1020,Qv=35902,t1=1021,e1=1022,di=1023,n1=1024,i1=1025,tl=1026,cl=1027,K0=1028,Af=1029,s1=1030,J0=1031,AN=1032,Q0=1033,Su=33776,Eu=33777,Au=33778,Tu=33779,$m=35840,Zm=35841,Km=35842,Jm=35843,Qm=36196,t0=37492,e0=37496,n0=37808,i0=37809,s0=37810,r0=37811,a0=37812,o0=37813,l0=37814,c0=37815,h0=37816,u0=37817,f0=37818,d0=37819,p0=37820,m0=37821,Cu=36492,g0=36494,y0=36495,r1=36283,_0=36284,x0=36285,v0=36286,O2=2200,F2=2201,U2=2202,Zc=2300,Kc=2301,Em=2302,Wo=2400,jo=2401,qu=2402,tg=2500,a1=2501,k2=0,o1=1,M0=2,z2=3200,B2=3201,TN=3202,CN=3203,eo=0,H2=1,Qr="",fn="srgb",$n="srgb-linear",Yu="linear",Je="srgb",RN=0,Uo=7680,PN=7681,IN=7682,LN=7683,DN=34055,NN=34056,ON=5386,FN=512,UN=513,kN=514,zN=515,BN=516,HN=517,GN=518,$x=519,G2=512,V2=513,W2=514,l1=515,j2=516,X2=517,q2=518,Y2=519,$u=35044,VN=35048,WN=35040,jN=35045,XN=35049,qN=35041,YN=35046,$N=35050,ZN=35042,KN="100",Zx="300 es",vr=2e3,Zu=2001;let Zs=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 s=this._listeners[t];if(s!==void 0){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const i=this._listeners[t.type];if(i!==void 0){t.target=this;const s=i.slice(0);for(let r=0,a=s.length;r>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 Se(n,t,e){return Math.max(t,Math.min(e,n))}function c1(n,t){return(n%t+t)%t}function JN(n,t,e,i,s){return i+(n-t)*(s-i)/(e-t)}function QN(n,t,e){return n!==t?(e-n)/(t-n):0}function Ru(n,t,e){return(1-e)*n+e*t}function tO(n,t,e,i){return Ru(n,t,1-Math.exp(-e*i))}function eO(n,t=1){return t-Math.abs(c1(n,t*2)-t)}function nO(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function iO(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function sO(n,t){return n+Math.floor(Math.random()*(t-n+1))}function rO(n,t){return n+Math.random()*(t-n)}function aO(n){return n*(.5-Math.random())}function oO(n){n!==void 0&&(Aw=n);let t=Aw+=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 lO(n){return n*el}function cO(n){return n*Jc}function hO(n){return(n&n-1)===0&&n!==0}function uO(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function fO(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function dO(n,t,e,i,s){const r=Math.cos,a=Math.sin,o=r(e/2),l=a(e/2),c=r((t+i)/2),h=a((t+i)/2),u=r((t-i)/2),p=a((t-i)/2),m=r((i-t)/2),g=a((i-t)/2);switch(s){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: "+s)}}function Mi(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 Ce(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 h1={DEG2RAD:el,RAD2DEG:Jc,generateUUID:ss,clamp:Se,euclideanModulo:c1,mapLinear:JN,inverseLerp:QN,lerp:Ru,damp:tO,pingpong:eO,smoothstep:nO,smootherstep:iO,randInt:sO,randFloat:rO,randFloatSpread:aO,seededRandom:oO,degToRad:lO,radToDeg:cO,isPowerOfTwo:hO,ceilPowerOfTwo:uO,floorPowerOfTwo:fO,setQuaternionFromProperEuler:dO,normalize:Ce,denormalize:Mi};let xt=class $2{constructor(t=0,e=0){$2.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,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Se(this.x,t.x,e.x),this.y=Se(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=Se(this.x,t,e),this.y=Se(this.y,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Se(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Se(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),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*s+t.x,this.y=r*s+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Te=class Z2{constructor(t,e,i,s,r,a,o,l,c){Z2.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,a,o,l,c)}set(t,e,i,s,r,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,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,s=e.elements,r=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],x=s[0],y=s[3],_=s[6],b=s[1],S=s[4],w=s[7],R=s[2],T=s[5],C=s[8];return r[0]=a*x+o*b+l*R,r[3]=a*y+o*S+l*T,r[6]=a*_+o*w+l*C,r[1]=c*x+h*b+u*R,r[4]=c*y+h*S+u*T,r[7]=c*_+h*w+u*C,r[2]=p*x+m*b+g*R,r[5]=p*y+m*S+g*T,r[8]=p*_+m*w+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],s=t[2],r=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*r*h+i*o*l+s*r*c-s*a*l}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=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*r,m=c*r-a*l,g=e*u+i*p+s*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/g;return t[0]=u*x,t[1]=(s*c-h*i)*x,t[2]=(o*i-s*a)*x,t[3]=p*x,t[4]=(h*e-s*l)*x,t[5]=(s*r-o*e)*x,t[6]=m*x,t[7]=(i*l-c*e)*x,t[8]=(a*e-i*r)*x,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,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*a+c*o)+a+t,-s*c,s*l,-s*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply($y.makeScale(t,e)),this}rotate(t){return this.premultiply($y.makeRotation(-t)),this}translate(t,e){return this.premultiply($y.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 s=0;s<9;s++)if(e[s]!==i[s])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 $y=new Te;function K2(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}const pO={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Tc(n,t){return new pO[n](t)}function Ku(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function J2(){const n=Ku("canvas");return n.style.display="block",n}const Tw={};function bc(n){n in Tw||(Tw[n]=!0,console.warn(n))}function mO(n,t,e){return new Promise(function(i,s){function r(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:s();break;case n.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:i()}}setTimeout(r,e)})}function gO(n){const t=n.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function yO(n){const t=n.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const Cw=new Te().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Rw=new Te().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function _O(){const n={enabled:!0,workingColorSpace:$n,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Je&&(s.r=ra(s.r),s.g=ra(s.g),s.b=ra(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Je&&(s.r=Uc(s.r),s.g=Uc(s.g),s.b=Uc(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Qr?Yu:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[$n]:{primaries:t,whitePoint:i,transfer:Yu,toXYZ:Cw,fromXYZ:Rw,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:fn},outputColorSpaceConfig:{drawingBufferColorSpace:fn}},[fn]:{primaries:t,whitePoint:i,transfer:Je,toXYZ:Cw,fromXYZ:Rw,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:fn}}}),n}const Ue=_O();function ra(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Uc(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Bl,Q2=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{Bl===void 0&&(Bl=Ku("canvas")),Bl.width=t.width,Bl.height=t.height;const i=Bl.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Bl}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=Ku("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const s=i.getImageData(0,0,t.width,t.height),r=s.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!==X0)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case $a:t.x=t.x-Math.floor(t.x);break;case es:t.x=t.x<0?0:1;break;case Yc: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 $a:t.y=t.y-Math.floor(t.y);break;case es:t.y=t.y<0?0:1;break;case Yc: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++}};bn.DEFAULT_IMAGE=null;bn.DEFAULT_MAPPING=X0;bn.DEFAULT_ANISOTROPY=1;class Ge{constructor(t=0,e=0,i=0,s=1){Ge.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,s){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw 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,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*i+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*i+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*i+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);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,s,r;const l=t.elements,c=l[0],h=l[4],u=l[8],p=l[1],m=l[5],g=l[9],x=l[2],y=l[6],_=l[10];if(Math.abs(h-p)<.01&&Math.abs(u-x)<.01&&Math.abs(g-y)<.01){if(Math.abs(h+p)<.1&&Math.abs(u+x)<.1&&Math.abs(g+y)<.1&&Math.abs(c+m+_-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const S=(c+1)/2,w=(m+1)/2,R=(_+1)/2,T=(h+p)/4,C=(u+x)/4,L=(g+y)/4;return S>w&&S>R?S<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(S),s=T/i,r=C/i):w>R?w<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(w),i=T/s,r=L/s):R<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(R),i=C/r,s=L/r),this.set(i,s,r,e),this}let b=Math.sqrt((y-g)*(y-g)+(u-x)*(u-x)+(p-h)*(p-h));return Math.abs(b)<.001&&(b=1),this.x=(y-g)/b,this.y=(u-x)/b,this.z=(p-h)/b,this.w=Math.acos((c+m+_-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=Se(this.x,t.x,e.x),this.y=Se(this.y,t.y,e.y),this.z=Se(this.z,t.z,e.z),this.w=Se(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=Se(this.x,t,e),this.y=Se(this.y,t,e),this.z=Se(this.z,t,e),this.w=Se(this.w,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Se(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class tC extends Zs{constructor(t=1,e=1,i={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Ge(0,0,t,e),this.scissorTest=!1,this.viewport=new Ge(0,0,t,e);const s={width:t,height:e,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:yn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const r=new bn(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);r.flipY=!1,r.generateMipmaps=i.generateMipmaps,r.internalFormat=i.internalFormat,this.textures=[];const a=i.count;for(let o=0;o=0?1:-1,S=1-_*_;if(S>Number.EPSILON){const R=Math.sqrt(S),T=Math.atan2(R,_*b);y=Math.sin(y*T)/R,o=Math.sin(o*T)/R}const w=o*b;if(l=l*y+p*w,c=c*y+m*w,h=h*y+g*w,u=u*y+x*w,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,s,r,a){const o=i[s],l=i[s+1],c=i[s+2],h=i[s+3],u=r[a],p=r[a+1],m=r[a+2],g=r[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,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(s/2),u=o(r/2),p=l(i/2),m=l(s/2),g=l(r/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,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],s=e[4],r=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=(r-c)*m,this._z=(a-s)*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=(s+a)/m,this._z=(r+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-i-u);this._w=(r-c)/m,this._x=(s+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+u-i-o);this._w=(a-s)/m,this._x=(r+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(Se(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const s=Math.min(1,e/i);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 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,s=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+s*c-r*l,this._y=s*h+a*l+r*o-i*c,this._z=r*h+a*c+i*l-s*o,this._w=a*h-i*o-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,s=this._y,r=this._z,a=this._w;let o=a*t._w+i*t._x+s*t._y+r*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=s,this._z=r,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*s+e*this._y,this._z=m*r+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=s*u+this._y*p,this._z=r*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(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},O=class eC{constructor(t=0,e=0,i=0){eC.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(Pw.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Pw.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,s=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*s-o*i),h=2*(o*e-r*s),u=2*(r*i-a*e);return this.x=e+l*c+a*u-o*h,this.y=i+l*h+o*c-r*u,this.z=s+l*u+r*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,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Se(this.x,t.x,e.x),this.y=Se(this.y,t.y,e.y),this.z=Se(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=Se(this.x,t,e),this.y=Se(this.y,t,e),this.z=Se(this.z,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Se(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,s=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=s*l-r*o,this.y=r*a-i*l,this.z=i*o-s*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 Ky.copy(this).projectOnVector(t),this.sub(Ky)}reflect(t){return this.sub(Ky.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(Se(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){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(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,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 Ky=new O,Pw=new Cn;let pi=class{constructor(t=new O(1/0,1/0,1/0),e=new O(-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,Ds),Ds.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(Vh),Jd.subVectors(this.max,Vh),Hl.subVectors(t.a,Vh),Gl.subVectors(t.b,Vh),Vl.subVectors(t.c,Vh),Ea.subVectors(Gl,Hl),Aa.subVectors(Vl,Gl),vo.subVectors(Hl,Vl);let e=[0,-Ea.z,Ea.y,0,-Aa.z,Aa.y,0,-vo.z,vo.y,Ea.z,0,-Ea.x,Aa.z,0,-Aa.x,vo.z,0,-vo.x,-Ea.y,Ea.x,0,-Aa.y,Aa.x,0,-vo.y,vo.x,0];return!Jy(e,Hl,Gl,Vl,Jd)||(e=[1,0,0,0,1,0,0,0,1],!Jy(e,Hl,Gl,Vl,Jd))?!1:(Qd.crossVectors(Ea,Aa),e=[Qd.x,Qd.y,Qd.z],Jy(e,Hl,Gl,Vl,Jd))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ds).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Ds).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:(kr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),kr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),kr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),kr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),kr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),kr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),kr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),kr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(kr),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 kr=[new O,new O,new O,new O,new O,new O,new O,new O],Ds=new O,Kd=new pi,Hl=new O,Gl=new O,Vl=new O,Ea=new O,Aa=new O,vo=new O,Vh=new O,Jd=new O,Qd=new O,Mo=new O;function Jy(n,t,e,i,s){for(let r=0,a=n.length-3;r<=a;r+=3){Mo.fromArray(n,r);const o=s.x*Math.abs(Mo.x)+s.y*Math.abs(Mo.y)+s.z*Math.abs(Mo.z),l=t.dot(Mo),c=e.dot(Mo),h=i.dot(Mo);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const wO=new pi,Wh=new O,Qy=new O;let Yn=class{constructor(t=new O,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):wO.setFromPoints(t).getCenter(i);let s=0;for(let r=0,a=t.length;rthis.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;Wh.subVectors(t,this.center);const e=Wh.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),s=(i-this.radius)*.5;this.center.addScaledVector(Wh,s/i),this.radius+=s}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):(Qy.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Wh.copy(t.center).add(Qy)),this.expandByPoint(Wh.copy(t.center).sub(Qy))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}};const zr=new O,t_=new O,tp=new O,Ta=new O,e_=new O,ep=new O,n_=new O;let no=class{constructor(t=new O,e=new O(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,zr)),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=zr.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(zr.copy(this.origin).addScaledVector(this.direction,e),zr.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){t_.copy(t).add(e).multiplyScalar(.5),tp.copy(e).sub(t).normalize(),Ta.copy(this.origin).sub(t_);const r=t.distanceTo(e)*.5,a=-this.direction.dot(tp),o=Ta.dot(this.direction),l=-Ta.dot(tp),c=Ta.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=r*h,u>=0)if(p>=-g)if(p<=g){const x=1/h;u*=x,p*=x,m=u*(u+a*p+2*o)+p*(a*u+p+2*l)+c}else p=r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p=-r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p<=-g?(u=Math.max(0,-(-a*r+o)),p=u>0?-r:Math.min(Math.max(-r,-l),r),m=-u*u+p*(p+2*l)+c):p<=g?(u=0,p=Math.min(Math.max(-r,-l),r),m=p*(p+2*l)+c):(u=Math.max(0,-(a*r+o)),p=u>0?r:Math.min(Math.max(-r,-l),r),m=-u*u+p*(p+2*l)+c);else p=a>0?-r:r,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),s&&s.copy(t_).addScaledVector(tp,p),m}intersectSphere(t,e){zr.subVectors(t.center,this.origin);const i=zr.dot(this.direction),s=zr.dot(zr)-i*i,r=t.radius*t.radius;if(s>r)return null;const a=Math.sqrt(r-s),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,s,r,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,s=(t.max.x-p.x)*c):(i=(t.max.x-p.x)*c,s=(t.min.x-p.x)*c),h>=0?(r=(t.min.y-p.y)*h,a=(t.max.y-p.y)*h):(r=(t.max.y-p.y)*h,a=(t.min.y-p.y)*h),i>a||r>s||((r>i||isNaN(i))&&(i=r),(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>s)||((o>i||i!==i)&&(i=o),(l=0?i:s,e)}intersectsBox(t){return this.intersectBox(t,zr)!==null}intersectTriangle(t,e,i,s,r){e_.subVectors(e,t),ep.subVectors(i,t),n_.crossVectors(e_,ep);let a=this.direction.dot(n_),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ta.subVectors(this.origin,t);const l=o*this.direction.dot(ep.crossVectors(Ta,ep));if(l<0)return null;const c=o*this.direction.dot(e_.cross(Ta));if(c<0||l+c>a)return null;const h=-o*Ta.dot(n_);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},ye=class Kx{constructor(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y){Kx.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,s,r,a,o,l,c,h,u,p,m,g,x,y)}set(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y){const _=this.elements;return _[0]=t,_[4]=e,_[8]=i,_[12]=s,_[1]=r,_[5]=a,_[9]=o,_[13]=l,_[2]=c,_[6]=h,_[10]=u,_[14]=p,_[3]=m,_[7]=g,_[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 Kx().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,s=1/Wl.setFromMatrixColumn(t,0).length(),r=1/Wl.setFromMatrixColumn(t,1).length(),a=1/Wl.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*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,s=t.y,r=t.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(s),c=Math.sin(s),h=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const p=a*h,m=a*u,g=o*h,x=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=m+g*c,e[5]=p-x*c,e[9]=-o*l,e[2]=x-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,x=c*u;e[0]=p+x*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]=x+p*o,e[10]=a*l}else if(t.order==="ZXY"){const p=l*h,m=l*u,g=c*h,x=c*u;e[0]=p-x*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=x-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,x=o*u;e[0]=l*h,e[4]=g*c-m,e[8]=p*c+x,e[1]=l*u,e[5]=x*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,x=o*c;e[0]=l*h,e[4]=x-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-x*u}else if(t.order==="XZY"){const p=a*l,m=a*c,g=o*l,x=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=p*u+x,e[5]=a*h,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*h,e[10]=x*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(SO,t,EO)}lookAt(t,e,i){const s=this.elements;return Yi.subVectors(t,e),Yi.lengthSq()===0&&(Yi.z=1),Yi.normalize(),Ca.crossVectors(i,Yi),Ca.lengthSq()===0&&(Math.abs(i.z)===1?Yi.x+=1e-4:Yi.z+=1e-4,Yi.normalize(),Ca.crossVectors(i,Yi)),Ca.normalize(),np.crossVectors(Yi,Ca),s[0]=Ca.x,s[4]=np.x,s[8]=Yi.x,s[1]=Ca.y,s[5]=np.y,s[9]=Yi.y,s[2]=Ca.z,s[6]=np.z,s[10]=Yi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=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],x=i[6],y=i[10],_=i[14],b=i[3],S=i[7],w=i[11],R=i[15],T=s[0],C=s[4],L=s[8],P=s[12],E=s[1],D=s[5],z=s[9],G=s[13],W=s[2],Q=s[6],Y=s[10],ot=s[14],H=s[3],Z=s[7],it=s[11],$=s[15];return r[0]=a*T+o*E+l*W+c*H,r[4]=a*C+o*D+l*Q+c*Z,r[8]=a*L+o*z+l*Y+c*it,r[12]=a*P+o*G+l*ot+c*$,r[1]=h*T+u*E+p*W+m*H,r[5]=h*C+u*D+p*Q+m*Z,r[9]=h*L+u*z+p*Y+m*it,r[13]=h*P+u*G+p*ot+m*$,r[2]=g*T+x*E+y*W+_*H,r[6]=g*C+x*D+y*Q+_*Z,r[10]=g*L+x*z+y*Y+_*it,r[14]=g*P+x*G+y*ot+_*$,r[3]=b*T+S*E+w*W+R*H,r[7]=b*C+S*D+w*Q+R*Z,r[11]=b*L+S*z+w*Y+R*it,r[15]=b*P+S*G+w*ot+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],s=t[8],r=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],x=t[7],y=t[11],_=t[15];return g*(+r*l*u-s*c*u-r*o*p+i*c*p+s*o*m-i*l*m)+x*(+e*l*m-e*c*p+r*a*p-s*a*m+s*c*h-r*l*h)+y*(+e*c*u-e*o*m-r*a*u+i*a*m+r*o*h-i*c*h)+_*(-s*o*h-e*l*u+e*o*p+s*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 s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=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],x=t[13],y=t[14],_=t[15],b=u*y*c-x*p*c+x*l*m-o*y*m-u*l*_+o*p*_,S=g*p*c-h*y*c-g*l*m+a*y*m+h*l*_-a*p*_,w=h*x*c-g*u*c+g*o*m-a*x*m-h*o*_+a*u*_,R=g*u*l-h*x*l-g*o*p+a*x*p+h*o*y-a*u*y,T=e*b+i*S+s*w+r*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]=b*C,t[1]=(x*p*r-u*y*r-x*s*m+i*y*m+u*s*_-i*p*_)*C,t[2]=(o*y*r-x*l*r+x*s*c-i*y*c-o*s*_+i*l*_)*C,t[3]=(u*l*r-o*p*r-u*s*c+i*p*c+o*s*m-i*l*m)*C,t[4]=S*C,t[5]=(h*y*r-g*p*r+g*s*m-e*y*m-h*s*_+e*p*_)*C,t[6]=(g*l*r-a*y*r-g*s*c+e*y*c+a*s*_-e*l*_)*C,t[7]=(a*p*r-h*l*r+h*s*c-e*p*c-a*s*m+e*l*m)*C,t[8]=w*C,t[9]=(g*u*r-h*x*r-g*i*m+e*x*m+h*i*_-e*u*_)*C,t[10]=(a*x*r-g*o*r+g*i*c-e*x*c-a*i*_+e*o*_)*C,t[11]=(h*o*r-a*u*r-h*i*c+e*u*c+a*i*m-e*o*m)*C,t[12]=R*C,t[13]=(h*x*s-g*u*s+g*i*p-e*x*p-h*i*y+e*u*y)*C,t[14]=(g*o*s-a*x*s-g*i*l+e*x*l+a*i*y-e*o*y)*C,t[15]=(a*u*s-h*o*s+h*i*l-e*u*l-a*i*p+e*o*p)*C,this}scale(t){const e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){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],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}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),s=Math.sin(e),r=1-i,a=t.x,o=t.y,l=t.z,c=r*a,h=r*o;return this.set(c*a+i,c*o-s*l,c*l+s*o,0,c*o+s*l,h*o+i,h*l-s*a,0,c*l-s*o,h*l+s*a,r*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,s,r,a){return this.set(1,i,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){const s=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,h=a+a,u=o+o,p=r*c,m=r*h,g=r*u,x=a*h,y=a*u,_=o*u,b=l*c,S=l*h,w=l*u,R=i.x,T=i.y,C=i.z;return s[0]=(1-(x+_))*R,s[1]=(m+w)*R,s[2]=(g-S)*R,s[3]=0,s[4]=(m-w)*T,s[5]=(1-(p+_))*T,s[6]=(y+b)*T,s[7]=0,s[8]=(g+S)*C,s[9]=(y-b)*C,s[10]=(1-(p+x))*C,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){const s=this.elements;let r=Wl.set(s[0],s[1],s[2]).length();const a=Wl.set(s[4],s[5],s[6]).length(),o=Wl.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],Ns.copy(this);const c=1/r,h=1/a,u=1/o;return Ns.elements[0]*=c,Ns.elements[1]*=c,Ns.elements[2]*=c,Ns.elements[4]*=h,Ns.elements[5]*=h,Ns.elements[6]*=h,Ns.elements[8]*=u,Ns.elements[9]*=u,Ns.elements[10]*=u,e.setFromRotationMatrix(Ns),i.x=r,i.y=a,i.z=o,this}makePerspective(t,e,i,s,r,a,o=vr){const l=this.elements,c=2*r/(e-t),h=2*r/(i-s),u=(e+t)/(e-t),p=(i+s)/(i-s);let m,g;if(o===vr)m=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===Zu)m=-a/(a-r),g=-a*r/(a-r);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,s,r,a,o=vr){const l=this.elements,c=1/(e-t),h=1/(i-s),u=1/(a-r),p=(e+t)*c,m=(i+s)*h;let g,x;if(o===vr)g=(a+r)*u,x=-2*u;else if(o===Zu)g=r*u,x=-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]=x,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 s=0;s<16;s++)if(e[s]!==i[s])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 Wl=new O,Ns=new ye,SO=new O(0,0,0),EO=new O(1,1,1),Ca=new O,np=new O,Yi=new O,Iw=new ye,Lw=new Cn;let Ys=class nC{constructor(t=0,e=0,i=0,s=nC.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const s=t.elements,r=s[0],a=s[4],o=s[8],l=s[1],c=s[5],h=s[9],u=s[2],p=s[6],m=s[10];switch(e){case"XYZ":this._y=Math.asin(Se(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Se(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Se(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,r));break;case"ZYX":this._y=Math.asin(-Se(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Se(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-Se(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,r)):(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 Iw.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Iw,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Lw.setFromEuler(this),this.setFromQuaternion(Lw,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}};Ys.DEFAULT_ORDER="XYZ";let nl=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&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.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()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(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){s.children=[];for(let o=0;o0){s.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=s,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?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){Os.subVectors(s,e),Hr.subVectors(i,e),s_.subVectors(t,e);const a=Os.dot(Os),o=Os.dot(Hr),l=Os.dot(s_),c=Hr.dot(Hr),h=Hr.dot(s_),u=a*c-o*o;if(u===0)return r.set(0,0,0),null;const p=1/u,m=(c*l-o*h)*p,g=(a*h-o*l)*p;return r.set(1-m-g,g,m)}static containsPoint(t,e,i,s){return this.getBarycoord(t,e,i,s,Gr)===null?!1:Gr.x>=0&&Gr.y>=0&&Gr.x+Gr.y<=1}static getInterpolation(t,e,i,s,r,a,o,l){return this.getBarycoord(t,e,i,s,Gr)===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(r,Gr.x),l.addScaledVector(a,Gr.y),l.addScaledVector(o,Gr.z),l)}static getInterpolatedAttribute(t,e,i,s,r,a){return l_.setScalar(0),c_.setScalar(0),h_.setScalar(0),l_.fromBufferAttribute(t,e),c_.fromBufferAttribute(t,i),h_.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(l_,r.x),a.addScaledVector(c_,r.y),a.addScaledVector(h_,r.z),a}static isFrontFacing(t,e,i,s){return Os.subVectors(i,e),Hr.subVectors(t,e),Os.cross(Hr).dot(s)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Os.subVectors(this.c,this.b),Hr.subVectors(this.a,this.b),Os.cross(Hr).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return wc.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return wc.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return wc.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return wc.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return wc.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,s=this.b,r=this.c;let a,o;ql.subVectors(s,i),Yl.subVectors(r,i),r_.subVectors(t,i);const l=ql.dot(r_),c=Yl.dot(r_);if(l<=0&&c<=0)return e.copy(i);a_.subVectors(t,s);const h=ql.dot(a_),u=Yl.dot(a_);if(h>=0&&u<=h)return e.copy(s);const p=l*u-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(i).addScaledVector(ql,a);o_.subVectors(t,r);const m=ql.dot(o_),g=Yl.dot(o_);if(g>=0&&m<=g)return e.copy(r);const x=m*c-l*g;if(x<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(i).addScaledVector(Yl,o);const y=h*g-m*u;if(y<=0&&u-h>=0&&m-g>=0)return kw.subVectors(r,s),o=(u-h)/(u-h+(m-g)),e.copy(s).addScaledVector(kw,o);const _=1/(y+x+p);return a=x*_,o=p*_,e.copy(i).addScaledVector(ql,a).addScaledVector(Yl,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}};const iC={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},Ra={h:0,s:0,l:0},sp={h:0,s:0,l:0};function u_(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 kt=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 s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=fn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Ue.toWorkingColorSpace(this,e),this}setRGB(t,e,i,s=Ue.workingColorSpace){return this.r=t,this.g=e,this.b=i,Ue.toWorkingColorSpace(this,s),this}setHSL(t,e,i,s=Ue.workingColorSpace){if(t=c1(t,1),e=Se(e,0,1),i=Se(i,0,1),e===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,a=2*i-r;this.r=u_(a,r,t+1/3),this.g=u_(a,r,t),this.b=u_(a,r,t-1/3)}return Ue.toWorkingColorSpace(this,s),this}setStyle(t,e=fn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,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=fn){const i=iC[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=ra(t.r),this.g=ra(t.g),this.b=ra(t.b),this}copyLinearToSRGB(t){return this.r=Uc(t.r),this.g=Uc(t.g),this.b=Uc(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=fn){return Ue.fromWorkingColorSpace(oi.copy(this),t),Math.round(Se(oi.r*255,0,255))*65536+Math.round(Se(oi.g*255,0,255))*256+Math.round(Se(oi.b*255,0,255))}getHexString(t=fn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Ue.workingColorSpace){Ue.fromWorkingColorSpace(oi.copy(this),e);const i=oi.r,s=oi.g,r=oi.b,a=Math.max(i,s,r),o=Math.min(i,s,r);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=(s-r)/u+(s0!=t>0&&this.version++,this._alphaTest=t}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 s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){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!==Qo&&(i.blending=this.blending),this.side!==js&&(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!==Bm&&(i.blendSrc=this.blendSrc),this.blendDst!==Hm&&(i.blendDst=this.blendDst),this.blendEquation!==ka&&(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!==ol&&(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!==$x&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Uo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Uo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Uo&&(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 s(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=s(t.textures),a=s(t.images);r.length>0&&(i.textures=r),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 s=e.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=e[r].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.")}},ns=class extends Rn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new kt(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 Ys,this.combine=Ef,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 ea=IO();function IO(){const n=new ArrayBuffer(4),t=new Float32Array(n),e=new Uint32Array(n),i=new Uint32Array(512),s=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,s[l]=24,s[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,s[l]=-c-1,s[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,s[l]=13,s[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,s[l]=24,s[l|256]=24):(i[l]=31744,i[l|256]=64512,s[l]=13,s[l|256]=13)}const r=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,r[l]=c|h}for(let l=1024;l<2048;++l)r[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:s,mantissaTable:r,exponentTable:a,offsetTable:o}}function Ni(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Se(n,-65504,65504),ea.floatView[0]=n;const t=ea.uint32View[0],e=t>>23&511;return ea.baseTable[e]+((t&8388607)>>ea.shiftTable[e])}function fu(n){const t=n>>10;return ea.uint32View[0]=ea.mantissaTable[ea.offsetTable[t]+(n&1023)]+ea.exponentTable[t],ea.floatView[0]}const LO={toHalfFloat:Ni,fromHalfFloat:fu},An=new O,rp=new xt;let De=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=$u,this.updateRanges=[],this.gpuType=ki,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new pi);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new O(-1/0,-1/0,-1/0),new O(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,s=e.length;i0&&(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 s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,p=c.length;u0&&(s[l]=h,r=!0)}r&&(t.data.morphAttributes=s,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 s=t.attributes;for(const c in s){const h=s[c];this.setAttribute(c,h.clone(e))}const r=t.morphAttributes;for(const c in r){const h=[],u=r[c];for(let p=0,m=u.length;p0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(zw.copy(r).invert(),bo.copy(t.ray).applyMatrix4(zw),!(i.boundingBox!==null&&bo.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,bo)))}_computeIntersections(t,e,i){let s;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,p=r.groups,m=r.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,x=p.length;ge.far?null:{distance:c,point:up.clone(),object:n}}function fp(n,t,e,i,s,r,a,o,l,c){n.getVertexPosition(o,op),n.getVertexPosition(l,lp),n.getVertexPosition(c,cp);const h=BO(n,t,e,i,op,lp,cp,Hw);if(h){const u=new O;ta.getBarycoord(Hw,op,lp,cp,u),s&&(h.uv=ta.getInterpolatedAttribute(s,o,l,c,u,new xt)),r&&(h.uv1=ta.getInterpolatedAttribute(r,o,l,c,u,new xt)),a&&(h.normal=ta.getInterpolatedAttribute(a,o,l,c,u,new O),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const p={a:o,b:l,c,normal:new O,materialIndex:0};ta.getNormal(op,lp,cp,p.normal),h.face=p,h.barycoord=u}return h}class io extends ve{constructor(t=1,e=1,i=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:r,depthSegments:a};const o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],u=[];let p=0,m=0;g("z","y","x",-1,-1,i,e,t,a,r,0),g("z","y","x",1,-1,i,e,-t,a,r,1),g("x","z","y",1,1,t,i,e,s,a,2),g("x","z","y",1,-1,t,i,-e,s,a,3),g("x","y","z",1,-1,t,e,i,s,r,4),g("x","y","z",-1,-1,t,e,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new re(c,3)),this.setAttribute("normal",new re(h,3)),this.setAttribute("uv",new re(u,2));function g(x,y,_,b,S,w,R,T,C,L,P){const E=w/C,D=R/L,z=w/2,G=R/2,W=T/2,Q=C+1,Y=L+1;let ot=0,H=0;const Z=new O;for(let it=0;it0?1:-1,h.push(Z.x,Z.y,Z.z),u.push(lt/C),u.push(1-it/L),ot+=1}}for(let it=0;it>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 Se(n,t,e){return Math.max(t,Math.min(e,n))}function c1(n,t){return(n%t+t)%t}function tO(n,t,e,i,s){return i+(n-t)*(s-i)/(e-t)}function eO(n,t,e){return n!==t?(e-n)/(t-n):0}function Ru(n,t,e){return(1-e)*n+e*t}function nO(n,t,e,i){return Ru(n,t,1-Math.exp(-e*i))}function iO(n,t=1){return t-Math.abs(c1(n,t*2)-t)}function sO(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function rO(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function aO(n,t){return n+Math.floor(Math.random()*(t-n+1))}function oO(n,t){return n+Math.random()*(t-n)}function lO(n){return n*(.5-Math.random())}function cO(n){n!==void 0&&(Aw=n);let t=Aw+=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 hO(n){return n*el}function uO(n){return n*Jc}function fO(n){return(n&n-1)===0&&n!==0}function dO(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function pO(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function mO(n,t,e,i,s){const r=Math.cos,a=Math.sin,o=r(e/2),l=a(e/2),c=r((t+i)/2),h=a((t+i)/2),u=r((t-i)/2),p=a((t-i)/2),m=r((i-t)/2),g=a((i-t)/2);switch(s){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: "+s)}}function Mi(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 Ce(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 h1={DEG2RAD:el,RAD2DEG:Jc,generateUUID:ss,clamp:Se,euclideanModulo:c1,mapLinear:tO,inverseLerp:eO,lerp:Ru,damp:nO,pingpong:iO,smoothstep:sO,smootherstep:rO,randInt:aO,randFloat:oO,randFloatSpread:lO,seededRandom:cO,degToRad:hO,radToDeg:uO,isPowerOfTwo:fO,ceilPowerOfTwo:dO,floorPowerOfTwo:pO,setQuaternionFromProperEuler:mO,normalize:Ce,denormalize:Mi};let xt=class $2{constructor(t=0,e=0){$2.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,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Se(this.x,t.x,e.x),this.y=Se(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=Se(this.x,t,e),this.y=Se(this.y,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Se(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Se(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),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*s+t.x,this.y=r*s+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Te=class Z2{constructor(t,e,i,s,r,a,o,l,c){Z2.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,a,o,l,c)}set(t,e,i,s,r,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,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,s=e.elements,r=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],x=s[0],y=s[3],_=s[6],b=s[1],S=s[4],w=s[7],R=s[2],T=s[5],C=s[8];return r[0]=a*x+o*b+l*R,r[3]=a*y+o*S+l*T,r[6]=a*_+o*w+l*C,r[1]=c*x+h*b+u*R,r[4]=c*y+h*S+u*T,r[7]=c*_+h*w+u*C,r[2]=p*x+m*b+g*R,r[5]=p*y+m*S+g*T,r[8]=p*_+m*w+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],s=t[2],r=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*r*h+i*o*l+s*r*c-s*a*l}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=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*r,m=c*r-a*l,g=e*u+i*p+s*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/g;return t[0]=u*x,t[1]=(s*c-h*i)*x,t[2]=(o*i-s*a)*x,t[3]=p*x,t[4]=(h*e-s*l)*x,t[5]=(s*r-o*e)*x,t[6]=m*x,t[7]=(i*l-c*e)*x,t[8]=(a*e-i*r)*x,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,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*a+c*o)+a+t,-s*c,s*l,-s*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply($y.makeScale(t,e)),this}rotate(t){return this.premultiply($y.makeRotation(-t)),this}translate(t,e){return this.premultiply($y.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 s=0;s<9;s++)if(e[s]!==i[s])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 $y=new Te;function K2(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}const gO={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Tc(n,t){return new gO[n](t)}function Ku(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function J2(){const n=Ku("canvas");return n.style.display="block",n}const Tw={};function bc(n){n in Tw||(Tw[n]=!0,console.warn(n))}function yO(n,t,e){return new Promise(function(i,s){function r(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:s();break;case n.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:i()}}setTimeout(r,e)})}function _O(n){const t=n.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function xO(n){const t=n.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const Cw=new Te().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Rw=new Te().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function vO(){const n={enabled:!0,workingColorSpace:$n,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Je&&(s.r=ra(s.r),s.g=ra(s.g),s.b=ra(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Je&&(s.r=Uc(s.r),s.g=Uc(s.g),s.b=Uc(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Qr?Yu:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[$n]:{primaries:t,whitePoint:i,transfer:Yu,toXYZ:Cw,fromXYZ:Rw,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:fn},outputColorSpaceConfig:{drawingBufferColorSpace:fn}},[fn]:{primaries:t,whitePoint:i,transfer:Je,toXYZ:Cw,fromXYZ:Rw,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:fn}}}),n}const Ue=vO();function ra(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Uc(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Bl,Q2=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{Bl===void 0&&(Bl=Ku("canvas")),Bl.width=t.width,Bl.height=t.height;const i=Bl.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Bl}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=Ku("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const s=i.getImageData(0,0,t.width,t.height),r=s.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!==X0)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case $a:t.x=t.x-Math.floor(t.x);break;case es:t.x=t.x<0?0:1;break;case Yc: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 $a:t.y=t.y-Math.floor(t.y);break;case es:t.y=t.y<0?0:1;break;case Yc: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++}};bn.DEFAULT_IMAGE=null;bn.DEFAULT_MAPPING=X0;bn.DEFAULT_ANISOTROPY=1;class Ge{constructor(t=0,e=0,i=0,s=1){Ge.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,s){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw 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,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*i+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*i+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*i+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);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,s,r;const l=t.elements,c=l[0],h=l[4],u=l[8],p=l[1],m=l[5],g=l[9],x=l[2],y=l[6],_=l[10];if(Math.abs(h-p)<.01&&Math.abs(u-x)<.01&&Math.abs(g-y)<.01){if(Math.abs(h+p)<.1&&Math.abs(u+x)<.1&&Math.abs(g+y)<.1&&Math.abs(c+m+_-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const S=(c+1)/2,w=(m+1)/2,R=(_+1)/2,T=(h+p)/4,C=(u+x)/4,L=(g+y)/4;return S>w&&S>R?S<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(S),s=T/i,r=C/i):w>R?w<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(w),i=T/s,r=L/s):R<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(R),i=C/r,s=L/r),this.set(i,s,r,e),this}let b=Math.sqrt((y-g)*(y-g)+(u-x)*(u-x)+(p-h)*(p-h));return Math.abs(b)<.001&&(b=1),this.x=(y-g)/b,this.y=(u-x)/b,this.z=(p-h)/b,this.w=Math.acos((c+m+_-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=Se(this.x,t.x,e.x),this.y=Se(this.y,t.y,e.y),this.z=Se(this.z,t.z,e.z),this.w=Se(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=Se(this.x,t,e),this.y=Se(this.y,t,e),this.z=Se(this.z,t,e),this.w=Se(this.w,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Se(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class tC extends Zs{constructor(t=1,e=1,i={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Ge(0,0,t,e),this.scissorTest=!1,this.viewport=new Ge(0,0,t,e);const s={width:t,height:e,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:yn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const r=new bn(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);r.flipY=!1,r.generateMipmaps=i.generateMipmaps,r.internalFormat=i.internalFormat,this.textures=[];const a=i.count;for(let o=0;o=0?1:-1,S=1-_*_;if(S>Number.EPSILON){const R=Math.sqrt(S),T=Math.atan2(R,_*b);y=Math.sin(y*T)/R,o=Math.sin(o*T)/R}const w=o*b;if(l=l*y+p*w,c=c*y+m*w,h=h*y+g*w,u=u*y+x*w,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,s,r,a){const o=i[s],l=i[s+1],c=i[s+2],h=i[s+3],u=r[a],p=r[a+1],m=r[a+2],g=r[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,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(s/2),u=o(r/2),p=l(i/2),m=l(s/2),g=l(r/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,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],s=e[4],r=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=(r-c)*m,this._z=(a-s)*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=(s+a)/m,this._z=(r+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-i-u);this._w=(r-c)/m,this._x=(s+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+u-i-o);this._w=(a-s)/m,this._x=(r+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(Se(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const s=Math.min(1,e/i);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 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,s=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+s*c-r*l,this._y=s*h+a*l+r*o-i*c,this._z=r*h+a*c+i*l-s*o,this._w=a*h-i*o-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,s=this._y,r=this._z,a=this._w;let o=a*t._w+i*t._x+s*t._y+r*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=s,this._z=r,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*s+e*this._y,this._z=m*r+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=s*u+this._y*p,this._z=r*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(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},O=class eC{constructor(t=0,e=0,i=0){eC.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(Pw.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Pw.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,s=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*s-o*i),h=2*(o*e-r*s),u=2*(r*i-a*e);return this.x=e+l*c+a*u-o*h,this.y=i+l*h+o*c-r*u,this.z=s+l*u+r*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,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Se(this.x,t.x,e.x),this.y=Se(this.y,t.y,e.y),this.z=Se(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=Se(this.x,t,e),this.y=Se(this.y,t,e),this.z=Se(this.z,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Se(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,s=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=s*l-r*o,this.y=r*a-i*l,this.z=i*o-s*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 Ky.copy(this).projectOnVector(t),this.sub(Ky)}reflect(t){return this.sub(Ky.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(Se(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){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(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,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 Ky=new O,Pw=new Cn;let pi=class{constructor(t=new O(1/0,1/0,1/0),e=new O(-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,Ds),Ds.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(Vh),Jd.subVectors(this.max,Vh),Hl.subVectors(t.a,Vh),Gl.subVectors(t.b,Vh),Vl.subVectors(t.c,Vh),Ea.subVectors(Gl,Hl),Aa.subVectors(Vl,Gl),vo.subVectors(Hl,Vl);let e=[0,-Ea.z,Ea.y,0,-Aa.z,Aa.y,0,-vo.z,vo.y,Ea.z,0,-Ea.x,Aa.z,0,-Aa.x,vo.z,0,-vo.x,-Ea.y,Ea.x,0,-Aa.y,Aa.x,0,-vo.y,vo.x,0];return!Jy(e,Hl,Gl,Vl,Jd)||(e=[1,0,0,0,1,0,0,0,1],!Jy(e,Hl,Gl,Vl,Jd))?!1:(Qd.crossVectors(Ea,Aa),e=[Qd.x,Qd.y,Qd.z],Jy(e,Hl,Gl,Vl,Jd))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ds).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Ds).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:(kr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),kr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),kr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),kr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),kr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),kr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),kr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),kr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(kr),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 kr=[new O,new O,new O,new O,new O,new O,new O,new O],Ds=new O,Kd=new pi,Hl=new O,Gl=new O,Vl=new O,Ea=new O,Aa=new O,vo=new O,Vh=new O,Jd=new O,Qd=new O,Mo=new O;function Jy(n,t,e,i,s){for(let r=0,a=n.length-3;r<=a;r+=3){Mo.fromArray(n,r);const o=s.x*Math.abs(Mo.x)+s.y*Math.abs(Mo.y)+s.z*Math.abs(Mo.z),l=t.dot(Mo),c=e.dot(Mo),h=i.dot(Mo);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const EO=new pi,Wh=new O,Qy=new O;let Yn=class{constructor(t=new O,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):EO.setFromPoints(t).getCenter(i);let s=0;for(let r=0,a=t.length;rthis.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;Wh.subVectors(t,this.center);const e=Wh.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),s=(i-this.radius)*.5;this.center.addScaledVector(Wh,s/i),this.radius+=s}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):(Qy.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Wh.copy(t.center).add(Qy)),this.expandByPoint(Wh.copy(t.center).sub(Qy))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}};const zr=new O,t_=new O,tp=new O,Ta=new O,e_=new O,ep=new O,n_=new O;let no=class{constructor(t=new O,e=new O(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,zr)),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=zr.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(zr.copy(this.origin).addScaledVector(this.direction,e),zr.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){t_.copy(t).add(e).multiplyScalar(.5),tp.copy(e).sub(t).normalize(),Ta.copy(this.origin).sub(t_);const r=t.distanceTo(e)*.5,a=-this.direction.dot(tp),o=Ta.dot(this.direction),l=-Ta.dot(tp),c=Ta.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=r*h,u>=0)if(p>=-g)if(p<=g){const x=1/h;u*=x,p*=x,m=u*(u+a*p+2*o)+p*(a*u+p+2*l)+c}else p=r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p=-r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p<=-g?(u=Math.max(0,-(-a*r+o)),p=u>0?-r:Math.min(Math.max(-r,-l),r),m=-u*u+p*(p+2*l)+c):p<=g?(u=0,p=Math.min(Math.max(-r,-l),r),m=p*(p+2*l)+c):(u=Math.max(0,-(a*r+o)),p=u>0?r:Math.min(Math.max(-r,-l),r),m=-u*u+p*(p+2*l)+c);else p=a>0?-r:r,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),s&&s.copy(t_).addScaledVector(tp,p),m}intersectSphere(t,e){zr.subVectors(t.center,this.origin);const i=zr.dot(this.direction),s=zr.dot(zr)-i*i,r=t.radius*t.radius;if(s>r)return null;const a=Math.sqrt(r-s),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,s,r,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,s=(t.max.x-p.x)*c):(i=(t.max.x-p.x)*c,s=(t.min.x-p.x)*c),h>=0?(r=(t.min.y-p.y)*h,a=(t.max.y-p.y)*h):(r=(t.max.y-p.y)*h,a=(t.min.y-p.y)*h),i>a||r>s||((r>i||isNaN(i))&&(i=r),(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>s)||((o>i||i!==i)&&(i=o),(l=0?i:s,e)}intersectsBox(t){return this.intersectBox(t,zr)!==null}intersectTriangle(t,e,i,s,r){e_.subVectors(e,t),ep.subVectors(i,t),n_.crossVectors(e_,ep);let a=this.direction.dot(n_),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ta.subVectors(this.origin,t);const l=o*this.direction.dot(ep.crossVectors(Ta,ep));if(l<0)return null;const c=o*this.direction.dot(e_.cross(Ta));if(c<0||l+c>a)return null;const h=-o*Ta.dot(n_);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},ye=class Kx{constructor(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y){Kx.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,s,r,a,o,l,c,h,u,p,m,g,x,y)}set(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y){const _=this.elements;return _[0]=t,_[4]=e,_[8]=i,_[12]=s,_[1]=r,_[5]=a,_[9]=o,_[13]=l,_[2]=c,_[6]=h,_[10]=u,_[14]=p,_[3]=m,_[7]=g,_[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 Kx().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,s=1/Wl.setFromMatrixColumn(t,0).length(),r=1/Wl.setFromMatrixColumn(t,1).length(),a=1/Wl.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*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,s=t.y,r=t.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(s),c=Math.sin(s),h=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const p=a*h,m=a*u,g=o*h,x=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=m+g*c,e[5]=p-x*c,e[9]=-o*l,e[2]=x-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,x=c*u;e[0]=p+x*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]=x+p*o,e[10]=a*l}else if(t.order==="ZXY"){const p=l*h,m=l*u,g=c*h,x=c*u;e[0]=p-x*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=x-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,x=o*u;e[0]=l*h,e[4]=g*c-m,e[8]=p*c+x,e[1]=l*u,e[5]=x*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,x=o*c;e[0]=l*h,e[4]=x-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-x*u}else if(t.order==="XZY"){const p=a*l,m=a*c,g=o*l,x=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=p*u+x,e[5]=a*h,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*h,e[10]=x*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(AO,t,TO)}lookAt(t,e,i){const s=this.elements;return Yi.subVectors(t,e),Yi.lengthSq()===0&&(Yi.z=1),Yi.normalize(),Ca.crossVectors(i,Yi),Ca.lengthSq()===0&&(Math.abs(i.z)===1?Yi.x+=1e-4:Yi.z+=1e-4,Yi.normalize(),Ca.crossVectors(i,Yi)),Ca.normalize(),np.crossVectors(Yi,Ca),s[0]=Ca.x,s[4]=np.x,s[8]=Yi.x,s[1]=Ca.y,s[5]=np.y,s[9]=Yi.y,s[2]=Ca.z,s[6]=np.z,s[10]=Yi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=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],x=i[6],y=i[10],_=i[14],b=i[3],S=i[7],w=i[11],R=i[15],T=s[0],C=s[4],L=s[8],P=s[12],E=s[1],D=s[5],z=s[9],G=s[13],W=s[2],Q=s[6],Y=s[10],ot=s[14],H=s[3],Z=s[7],it=s[11],$=s[15];return r[0]=a*T+o*E+l*W+c*H,r[4]=a*C+o*D+l*Q+c*Z,r[8]=a*L+o*z+l*Y+c*it,r[12]=a*P+o*G+l*ot+c*$,r[1]=h*T+u*E+p*W+m*H,r[5]=h*C+u*D+p*Q+m*Z,r[9]=h*L+u*z+p*Y+m*it,r[13]=h*P+u*G+p*ot+m*$,r[2]=g*T+x*E+y*W+_*H,r[6]=g*C+x*D+y*Q+_*Z,r[10]=g*L+x*z+y*Y+_*it,r[14]=g*P+x*G+y*ot+_*$,r[3]=b*T+S*E+w*W+R*H,r[7]=b*C+S*D+w*Q+R*Z,r[11]=b*L+S*z+w*Y+R*it,r[15]=b*P+S*G+w*ot+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],s=t[8],r=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],x=t[7],y=t[11],_=t[15];return g*(+r*l*u-s*c*u-r*o*p+i*c*p+s*o*m-i*l*m)+x*(+e*l*m-e*c*p+r*a*p-s*a*m+s*c*h-r*l*h)+y*(+e*c*u-e*o*m-r*a*u+i*a*m+r*o*h-i*c*h)+_*(-s*o*h-e*l*u+e*o*p+s*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 s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=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],x=t[13],y=t[14],_=t[15],b=u*y*c-x*p*c+x*l*m-o*y*m-u*l*_+o*p*_,S=g*p*c-h*y*c-g*l*m+a*y*m+h*l*_-a*p*_,w=h*x*c-g*u*c+g*o*m-a*x*m-h*o*_+a*u*_,R=g*u*l-h*x*l-g*o*p+a*x*p+h*o*y-a*u*y,T=e*b+i*S+s*w+r*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]=b*C,t[1]=(x*p*r-u*y*r-x*s*m+i*y*m+u*s*_-i*p*_)*C,t[2]=(o*y*r-x*l*r+x*s*c-i*y*c-o*s*_+i*l*_)*C,t[3]=(u*l*r-o*p*r-u*s*c+i*p*c+o*s*m-i*l*m)*C,t[4]=S*C,t[5]=(h*y*r-g*p*r+g*s*m-e*y*m-h*s*_+e*p*_)*C,t[6]=(g*l*r-a*y*r-g*s*c+e*y*c+a*s*_-e*l*_)*C,t[7]=(a*p*r-h*l*r+h*s*c-e*p*c-a*s*m+e*l*m)*C,t[8]=w*C,t[9]=(g*u*r-h*x*r-g*i*m+e*x*m+h*i*_-e*u*_)*C,t[10]=(a*x*r-g*o*r+g*i*c-e*x*c-a*i*_+e*o*_)*C,t[11]=(h*o*r-a*u*r-h*i*c+e*u*c+a*i*m-e*o*m)*C,t[12]=R*C,t[13]=(h*x*s-g*u*s+g*i*p-e*x*p-h*i*y+e*u*y)*C,t[14]=(g*o*s-a*x*s-g*i*l+e*x*l+a*i*y-e*o*y)*C,t[15]=(a*u*s-h*o*s+h*i*l-e*u*l-a*i*p+e*o*p)*C,this}scale(t){const e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){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],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}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),s=Math.sin(e),r=1-i,a=t.x,o=t.y,l=t.z,c=r*a,h=r*o;return this.set(c*a+i,c*o-s*l,c*l+s*o,0,c*o+s*l,h*o+i,h*l-s*a,0,c*l-s*o,h*l+s*a,r*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,s,r,a){return this.set(1,i,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){const s=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,h=a+a,u=o+o,p=r*c,m=r*h,g=r*u,x=a*h,y=a*u,_=o*u,b=l*c,S=l*h,w=l*u,R=i.x,T=i.y,C=i.z;return s[0]=(1-(x+_))*R,s[1]=(m+w)*R,s[2]=(g-S)*R,s[3]=0,s[4]=(m-w)*T,s[5]=(1-(p+_))*T,s[6]=(y+b)*T,s[7]=0,s[8]=(g+S)*C,s[9]=(y-b)*C,s[10]=(1-(p+x))*C,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){const s=this.elements;let r=Wl.set(s[0],s[1],s[2]).length();const a=Wl.set(s[4],s[5],s[6]).length(),o=Wl.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],Ns.copy(this);const c=1/r,h=1/a,u=1/o;return Ns.elements[0]*=c,Ns.elements[1]*=c,Ns.elements[2]*=c,Ns.elements[4]*=h,Ns.elements[5]*=h,Ns.elements[6]*=h,Ns.elements[8]*=u,Ns.elements[9]*=u,Ns.elements[10]*=u,e.setFromRotationMatrix(Ns),i.x=r,i.y=a,i.z=o,this}makePerspective(t,e,i,s,r,a,o=vr){const l=this.elements,c=2*r/(e-t),h=2*r/(i-s),u=(e+t)/(e-t),p=(i+s)/(i-s);let m,g;if(o===vr)m=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===Zu)m=-a/(a-r),g=-a*r/(a-r);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,s,r,a,o=vr){const l=this.elements,c=1/(e-t),h=1/(i-s),u=1/(a-r),p=(e+t)*c,m=(i+s)*h;let g,x;if(o===vr)g=(a+r)*u,x=-2*u;else if(o===Zu)g=r*u,x=-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]=x,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 s=0;s<16;s++)if(e[s]!==i[s])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 Wl=new O,Ns=new ye,AO=new O(0,0,0),TO=new O(1,1,1),Ca=new O,np=new O,Yi=new O,Iw=new ye,Lw=new Cn;let Ys=class nC{constructor(t=0,e=0,i=0,s=nC.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const s=t.elements,r=s[0],a=s[4],o=s[8],l=s[1],c=s[5],h=s[9],u=s[2],p=s[6],m=s[10];switch(e){case"XYZ":this._y=Math.asin(Se(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Se(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Se(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,r));break;case"ZYX":this._y=Math.asin(-Se(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Se(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-Se(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,r)):(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 Iw.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Iw,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Lw.setFromEuler(this),this.setFromQuaternion(Lw,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}};Ys.DEFAULT_ORDER="XYZ";let nl=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&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.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()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(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){s.children=[];for(let o=0;o0){s.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=s,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?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){Os.subVectors(s,e),Hr.subVectors(i,e),s_.subVectors(t,e);const a=Os.dot(Os),o=Os.dot(Hr),l=Os.dot(s_),c=Hr.dot(Hr),h=Hr.dot(s_),u=a*c-o*o;if(u===0)return r.set(0,0,0),null;const p=1/u,m=(c*l-o*h)*p,g=(a*h-o*l)*p;return r.set(1-m-g,g,m)}static containsPoint(t,e,i,s){return this.getBarycoord(t,e,i,s,Gr)===null?!1:Gr.x>=0&&Gr.y>=0&&Gr.x+Gr.y<=1}static getInterpolation(t,e,i,s,r,a,o,l){return this.getBarycoord(t,e,i,s,Gr)===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(r,Gr.x),l.addScaledVector(a,Gr.y),l.addScaledVector(o,Gr.z),l)}static getInterpolatedAttribute(t,e,i,s,r,a){return l_.setScalar(0),c_.setScalar(0),h_.setScalar(0),l_.fromBufferAttribute(t,e),c_.fromBufferAttribute(t,i),h_.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(l_,r.x),a.addScaledVector(c_,r.y),a.addScaledVector(h_,r.z),a}static isFrontFacing(t,e,i,s){return Os.subVectors(i,e),Hr.subVectors(t,e),Os.cross(Hr).dot(s)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Os.subVectors(this.c,this.b),Hr.subVectors(this.a,this.b),Os.cross(Hr).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return wc.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return wc.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return wc.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return wc.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return wc.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,s=this.b,r=this.c;let a,o;ql.subVectors(s,i),Yl.subVectors(r,i),r_.subVectors(t,i);const l=ql.dot(r_),c=Yl.dot(r_);if(l<=0&&c<=0)return e.copy(i);a_.subVectors(t,s);const h=ql.dot(a_),u=Yl.dot(a_);if(h>=0&&u<=h)return e.copy(s);const p=l*u-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(i).addScaledVector(ql,a);o_.subVectors(t,r);const m=ql.dot(o_),g=Yl.dot(o_);if(g>=0&&m<=g)return e.copy(r);const x=m*c-l*g;if(x<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(i).addScaledVector(Yl,o);const y=h*g-m*u;if(y<=0&&u-h>=0&&m-g>=0)return kw.subVectors(r,s),o=(u-h)/(u-h+(m-g)),e.copy(s).addScaledVector(kw,o);const _=1/(y+x+p);return a=x*_,o=p*_,e.copy(i).addScaledVector(ql,a).addScaledVector(Yl,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}};const iC={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},Ra={h:0,s:0,l:0},sp={h:0,s:0,l:0};function u_(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 kt=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 s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=fn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Ue.toWorkingColorSpace(this,e),this}setRGB(t,e,i,s=Ue.workingColorSpace){return this.r=t,this.g=e,this.b=i,Ue.toWorkingColorSpace(this,s),this}setHSL(t,e,i,s=Ue.workingColorSpace){if(t=c1(t,1),e=Se(e,0,1),i=Se(i,0,1),e===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,a=2*i-r;this.r=u_(a,r,t+1/3),this.g=u_(a,r,t),this.b=u_(a,r,t-1/3)}return Ue.toWorkingColorSpace(this,s),this}setStyle(t,e=fn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,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=fn){const i=iC[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=ra(t.r),this.g=ra(t.g),this.b=ra(t.b),this}copyLinearToSRGB(t){return this.r=Uc(t.r),this.g=Uc(t.g),this.b=Uc(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=fn){return Ue.fromWorkingColorSpace(oi.copy(this),t),Math.round(Se(oi.r*255,0,255))*65536+Math.round(Se(oi.g*255,0,255))*256+Math.round(Se(oi.b*255,0,255))}getHexString(t=fn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Ue.workingColorSpace){Ue.fromWorkingColorSpace(oi.copy(this),e);const i=oi.r,s=oi.g,r=oi.b,a=Math.max(i,s,r),o=Math.min(i,s,r);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=(s-r)/u+(s0!=t>0&&this.version++,this._alphaTest=t}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 s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){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!==Qo&&(i.blending=this.blending),this.side!==js&&(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!==Bm&&(i.blendSrc=this.blendSrc),this.blendDst!==Hm&&(i.blendDst=this.blendDst),this.blendEquation!==ka&&(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!==ol&&(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!==$x&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Uo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Uo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Uo&&(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 s(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=s(t.textures),a=s(t.images);r.length>0&&(i.textures=r),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 s=e.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=e[r].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.")}},ns=class extends Rn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new kt(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 Ys,this.combine=Ef,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 ea=DO();function DO(){const n=new ArrayBuffer(4),t=new Float32Array(n),e=new Uint32Array(n),i=new Uint32Array(512),s=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,s[l]=24,s[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,s[l]=-c-1,s[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,s[l]=13,s[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,s[l]=24,s[l|256]=24):(i[l]=31744,i[l|256]=64512,s[l]=13,s[l|256]=13)}const r=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,r[l]=c|h}for(let l=1024;l<2048;++l)r[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:s,mantissaTable:r,exponentTable:a,offsetTable:o}}function Ni(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Se(n,-65504,65504),ea.floatView[0]=n;const t=ea.uint32View[0],e=t>>23&511;return ea.baseTable[e]+((t&8388607)>>ea.shiftTable[e])}function fu(n){const t=n>>10;return ea.uint32View[0]=ea.mantissaTable[ea.offsetTable[t]+(n&1023)]+ea.exponentTable[t],ea.floatView[0]}const NO={toHalfFloat:Ni,fromHalfFloat:fu},An=new O,rp=new xt;let De=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=$u,this.updateRanges=[],this.gpuType=ki,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new pi);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new O(-1/0,-1/0,-1/0),new O(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,s=e.length;i0&&(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 s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,p=c.length;u0&&(s[l]=h,r=!0)}r&&(t.data.morphAttributes=s,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 s=t.attributes;for(const c in s){const h=s[c];this.setAttribute(c,h.clone(e))}const r=t.morphAttributes;for(const c in r){const h=[],u=r[c];for(let p=0,m=u.length;p0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(zw.copy(r).invert(),bo.copy(t.ray).applyMatrix4(zw),!(i.boundingBox!==null&&bo.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,bo)))}_computeIntersections(t,e,i){let s;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,p=r.groups,m=r.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,x=p.length;ge.far?null:{distance:c,point:up.clone(),object:n}}function fp(n,t,e,i,s,r,a,o,l,c){n.getVertexPosition(o,op),n.getVertexPosition(l,lp),n.getVertexPosition(c,cp);const h=GO(n,t,e,i,op,lp,cp,Hw);if(h){const u=new O;ta.getBarycoord(Hw,op,lp,cp,u),s&&(h.uv=ta.getInterpolatedAttribute(s,o,l,c,u,new xt)),r&&(h.uv1=ta.getInterpolatedAttribute(r,o,l,c,u,new xt)),a&&(h.normal=ta.getInterpolatedAttribute(a,o,l,c,u,new O),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const p={a:o,b:l,c,normal:new O,materialIndex:0};ta.getNormal(op,lp,cp,p.normal),h.face=p,h.barycoord=u}return h}class io extends ve{constructor(t=1,e=1,i=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:r,depthSegments:a};const o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],u=[];let p=0,m=0;g("z","y","x",-1,-1,i,e,t,a,r,0),g("z","y","x",1,-1,i,e,-t,a,r,1),g("x","z","y",1,1,t,i,e,s,a,2),g("x","z","y",1,-1,t,i,-e,s,a,3),g("x","y","z",1,-1,t,e,i,s,r,4),g("x","y","z",-1,-1,t,e,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new re(c,3)),this.setAttribute("normal",new re(h,3)),this.setAttribute("uv",new re(u,2));function g(x,y,_,b,S,w,R,T,C,L,P){const E=w/C,D=R/L,z=w/2,G=R/2,W=T/2,Q=C+1,Y=L+1;let ot=0,H=0;const Z=new O;for(let it=0;it0?1:-1,h.push(Z.x,Z.y,Z.z),u.push(lt/C),u.push(1-it/L),ot+=1}}for(let it=0;it0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class Tf extends qe{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ye,this.projectionMatrix=new ye,this.projectionMatrixInverse=new ye,this.coordinateSystem=vr}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Pa=new O,Gw=new xt,Vw=new xt;class gn extends Tf{constructor(t=50,e=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=Jc*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(el*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Jc*2*Math.atan(Math.tan(el*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,i){Pa.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Pa.x,Pa.y).multiplyScalar(-t/Pa.z),Pa.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Pa.x,Pa.y).multiplyScalar(-t/Pa.z)}getViewSize(t,e){return this.getViewBounds(t,Gw,Vw),e.subVectors(Vw,Gw)}setViewOffset(t,e,i,s,r,a){this.aspect=t/e,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=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(el*.5*this.fov)/this.zoom,i=2*e,s=this.aspect*i,r=-.5*s;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*s/l,e-=a.offsetY*i/c,s*=a.width/l,i*=a.height/c}const o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-i,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Zl=-90,Kl=1;class oC extends qe{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new gn(Zl,Kl,t,e);s.layers=this.layers,this.add(s);const r=new gn(Zl,Kl,t,e);r.layers=this.layers,this.add(r);const a=new gn(Zl,Kl,t,e);a.layers=this.layers,this.add(a);const o=new gn(Zl,Kl,t,e);o.layers=this.layers,this.add(o);const l=new gn(Zl,Kl,t,e);l.layers=this.layers,this.add(l);const c=new gn(Zl,Kl,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[i,s,r,a,o,l]=e;for(const c of e)this.remove(c);if(t===vr)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===Zu)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,h]=this.children,u=t.getRenderTarget(),p=t.getActiveCubeFace(),m=t.getActiveMipmapLevel(),g=t.xr.enabled;t.xr.enabled=!1;const x=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0,s),t.render(e,r),t.setRenderTarget(i,1,s),t.render(e,a),t.setRenderTarget(i,2,s),t.render(e,o),t.setRenderTarget(i,3,s),t.render(e,l),t.setRenderTarget(i,4,s),t.render(e,c),i.texture.generateMipmaps=x,t.setRenderTarget(i,5,s),t.render(e,h),t.setRenderTarget(u,p,m),t.xr.enabled=g,i.texture.needsPMREMUpdate=!0}}class Cf extends bn{constructor(t,e,i,s,r,a,o,l,c,h){t=t!==void 0?t:[],e=e!==void 0?e:ua,super(t,e,i,s,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class lC extends qs{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},s=[i,i,i,i,i,i];this.texture=new Cf(s,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:yn}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class $s extends Rn{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=WO,this.fragmentShader=jO,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Qc(t.uniforms),this.uniformsGroups=VO(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const s in this.uniforms){const a=this.uniforms[s].value;a&&a.isTexture?e.uniforms[s]={type:"t",value:a.toJSON(t).uuid}:a&&a.isColor?e.uniforms[s]={type:"c",value:a.getHex()}:a&&a.isVector2?e.uniforms[s]={type:"v2",value:a.toArray()}:a&&a.isVector3?e.uniforms[s]={type:"v3",value:a.toArray()}:a&&a.isVector4?e.uniforms[s]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?e.uniforms[s]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?e.uniforms[s]={type:"m4",value:a.toArray()}:e.uniforms[s]={value:a}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class Tf extends qe{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ye,this.projectionMatrix=new ye,this.projectionMatrixInverse=new ye,this.coordinateSystem=vr}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Pa=new O,Gw=new xt,Vw=new xt;class gn extends Tf{constructor(t=50,e=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=Jc*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(el*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Jc*2*Math.atan(Math.tan(el*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,i){Pa.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Pa.x,Pa.y).multiplyScalar(-t/Pa.z),Pa.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Pa.x,Pa.y).multiplyScalar(-t/Pa.z)}getViewSize(t,e){return this.getViewBounds(t,Gw,Vw),e.subVectors(Vw,Gw)}setViewOffset(t,e,i,s,r,a){this.aspect=t/e,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=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(el*.5*this.fov)/this.zoom,i=2*e,s=this.aspect*i,r=-.5*s;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*s/l,e-=a.offsetY*i/c,s*=a.width/l,i*=a.height/c}const o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-i,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Zl=-90,Kl=1;class oC extends qe{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new gn(Zl,Kl,t,e);s.layers=this.layers,this.add(s);const r=new gn(Zl,Kl,t,e);r.layers=this.layers,this.add(r);const a=new gn(Zl,Kl,t,e);a.layers=this.layers,this.add(a);const o=new gn(Zl,Kl,t,e);o.layers=this.layers,this.add(o);const l=new gn(Zl,Kl,t,e);l.layers=this.layers,this.add(l);const c=new gn(Zl,Kl,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[i,s,r,a,o,l]=e;for(const c of e)this.remove(c);if(t===vr)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===Zu)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,h]=this.children,u=t.getRenderTarget(),p=t.getActiveCubeFace(),m=t.getActiveMipmapLevel(),g=t.xr.enabled;t.xr.enabled=!1;const x=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0,s),t.render(e,r),t.setRenderTarget(i,1,s),t.render(e,a),t.setRenderTarget(i,2,s),t.render(e,o),t.setRenderTarget(i,3,s),t.render(e,l),t.setRenderTarget(i,4,s),t.render(e,c),i.texture.generateMipmaps=x,t.setRenderTarget(i,5,s),t.render(e,h),t.setRenderTarget(u,p,m),t.xr.enabled=g,i.texture.needsPMREMUpdate=!0}}class Cf extends bn{constructor(t,e,i,s,r,a,o,l,c,h){t=t!==void 0?t:[],e=e!==void 0?e:ua,super(t,e,i,s,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class lC extends qs{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},s=[i,i,i,i,i,i];this.texture=new Cf(s,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:yn}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -42,13 +42,13 @@ var iI=Object.defineProperty;var sI=(n,t,e)=>t in n?iI(n,t,{enumerable:!0,config gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},s=new io(5,5,5),r=new $s({name:"CubemapFromEquirect",uniforms:Qc(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Si,blending:sa});r.uniforms.tEquirect.value=e;const a=new Mn(s,r),o=e.minFilter;return e.minFilter===ws&&(e.minFilter=yn),new oC(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,i,s){const r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,i,s);t.setRenderTarget(r)}}class ng{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new kt(t),this.density=e}clone(){return new ng(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class ig{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new kt(t),this.near=e,this.far=i}clone(){return new ig(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}let b0=class extends qe{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 Ys,this.environmentIntensity=1,this.environmentRotation=new Ys,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 Rf{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=$u,this.updateRanges=[],this.version=0,this.uuid=ss()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let s=0,r=this.stride;st.far||e.push({distance:l,point:qh.clone(),uv:ta.getInterpolation(qh,dp,$h,pp,Ww,p_,jw,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 mp(n,t,e,i,s,r){ec.subVectors(n,e).addScalar(.5).multiply(i),s!==void 0?(Yh.x=r*ec.x-s*ec.y,Yh.y=s*ec.x+r*ec.y):Yh.copy(ec),n.copy(t),n.x+=Yh.x,n.y+=Yh.y,n.applyMatrix4(cC)}const gp=new O,Xw=new O;class uC extends qe{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,s=e.length;i0){let i,s;for(i=1,s=e.length;i0){gp.setFromMatrixPosition(this.matrixWorld);const s=t.ray.origin.distanceTo(gp);this.getObjectForDistance(s).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){gp.setFromMatrixPosition(t.matrixWorld),Xw.setFromMatrixPosition(this.matrixWorld);const i=gp.distanceTo(Xw)/t.zoom;e[0].object.visible=!0;let s,r;for(s=1,r=e.length;s=a)e[s-1].object.visible=!1,e[s].object.visible=!0;else break}for(this._currentLevel=s-1;s1?null:e.copy(t.start).addScaledVector(i,r)}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||YO.getNormalMatrix(t),s=this.coplanarPoint(y_).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const wo=new Yn,xp=new O;class If{constructor(t=new gr,e=new gr,i=new gr,s=new gr,r=new gr,a=new gr){this.planes=[t,e,i,s,r,a]}set(t,e,i,s,r,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(s),o[4].copy(r),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=vr){const i=this.planes,s=t.elements,r=s[0],a=s[1],o=s[2],l=s[3],c=s[4],h=s[5],u=s[6],p=s[7],m=s[8],g=s[9],x=s[10],y=s[11],_=s[12],b=s[13],S=s[14],w=s[15];if(i[0].setComponents(l-r,p-c,y-m,w-_).normalize(),i[1].setComponents(l+r,p+c,y+m,w+_).normalize(),i[2].setComponents(l+a,p+h,y+g,w+b).normalize(),i[3].setComponents(l-a,p-h,y-g,w-b).normalize(),i[4].setComponents(l-o,p-u,y-x,w-S).normalize(),e===vr)i[5].setComponents(l+o,p+u,y+x,w+S).normalize();else if(e===Zu)i[5].setComponents(o,u,x,S).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(),wo.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),wo.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(wo)}intersectsSprite(t){return wo.center.set(0,0,0),wo.radius=.7071067811865476,wo.applyMatrix4(t.matrixWorld),this.intersectsSphere(wo)}intersectsSphere(t){const e=this.planes,i=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(i)0?t.max.x:t.min.x,xp.y=s.normal.y>0?t.max.y:t.min.y,xp.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(xp)<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 __(n,t){return n-t}function $O(n,t){return n.z-t.z}function ZO(n,t){return t.z-n.z}class KO{constructor(){this.index=0,this.pool=[],this.list=[]}push(t,e,i,s){const r=this.pool,a=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];a.push(o),this.index++,o.start=t,o.count=e,o.z=i,o.index=s}reset(){this.list.length=0,this.index=0}}const Ii=new ye,JO=new kt(1,1,1),x_=new If,vp=new pi,So=new Yn,Jh=new O,eS=new O,QO=new O,v_=new KO,li=new Mn,Mp=[];function tF(n,t,e=0){const i=t.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==t.array.constructor){const s=n.count;for(let r=0;r65535?new Uint32Array(s):new Uint16Array(s);e.setIndex(new De(r,1))}this._geometryInitialized=!0}}_validateGeometry(t){const e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in e.attributes){if(!t.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const s=t.getAttribute(i),r=e.getAttribute(i);if(s.itemSize!==r.itemSize||s.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(t){const e=this._instanceInfo;if(t<0||t>=e.length||e[t].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${t}. Instance is either out of range or has been deleted.`)}validateGeometryId(t){const e=this._geometryInfo;if(t<0||t>=e.length||e[t].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${t}. Geometry is either out of range or has been deleted.`)}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new pi);const t=this.boundingBox,e=this._instanceInfo;t.makeEmpty();for(let i=0,s=e.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:t};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(__),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=i):(s=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;Ii.identity().toArray(r.image.data,s*16),r.needsUpdate=!0;const a=this._colorsTexture;return a&&(JO.toArray(a.image.data,s*4),a.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(t,e=-1,i=-1){this._initializeGeometry(t),this._validateGeometry(t);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=e===-1?t.getAttribute("position").count:e;const a=t.getIndex();if(a!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=i===-1?a.count:i),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(__),l=this._availableGeometryIds.shift(),r[l]=s):(l=this._geometryCount,this._geometryCount++,r.push(s)),this.setGeometryAt(l,t),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,l}setGeometryAt(t,e){if(t>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const i=this.geometry,s=i.getIndex()!==null,r=i.getIndex(),a=e.getIndex(),o=this._geometryInfo[t];if(s&&a.count>o.reservedIndexCount||e.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=e.getAttribute("position").count;for(const h in i.attributes){const u=e.getAttribute(h),p=i.getAttribute(h);tF(u,p,l);const m=u.itemSize;for(let g=u.count,x=c;g=e.length||e[t].active===!1)return this;const i=this._instanceInfo;for(let s=0,r=i.length;so).sort((a,o)=>i[a].vertexStart-i[o].vertexStart),r=this.geometry;for(let a=0,o=i.length;a=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[t];if(s.boundingBox===null){const r=new pi,a=i.index,o=i.attributes.position;for(let l=s.start,c=s.start+s.count;l=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[t];if(s.boundingSphere===null){const r=new Yn;this.getBoundingBoxAt(t,vp),vp.getCenter(r.center);const a=i.index,o=i.attributes.position;let l=0;for(let c=s.start,h=s.start+s.count;co.active);if(Math.max(...i.map(o=>o.vertexStart+o.reservedVertexCount))>t)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${e}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>e)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${e}. Cannot shrink further.`);const r=this.geometry;r.dispose(),this._maxVertexCount=t,this._maxIndexCount=e,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new ve,this._initializeGeometry(r));const a=this.geometry;r.index&&Eo(r.index.array,a.index.array);for(const o in r.attributes)Eo(r.attributes[o].array,a.attributes[o].array)}raycast(t,e){const i=this._instanceInfo,s=this._geometryInfo,r=this.matrixWorld,a=this.geometry;li.material=this.material,li.geometry.index=a.index,li.geometry.attributes=a.attributes,li.geometry.boundingBox===null&&(li.geometry.boundingBox=new pi),li.geometry.boundingSphere===null&&(li.geometry.boundingSphere=new Yn);for(let o=0,l=i.length;o({...e,boundingBox:e.boundingBox!==null?e.boundingBox.clone():null,boundingSphere:e.boundingSphere!==null?e.boundingSphere.clone():null})),this._instanceInfo=t._instanceInfo.map(e=>({...e})),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,s,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=s.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,h=this._multiDrawCounts,u=this._geometryInfo,p=this.perObjectFrustumCulled,m=this._indirectTexture,g=m.image.data;p&&(Ii.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),x_.setFromProjectionMatrix(Ii,t.coordinateSystem));let x=0;if(this.sortObjects){Ii.copy(this.matrixWorld).invert(),Jh.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Ii),eS.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Ii);for(let b=0,S=l.length;b0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;ri)return;M_.applyMatrix4(n.matrixWorld);const l=t.ray.origin.distanceTo(M_);if(!(lt.far))return{distance:l,point:iS.clone().applyMatrix4(n.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:n}}const sS=new O,rS=new O;class Ks extends da{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 s=0,r=e.count;s0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class na extends qe{constructor(){super(),this.isGroup=!0,this.type="Group"}}class eF extends bn{constructor(t,e,i,s,r,a,o,l,c){super(t,e,i,s,r,a,o,l,c),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:yn,this.magFilter=r!==void 0?r:yn,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 nF extends bn{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=Dn,this.minFilter=Dn,this.generateMipmaps=!1,this.needsUpdate=!0}}class ag extends bn{constructor(t,e,i,s,r,a,o,l,c,h,u,p){super(null,a,o,l,c,h,s,r,u,p),this.isCompressedTexture=!0,this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class iF extends ag{constructor(t,e,i,s,r,a){super(t,e,i,r,a),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=es,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class sF extends ag{constructor(t,e,i){super(void 0,t[0].width,t[0].height,e,i,ua),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class dC extends bn{constructor(t,e,i,s,r,a,o,l,c){super(t,e,i,s,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}let _1=class extends bn{constructor(t,e,i,s,r,a,o,l,c,h=tl){if(h!==tl&&h!==cl)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===tl&&(i=fa),i===void 0&&h===cl&&(i=ll),super(null,s,r,a,o,l,h,i,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:Dn,this.minFilter=l!==void 0?l:Dn,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}};class Js{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,s=this.getPoint(0),r=0;e.push(0);for(let a=1;a<=t;a++)i=this.getPoint(a/t),r+=i.distanceTo(s),e.push(r),s=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let s=0;const r=i.length;let a;e?a=e:a=t*i[r-1];let o=0,l=r-1,c;for(;o<=l;)if(s=Math.floor(o+(l-o)/2),c=i[s]-a,c<0)o=s+1;else if(c>0)l=s-1;else{l=s;break}if(s=l,i[s]===a)return s/(r-1);const h=i[s],p=i[s+1]-h,m=(a-h)/p;return(s+m)/(r-1)}getTangent(t,e){let s=t-1e-4,r=t+1e-4;s<0&&(s=0),r>1&&(r=1);const a=this.getPoint(s),o=this.getPoint(r),l=e||(a.isVector2?new xt:new O);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 O,s=[],r=[],a=[],o=new O,l=new ye;for(let m=0;m<=t;m++){const g=m/t;s[m]=this.getTangentAt(g,new O)}r[0]=new O,a[0]=new O;let c=Number.MAX_VALUE;const h=Math.abs(s[0].x),u=Math.abs(s[0].y),p=Math.abs(s[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(s[0],i).normalize(),r[0].crossVectors(s[0],o),a[0].crossVectors(s[0],r[0]);for(let m=1;m<=t;m++){if(r[m]=r[m-1].clone(),a[m]=a[m-1].clone(),o.crossVectors(s[m-1],s[m]),o.length()>Number.EPSILON){o.normalize();const g=Math.acos(Se(s[m-1].dot(s[m]),-1,1));r[m].applyMatrix4(l.makeRotationAxis(o,g))}a[m].crossVectors(s[m],r[m])}if(e===!0){let m=Math.acos(Se(r[0].dot(r[t]),-1,1));m/=t,s[0].dot(o.crossVectors(r[0],r[t]))>0&&(m=-m);for(let g=1;g<=t;g++)r[g].applyMatrix4(l.makeRotationAxis(s[g],m*g)),a[g].crossVectors(s[g],r[g])}return{tangents:s,normals:r,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 og extends Js{constructor(t=0,e=0,i=1,s=1,r=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=s,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(t,e=new xt){const i=e,s=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const a=Math.abs(r)s;)r-=s;r0?0:(Math.floor(Math.abs(o)/r)+1)*r:l===0&&o===r-1&&(o=r-2,l=1);let c,h;this.closed||o>0?c=s[(o-1)%r]:(Ap.subVectors(s[0],s[1]).add(s[0]),c=Ap);const u=s[o%r],p=s[(o+1)%r];if(this.closed||o+2s.length-2?s.length-1:a+1],u=s[a>s.length-3?s.length-1:a+2];return i.set(lS(o,l.x,c.x,h.x,u.x),lS(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=s[r]-i,o=this.curves[r],l=o.getLength(),c=l===0?0:1-a/l;return o.getPointAt(c,e)}r++}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,s=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 Df extends ve{constructor(t=[new xt(0,-.5),new xt(.5,0),new xt(0,.5)],e=12,i=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:s},e=Math.floor(e),s=Se(s,0,Math.PI*2);const r=[],a=[],o=[],l=[],c=[],h=1/e,u=new O,p=new xt,m=new O,g=new O,x=new O;let y=0,_=0;for(let b=0;b<=t.length-1;b++)switch(b){case 0:y=t[b+1].x-t[b].x,_=t[b+1].y-t[b].y,m.x=_*1,m.y=-y,m.z=_*0,x.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case t.length-1:l.push(x.x,x.y,x.z);break;default:y=t[b+1].x-t[b].x,_=t[b+1].y-t[b].y,m.x=_*1,m.y=-y,m.z=_*0,g.copy(m),m.x+=x.x,m.y+=x.y,m.z+=x.z,m.normalize(),l.push(m.x,m.y,m.z),x.copy(g)}for(let b=0;b<=e;b++){const S=i+b*h*s,w=Math.sin(S),R=Math.cos(S);for(let T=0;T<=t.length-1;T++){u.x=t[T].x*w,u.y=t[T].y,u.z=t[T].x*R,a.push(u.x,u.y,u.z),p.x=b/e,p.y=T/(t.length-1),o.push(p.x,p.y);const C=l[3*T+0]*w,L=l[3*T+1],P=l[3*T+0]*R;c.push(C,L,P)}}for(let b=0;b0&&S(!0),e>0&&S(!1)),this.setIndex(h),this.setAttribute("position",new re(u,3)),this.setAttribute("normal",new re(p,3)),this.setAttribute("uv",new re(m,2));function b(){const w=new O,R=new O;let T=0;const C=(e-t)/i;for(let L=0;L<=r;L++){const P=[],E=L/r,D=E*(e-t)+t;for(let z=0;z<=s;z++){const G=z/s,W=G*l+o,Q=Math.sin(W),Y=Math.cos(W);R.x=D*Q,R.y=-E*i+y,R.z=D*Y,u.push(R.x,R.y,R.z),w.set(Q,C,Y).normalize(),p.push(w.x,w.y,w.z),m.push(G,1-E),P.push(g++)}x.push(P)}for(let L=0;L0||P!==0)&&(h.push(E,D,G),T+=3),(e>0||P!==r-1)&&(h.push(D,z,G),T+=3)}c.addGroup(_,T,0),_+=T}function S(w){const R=g,T=new xt,C=new O;let L=0;const P=w===!0?t:e,E=w===!0?1:-1;for(let z=1;z<=s;z++)u.push(0,y*E,0),p.push(0,E,0),m.push(.5,.5),g++;const D=g;for(let z=0;z<=s;z++){const W=z/s*l+o,Q=Math.cos(W),Y=Math.sin(W);C.x=P*Y,C.y=y*E,C.z=P*Q,u.push(C.x,C.y,C.z),p.push(0,E,0),T.x=Q*.5+.5,T.y=Y*.5*E+.5,m.push(T.x,T.y),g++}for(let z=0;z.9&&C<.1&&(S<.2&&(a[b+0]+=1),w<.2&&(a[b+2]+=1),R<.2&&(a[b+4]+=1))}}function p(b){r.push(b.x,b.y,b.z)}function m(b,S){const w=b*3;S.x=t[w+0],S.y=t[w+1],S.z=t[w+2]}function g(){const b=new O,S=new O,w=new O,R=new O,T=new xt,C=new xt,L=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 Qu(r,a,e,o,l,m,0),a}};function vC(n,t,e,i,s){let r,a;if(s===CF(n,t,e,i)>0)for(r=t;r=t;r-=i)a=cS(r,n[r],n[r+1],a);return a&&fg(a,a.next)&&(ef(a),a=a.next),a}function ul(n,t){if(!n)return n;t||(t=n);let e=n,i;do if(i=!1,!e.steiner&&(fg(e,e.next)||dn(e.prev,e,e.next)===0)){if(ef(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Qu(n,t,e,i,s,r,a){if(!n)return;!a&&r&&bF(n,i,s,r);let o=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,r?pF(n,i,s,r):dF(n)){t.push(l.i/e|0),t.push(n.i/e|0),t.push(c.i/e|0),ef(n),n=c.next,o=c.next;continue}if(n=c,n===o){a?a===1?(n=mF(ul(n),t,e),Qu(n,t,e,i,s,r,2)):a===2&&gF(n,t,e,i,s,r):Qu(ul(n),t,e,i,s,r,1);break}}}function dF(n){const t=n.prev,e=n,i=n.next;if(dn(t,e,i)>=0)return!1;const s=t.x,r=e.x,a=i.x,o=t.y,l=e.y,c=i.y,h=sr?s>a?s:a:r>a?r: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&&Cc(s,o,r,l,a,c,g.x,g.y)&&dn(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function pF(n,t,e,i){const s=n.prev,r=n,a=n.next;if(dn(s,r,a)>=0)return!1;const o=s.x,l=r.x,c=a.x,h=s.y,u=r.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,_=Qx(m,g,t,e,i),b=Qx(x,y,t,e,i);let S=n.prevZ,w=n.nextZ;for(;S&&S.z>=_&&w&&w.z<=b;){if(S.x>=m&&S.x<=x&&S.y>=g&&S.y<=y&&S!==s&&S!==a&&Cc(o,h,l,u,c,p,S.x,S.y)&&dn(S.prev,S,S.next)>=0||(S=S.prevZ,w.x>=m&&w.x<=x&&w.y>=g&&w.y<=y&&w!==s&&w!==a&&Cc(o,h,l,u,c,p,w.x,w.y)&&dn(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;S&&S.z>=_;){if(S.x>=m&&S.x<=x&&S.y>=g&&S.y<=y&&S!==s&&S!==a&&Cc(o,h,l,u,c,p,S.x,S.y)&&dn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;w&&w.z<=b;){if(w.x>=m&&w.x<=x&&w.y>=g&&w.y<=y&&w!==s&&w!==a&&Cc(o,h,l,u,c,p,w.x,w.y)&&dn(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function mF(n,t,e){let i=n;do{const s=i.prev,r=i.next.next;!fg(s,r)&&MC(s,i,i.next,r)&&tf(s,r)&&tf(r,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(r.i/e|0),ef(i),ef(i.next),i=n=r),i=i.next}while(i!==n);return ul(i)}function gF(n,t,e,i,s,r){let a=n;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&EF(a,o)){let l=bC(a,o);a=ul(a,a.next),l=ul(l,l.next),Qu(a,t,e,i,s,r,0),Qu(l,t,e,i,s,r,0);return}o=o.next}a=a.next}while(a!==n)}function yF(n,t,e,i){const s=[];let r,a,o,l,c;for(r=0,a=t.length;r=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<=r&&p>i&&(i=p,s=e.x=e.x&&e.x>=l&&r!==e.x&&Cc(as.x||e.x===s.x&&MF(s,e)))&&(s=e,h=u)),e=e.next;while(e!==o);return s}function MF(n,t){return dn(n.prev,n,t.prev)<0&&dn(t.next,n,n.next)<0}function bF(n,t,e,i){let s=n;do s.z===0&&(s.z=Qx(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,wF(s)}function wF(n){let t,e,i,s,r,a,o,l,c=1;do{for(e=n,n=null,r=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)?(s=e,e=e.nextZ,o--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;e=i}r.nextZ=null,c*=2}while(a>1);return n}function Qx(n,t,e,i,s){return n=(n-e)*s|0,t=(t-i)*s|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 SF(n){let t=n,e=n;do(t.x=(n-a)*(r-o)&&(n-a)*(i-o)>=(e-a)*(t-o)&&(e-a)*(r-o)>=(s-a)*(i-o)}function EF(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!AF(n,t)&&(tf(n,t)&&tf(t,n)&&TF(n,t)&&(dn(n.prev,n,t.prev)||dn(n,t.prev,t))||fg(n,t)&&dn(n.prev,n,n.next)>0&&dn(t.prev,t,t.next)>0)}function dn(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function fg(n,t){return n.x===t.x&&n.y===t.y}function MC(n,t,e,i){const s=Ip(dn(n,t,e)),r=Ip(dn(n,t,i)),a=Ip(dn(e,i,n)),o=Ip(dn(e,i,t));return!!(s!==r&&a!==o||s===0&&Pp(n,e,t)||r===0&&Pp(n,i,t)||a===0&&Pp(e,n,i)||o===0&&Pp(e,t,i))}function Pp(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 Ip(n){return n>0?1:n<0?-1:0}function AF(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&&MC(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function tf(n,t){return dn(n.prev,n,n.next)<0?dn(n,t,n.next)>=0&&dn(n,n.prev,t)>=0:dn(n,t,n.prev)<0||dn(n,n.next,t)<0}function TF(n,t){let e=n,i=!1;const s=(n.x+t.x)/2,r=(n.y+t.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&s<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function bC(n,t){const e=new tv(n.i,n.x,n.y),i=new tv(t.i,t.x,t.y),s=n.next,r=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,r.next=i,i.prev=r,i}function cS(n,t,e,i){const s=new tv(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function ef(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 tv(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 CF(n,t,e,i){let s=0;for(let r=t,a=e-i;r2&&n[t-1].equals(n[0])&&n.pop()}function uS(n,t){for(let e=0;eNumber.EPSILON){const yt=Math.sqrt(N),Rt=Math.sqrt(Ft*Ft+U*U),Mt=gt.x-ne/yt,te=gt.y+Ct/yt,zt=k.x-U/Rt,Zt=k.y+Ft/Rt,Re=((zt-Mt)*U-(Zt-te)*Ft)/(Ct*U-ne*Ft);Et=Mt+Ct*Re-ht.x,wt=te+ne*Re-ht.y;const at=Et*Et+wt*wt;if(at<=2)return new xt(Et,wt);Lt=Math.sqrt(at/2)}else{let yt=!1;Ct>Number.EPSILON?Ft>Number.EPSILON&&(yt=!0):Ct<-Number.EPSILON?Ft<-Number.EPSILON&&(yt=!0):Math.sign(ne)===Math.sign(U)&&(yt=!0),yt?(Et=-ne,wt=Ct,Lt=Math.sqrt(N)):(Et=Ct,wt=ne,Lt=Math.sqrt(N/2))}return new xt(Et/Lt,wt/Lt)}const Z=[];for(let ht=0,gt=W.length,k=gt-1,Et=ht+1;ht=0;ht--){const gt=ht/y,k=m*Math.cos(gt*Math.PI/2),Et=g*Math.sin(gt*Math.PI/2)+x;for(let wt=0,Lt=W.length;wt=0;){const Et=k;let wt=k-1;wt<0&&(wt=ht.length-1);for(let Lt=0,Ct=h+y*2;Lt0)&&m.push(S,w,T),(_!==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 AC extends Rn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new kt(16777215),this.specular=new kt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eo,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 Ys,this.combine=Ef,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 TC extends Rn{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new kt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eo,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 CC extends Rn{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eo,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 ph extends Rn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new kt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eo,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 Ys,this.combine=Ef,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 E1 extends Rn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=z2,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 A1 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}}class RC extends Rn{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new kt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eo,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 PC extends Zn{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 qo(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 IC(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function LC(n){function t(s,r){return n[s]-n[r]}const e=n.length,i=new Array(e);for(let s=0;s!==e;++s)i[s]=s;return i.sort(t),i}function ev(n,t,e){const i=n.length,s=new n.constructor(i);for(let r=0,a=0;a!==i;++r){const o=e[r]*t;for(let l=0;l!==t;++l)s[a++]=n[o+l]}return s}function T1(n,t,e,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let a=r[i];if(a!==void 0)if(Array.isArray(a))do a=r[i],a!==void 0&&(t.push(r.time),e.push.apply(e,a)),r=n[s++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[i],a!==void 0&&(t.push(r.time),a.toArray(e,e.length)),r=n[s++];while(r!==void 0);else do a=r[i],a!==void 0&&(t.push(r.time),e.push(a)),r=n[s++];while(r!==void 0)}function LF(n,t,e,i,s=30){const r=n.clone();r.name=t;const a=[];for(let l=0;l=i)){u.push(c.times[m]);for(let x=0;xr.tracks[l].times[0]&&(o=r.tracks[l].times[0]);for(let l=0;l=o.times[g]){const _=g*u+h,b=_+u-h;x=o.values.slice(_,b)}else{const _=o.createInterpolant(),b=h,S=u-h;_.evaluate(r),x=_.resultBuffer.slice(b,S)}l==="quaternion"&&new Cn().fromArray(x).normalize().conjugate().toArray(x);const y=c.times.length;for(let _=0;_=r)){const o=e[1];t=r)break e}a=i,i=0;break n}break t}for(;i>>1;te;)--a;if(++a,r!==0||a!==s){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=i.slice(r,a),this.values=this.values.slice(r*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,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==r;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(s!==void 0&&IC(s))for(let o=0,l=s.length;o!==l;++o){const c=s[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(),s=this.getInterpolation()===Em,r=t.length-1;let a=1;for(let o=1;o0){t[a]=t[r];for(let o=r*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,s=new i(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}}Qs.prototype.TimeBufferType=Float32Array;Qs.prototype.ValueBufferType=Float32Array;Qs.prototype.DefaultInterpolation=Kc;class vl extends Qs{constructor(t,e,i){super(t,e,i)}}vl.prototype.ValueTypeName="bool";vl.prototype.ValueBufferType=Array;vl.prototype.DefaultInterpolation=Zc;vl.prototype.InterpolantFactoryMethodLinear=void 0;vl.prototype.InterpolantFactoryMethodSmooth=void 0;class R1 extends Qs{}R1.prototype.ValueTypeName="color";class fl extends Qs{}fl.prototype.ValueTypeName="number";class OC extends mh{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(i-e)/(s-e);let c=t*o;for(let h=c+o;c!==h;c+=4)Cn.slerpFlat(r,0,a,c-o,a,c,l);return r}}class dl extends Qs{InterpolantFactoryMethodLinear(t){return new OC(this.times,this.values,this.getValueSize(),t)}}dl.prototype.ValueTypeName="quaternion";dl.prototype.InterpolantFactoryMethodSmooth=void 0;class Ml extends Qs{constructor(t,e,i){super(t,e,i)}}Ml.prototype.ValueTypeName="string";Ml.prototype.ValueBufferType=Array;Ml.prototype.DefaultInterpolation=Zc;Ml.prototype.InterpolantFactoryMethodLinear=void 0;Ml.prototype.InterpolantFactoryMethodSmooth=void 0;class pl extends Qs{}pl.prototype.ValueTypeName="vector";class th{constructor(t="",e=-1,i=[],s=tg){this.name=t,this.tracks=i,this.duration=e,this.blendMode=s,this.uuid=ss(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,s=1/(t.fps||1);for(let a=0,o=i.length;a!==o;++a)e.push(FF(i[a]).scale(s));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],i=t.tracks,s={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let r=0,a=i.length;r!==a;++r)e.push(Qs.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(t,e,i,s){const r=e.length,a=[];for(let o=0;o1){const u=h[1];let p=s[u];p||(s[u]=p=[]),p.push(c)}}const a=[];for(const o in s)a.push(this.CreateFromMorphTargetSequence(o,s[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,x){if(m.length!==0){const y=[],_=[];T1(m,y,_,g),y.length!==0&&x.push(new u(p,y,_))}},s=[],r=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(r),this.manager.itemEnd(t)},0),r;if(Vr[t]!==void 0){Vr[t].push({onLoad:e,onProgress:i,onError:s});return}Vr[t]=[],Vr[t].push({onLoad:e,onProgress:i,onError:s});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=Vr[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 x=0;const y=new ReadableStream({start(_){b();function b(){u.read().then(({done:S,value:w})=>{if(S)_.close();else{x+=w.byteLength;const R=new ProgressEvent("progress",{lengthComputable:g,loaded:x,total:m});for(let T=0,C=h.length;T{_.error(S)})}}});return new Response(y)}else throw new UF(`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=>{ia.add(t,c);const h=Vr[t];delete Vr[t];for(let u=0,p=h.length;u{const h=Vr[t];if(h===void 0)throw this.manager.itemError(t),c;delete Vr[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 kF extends mi{constructor(t){super(t)}load(t,e,i,s){const r=this,a=new as(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(o){try{e(r.parse(JSON.parse(o)))}catch(l){s?s(l):console.error(l),r.manager.itemError(t)}},i,s)}parse(t){const e=[];for(let i=0;i0:s.vertexColors=t.vertexColors),t.uniforms!==void 0)for(const r in t.uniforms){const a=t.uniforms[r];switch(s.uniforms[r]={},a.type){case"t":s.uniforms[r].value=i(a.value);break;case"c":s.uniforms[r].value=new kt().setHex(a.value);break;case"v2":s.uniforms[r].value=new xt().fromArray(a.value);break;case"v3":s.uniforms[r].value=new O().fromArray(a.value);break;case"v4":s.uniforms[r].value=new Ge().fromArray(a.value);break;case"m3":s.uniforms[r].value=new Te().fromArray(a.value);break;case"m4":s.uniforms[r].value=new ye().fromArray(a.value);break;default:s.uniforms[r].value=a.value}}if(t.defines!==void 0&&(s.defines=t.defines),t.vertexShader!==void 0&&(s.vertexShader=t.vertexShader),t.fragmentShader!==void 0&&(s.fragmentShader=t.fragmentShader),t.glslVersion!==void 0&&(s.glslVersion=t.glslVersion),t.extensions!==void 0)for(const r in t.extensions)s.extensions[r]=t.extensions[r];if(t.lights!==void 0&&(s.lights=t.lights),t.clipping!==void 0&&(s.clipping=t.clipping),t.size!==void 0&&(s.size=t.size),t.sizeAttenuation!==void 0&&(s.sizeAttenuation=t.sizeAttenuation),t.map!==void 0&&(s.map=i(t.map)),t.matcap!==void 0&&(s.matcap=i(t.matcap)),t.alphaMap!==void 0&&(s.alphaMap=i(t.alphaMap)),t.bumpMap!==void 0&&(s.bumpMap=i(t.bumpMap)),t.bumpScale!==void 0&&(s.bumpScale=t.bumpScale),t.normalMap!==void 0&&(s.normalMap=i(t.normalMap)),t.normalMapType!==void 0&&(s.normalMapType=t.normalMapType),t.normalScale!==void 0){let r=t.normalScale;Array.isArray(r)===!1&&(r=[r,r]),s.normalScale=new xt().fromArray(r)}return t.displacementMap!==void 0&&(s.displacementMap=i(t.displacementMap)),t.displacementScale!==void 0&&(s.displacementScale=t.displacementScale),t.displacementBias!==void 0&&(s.displacementBias=t.displacementBias),t.roughnessMap!==void 0&&(s.roughnessMap=i(t.roughnessMap)),t.metalnessMap!==void 0&&(s.metalnessMap=i(t.metalnessMap)),t.emissiveMap!==void 0&&(s.emissiveMap=i(t.emissiveMap)),t.emissiveIntensity!==void 0&&(s.emissiveIntensity=t.emissiveIntensity),t.specularMap!==void 0&&(s.specularMap=i(t.specularMap)),t.specularIntensityMap!==void 0&&(s.specularIntensityMap=i(t.specularIntensityMap)),t.specularColorMap!==void 0&&(s.specularColorMap=i(t.specularColorMap)),t.envMap!==void 0&&(s.envMap=i(t.envMap)),t.envMapRotation!==void 0&&s.envMapRotation.fromArray(t.envMapRotation),t.envMapIntensity!==void 0&&(s.envMapIntensity=t.envMapIntensity),t.reflectivity!==void 0&&(s.reflectivity=t.reflectivity),t.refractionRatio!==void 0&&(s.refractionRatio=t.refractionRatio),t.lightMap!==void 0&&(s.lightMap=i(t.lightMap)),t.lightMapIntensity!==void 0&&(s.lightMapIntensity=t.lightMapIntensity),t.aoMap!==void 0&&(s.aoMap=i(t.aoMap)),t.aoMapIntensity!==void 0&&(s.aoMapIntensity=t.aoMapIntensity),t.gradientMap!==void 0&&(s.gradientMap=i(t.gradientMap)),t.clearcoatMap!==void 0&&(s.clearcoatMap=i(t.clearcoatMap)),t.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),t.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=i(t.clearcoatNormalMap)),t.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new xt().fromArray(t.clearcoatNormalScale)),t.iridescenceMap!==void 0&&(s.iridescenceMap=i(t.iridescenceMap)),t.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=i(t.iridescenceThicknessMap)),t.transmissionMap!==void 0&&(s.transmissionMap=i(t.transmissionMap)),t.thicknessMap!==void 0&&(s.thicknessMap=i(t.thicknessMap)),t.anisotropyMap!==void 0&&(s.anisotropyMap=i(t.anisotropyMap)),t.sheenColorMap!==void 0&&(s.sheenColorMap=i(t.sheenColorMap)),t.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=i(t.sheenRoughnessMap)),s}setTextures(t){return this.textures=t,this}createMaterialFromType(t){return Mg.createMaterialFromType(t)}static createMaterialFromType(t){const e={ShadowMaterial:SC,SpriteMaterial:sg,RawShaderMaterial:EC,ShaderMaterial:$s,PointsMaterial:Lf,MeshPhysicalMaterial:Rs,MeshStandardMaterial:dh,MeshPhongMaterial:AC,MeshToonMaterial:TC,MeshNormalMaterial:CC,MeshLambertMaterial:ph,MeshDepthMaterial:E1,MeshDistanceMaterial:A1,MeshBasicMaterial:ns,MeshMatcapMaterial:RC,LineDashedMaterial:PC,LineBasicMaterial:Zn,Material:Rn};return new e[t]}}class Ga{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,s=t.length;i0){const l=new P1(e);r=new nf(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,h=t.length;c0){s=new nf(this.manager),s.setCrossOrigin(this.crossOrigin);for(let a=0,o=t.length;a{const y=new pi;y.min.fromArray(x.boxMin),y.max.fromArray(x.boxMax);const _=new Yn;return _.radius=x.sphereRadius,_.center.fromArray(x.sphereCenter),{boxInitialized:x.boxInitialized,box:y,sphereInitialized:x.sphereInitialized,sphere:_}}),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 uC;break;case"Line":a=new da(o(t.geometry),l(t.material));break;case"LineLoop":a=new g1(o(t.geometry),l(t.material));break;case"LineSegments":a=new Ks(o(t.geometry),l(t.material));break;case"PointCloud":case"Points":a=new y1(o(t.geometry),l(t.material));break;case"Sprite":a=new hC(l(t.material));break;case"Group":a=new na;break;case"Bone":a=new rg;break;default:a=new qe}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,s){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,a=ia.get(t);if(a!==void 0){if(r.manager.itemStart(t),a.then){a.then(c=>{e&&e(c),r.manager.itemEnd(t)}).catch(c=>{s&&s(c)});return}return setTimeout(function(){e&&e(a),r.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(r.options,{colorSpaceConversion:"none"}))}).then(function(c){return ia.add(t,c),e&&e(c),r.manager.itemEnd(t),c}).catch(function(c){s&&s(c),ia.remove(t),r.manager.itemError(t),r.manager.itemEnd(t)});ia.add(t,l),r.manager.itemStart(t)}}let Lp;class F1{static getContext(){return Lp===void 0&&(Lp=new(window.AudioContext||window.webkitAudioContext)),Lp}static setContext(t){Lp=t}}class qF extends mi{constructor(t){super(t)}load(t,e,i,s){const r=this,a=new as(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);F1.getContext().decodeAudioData(c,function(u){e(u)}).catch(o)}catch(c){o(c)}},i,s);function o(l){s?s(l):console.error(l),r.manager.itemError(t)}}}const xS=new ye,vS=new ye,Ao=new ye;class YF{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new gn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new gn,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,Ao.copy(t.projectionMatrix);const s=e.eyeSep/2,r=s*e.near/e.focus,a=e.near*Math.tan(el*e.fov*.5)/e.zoom;let o,l;vS.elements[12]=-s,xS.elements[12]=s,o=-a*e.aspect+r,l=a*e.aspect+r,Ao.elements[0]=2*e.near/(l-o),Ao.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(Ao),o=-a*e.aspect-r,l=a*e.aspect-r,Ao.elements[0]=2*e.near/(l-o),Ao.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(Ao)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(vS),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(xS)}}class jC extends gn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class U1{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=MS(),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=MS();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function MS(){return performance.now()}const To=new O,bS=new Cn,$F=new O,Co=new O;class ZF extends qe{constructor(){super(),this.type="AudioListener",this.context=F1.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new U1}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(To,bS,$F),Co.set(0,0,-1).applyQuaternion(bS),e.positionX){const s=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(To.x,s),e.positionY.linearRampToValueAtTime(To.y,s),e.positionZ.linearRampToValueAtTime(To.z,s),e.forwardX.linearRampToValueAtTime(Co.x,s),e.forwardY.linearRampToValueAtTime(Co.y,s),e.forwardZ.linearRampToValueAtTime(Co.z,s),e.upX.linearRampToValueAtTime(i.x,s),e.upY.linearRampToValueAtTime(i.y,s),e.upZ.linearRampToValueAtTime(i.z,s)}else e.setPosition(To.x,To.y,To.z),e.setOrientation(Co.x,Co.y,Co.z,i.x,i.y,i.z)}}class XC extends qe{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(t=0){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.context.currentTime+t),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(i,s,this._addIndex*e,1,e);for(let l=e,c=e+e;l!==c;++l)if(i[l]!==i[l+e]){o.setValue(i,s);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,s=i*this._origIndex;t.getValue(e,s);for(let r=i,a=s;r!==a;++r)e[r]=e[s+r%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!==r;++a)t[e+a]=t[i+a]}_slerp(t,e,i,s){Cn.slerpFlat(t,e,t,e,t,i,s)}_slerpAdditive(t,e,i,s,r){const a=this._workIndex*r;Cn.multiplyQuaternionsFlat(t,a,t,e,t,i),Cn.slerpFlat(t,e,t,e,t,a,s)}_lerp(t,e,i,s,r){const a=1-s;for(let o=0;o!==r;++o){const l=e+o;t[l]=t[l]*a+t[i+o]*s}}_lerpAdditive(t,e,i,s,r){for(let a=0;a!==r;++a){const o=e+a;t[o]=t[o]+t[i+a]*s}}}const k1="\\[\\]\\.:\\/",tU=new RegExp("["+k1+"]","g"),z1="[^"+k1+"]",eU="[^"+k1.replace("\\.","")+"]",nU=/((?:WC+[\/:])*)/.source.replace("WC",z1),iU=/(WCOD+)?/.source.replace("WCOD",eU),sU=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",z1),rU=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",z1),aU=new RegExp("^"+nU+iU+sU+rU+"$"),oU=["material","materials","bones","map"];class lU{constructor(t,e,i){const s=i||He.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].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 He{constructor(t,e,i){this.path=e,this.parsedPath=i||He.parseTrackName(e),this.node=He.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 He.Composite(t,e,i):new He(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(tU,"")}static parseTrackName(t){const e=aU.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]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);oU.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}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(r){for(let a=0;a=r){const u=r++,p=t[u];e[p.uuid]=h,t[h]=p,e[c]=u,t[u]=l;for(let m=0,g=s;m!==g;++m){const x=i[m],y=x[u],_=x[h];x[h]=y,x[u]=_}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,s=i.length;let r=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,x=s;g!==x;++g){const y=i[g];y[u]=y[p],y.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const i=this._bindingsIndicesByPath;let s=i[t];const r=this._bindings;if(s!==void 0)return r[s];const a=this._paths,o=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);s=r.length,i[t]=s,a.push(t),o.push(e),r.push(u);for(let p=h,m=l.length;p!==m;++p){const g=l[p];u[p]=new He(g,t,e)}return u}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(i!==void 0){const s=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,l=a[o],c=t[o];e[c]=i,a[i]=l,a.pop(),r[i]=r[o],r.pop(),s[i]=s[o],s.pop()}}}class YC{constructor(t,e,i=null,s=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=s;const r=e.tracks,a=r.length,o=new Array(a),l={endingStart:Wo,endingEnd:Wo};for(let c=0;c!==a;++c){const h=r[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=F2,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 s=this._clip.duration,r=t._clip.duration,a=r/s,o=s/r;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 s=this._mixer,r=s.time,a=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=s._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,c=o.sampleValues;return l[0]=r,l[1]=r+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,s){if(!this.enabled){this._updateWeight(t);return}const r=this._startTime;if(r!==null){const l=(t-r)*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 a1:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulateAdditive(o);break;case tg:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulate(s,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(t)[0];e*=s,t>i.parameterPositions[1]&&(this.stopFading(),s===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 s=i.evaluate(t)[0];e*=s,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 s=this.time+t,r=this._loopCount;const a=i===U2;if(t===0)return r===-1?s:a&&(r&1)===1?e-s:s;if(i===O2){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(s>=e)s=e;else if(s<0)s=0;else{this.time=s;break t}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(r===-1&&(t>=0?(r=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),s>=e||s<0){const o=Math.floor(s/e);s-=e*o,r+=Math.abs(o);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=t>0?e:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(l===1){const c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=s;if(a&&(r&1)===1)return e-s}return s}_setEndings(t,e,i){const s=this._interpolantSettings;i?(s.endingStart=jo,s.endingEnd=jo):(t?s.endingStart=this.zeroSlopeAtStart?jo:Wo:s.endingStart=qu,e?s.endingEnd=this.zeroSlopeAtEnd?jo:Wo:s.endingEnd=qu)}_scheduleFading(t,e,i){const s=this._mixer,r=s.time;let a=this._weightInterpolant;a===null&&(a=s._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=r,l[0]=e,o[1]=r+t,l[1]=i,this}}const hU=new Float32Array(1);class uU extends Zs{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,s=t._clip.tracks,r=s.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!==r;++u){const p=s[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 x=e&&e._propertyBindings[u].binding.parsedPath;g=new qC(He.create(i,m,x),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,s=t._clip.uuid,r=this._actionsByClip[s];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,s,i)}const e=t._propertyBindings;for(let i=0,s=e.length;i!==s;++i){const r=e[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let i=0,s=e.length;i!==s;++i){const r=e[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}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,s=this.time+=t,r=Math.sign(t),a=this._accuIndex^=1;for(let c=0;c!==i;++c)e[c]._update(s,t,r,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,AS).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 TS=new O,Dp=new O;class _U{constructor(t=new O,e=new O){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){TS.subVectors(t,this.start),Dp.subVectors(this.end,this.start);const i=Dp.dot(Dp);let r=Dp.dot(TS)/i;return e&&(r=Se(r,0,1)),r}closestPointToPoint(t,e,i){const s=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(s).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 CS=new O;class xU extends qe{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const i=new ve,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let 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{DS.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(DS,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 LU extends Ks{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],s=new ve;s.setAttribute("position",new re(e,3)),s.setAttribute("color",new re(i,3));const r=new Zn({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(t,e,i){const s=new kt,r=this.geometry.attributes.color.array;return s.set(t),s.toArray(r,0),s.toArray(r,3),s.set(e),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class DU{constructor(){this.type="ShapePath",this.color=new kt,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Ju,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.currentPath.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,r,a){return this.currentPath.bezierCurveTo(t,e,i,s,r,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(_){const b=[];for(let S=0,w=_.length;SNumber.EPSILON){if(E<0&&(C=b[T],P=-P,L=b[R],E=-E),_.yL.y)continue;if(_.y===C.y){if(_.x===C.x)return!0}else{const D=E*(_.x-C.x)-P*(_.y-C.y);if(D===0)return!0;if(D<0)continue;w=!w}}else{if(_.y!==C.y)continue;if(L.x<=_.x&&_.x<=C.x||C.x<=_.x&&_.x<=L.x)return!0}}return w}const s=Er.isClockWise,r=this.subPaths;if(r.length===0)return[];let a,o,l;const c=[];if(r.length===1)return o=r[0],l=new il,l.curves=o.curves,c.push(l),c;let h=!s(r[0].getPoints());h=t?!h:h;const u=[],p=[];let m=[],g=0,x;p[g]=void 0,m[g]=[];for(let _=0,b=r.length;_1){let _=!1,b=0;for(let S=0,w=p.length;S0&&_===!1&&(m=u)}let y;for(let _=0,b=p.length;_t?(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 OU(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 FU(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function iv(n,t,e,i){const s=UU(i);switch(e){case t1:return n*t;case n1:return n*t;case i1:return n*t*2;case K0:return n*t/s.components*s.byteLength;case Af:return n*t/s.components*s.byteLength;case s1:return n*t*2/s.components*s.byteLength;case J0:return n*t*2/s.components*s.byteLength;case e1:return n*t*3/s.components*s.byteLength;case di:return n*t*4/s.components*s.byteLength;case Q0:return n*t*4/s.components*s.byteLength;case Su:case Eu:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case Au:case Tu:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Zm:case Jm:return Math.max(n,16)*Math.max(t,8)/4;case $m:case Km:return Math.max(n,8)*Math.max(t,8)/2;case Qm:case t0:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case e0:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case n0:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case i0:return Math.floor((n+4)/5)*Math.floor((t+3)/4)*16;case s0:return Math.floor((n+4)/5)*Math.floor((t+4)/5)*16;case r0:return Math.floor((n+5)/6)*Math.floor((t+4)/5)*16;case a0:return Math.floor((n+5)/6)*Math.floor((t+5)/6)*16;case o0:return Math.floor((n+7)/8)*Math.floor((t+4)/5)*16;case l0:return Math.floor((n+7)/8)*Math.floor((t+5)/6)*16;case c0:return Math.floor((n+7)/8)*Math.floor((t+7)/8)*16;case h0:return Math.floor((n+9)/10)*Math.floor((t+4)/5)*16;case u0:return Math.floor((n+9)/10)*Math.floor((t+5)/6)*16;case f0:return Math.floor((n+9)/10)*Math.floor((t+7)/8)*16;case d0:return Math.floor((n+9)/10)*Math.floor((t+9)/10)*16;case p0:return Math.floor((n+11)/12)*Math.floor((t+9)/10)*16;case m0:return Math.floor((n+11)/12)*Math.floor((t+11)/12)*16;case Cu:case g0:case y0:return Math.ceil(n/4)*Math.ceil(t/4)*16;case r1:case _0:return Math.ceil(n/4)*Math.ceil(t/4)*8;case x0:case v0:return Math.ceil(n/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function UU(n){switch(n){case Xs:case Kv:return{byteLength:1,components:1};case $c:case Jv:case hh:return{byteLength:2,components:1};case $0:case Z0:return{byteLength:2,components:4};case fa:case Y0:case ki:return{byteLength:4,components:1};case Qv:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const kU={contain:NU,cover:OU,fill:FU,getByteLength:iv};class zU extends qs{constructor(t=1,e=1,i=1,s={}){console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'),super(t,e,{...s,count:i}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:W0}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=W0);/** + `},s=new io(5,5,5),r=new $s({name:"CubemapFromEquirect",uniforms:Qc(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Si,blending:sa});r.uniforms.tEquirect.value=e;const a=new Mn(s,r),o=e.minFilter;return e.minFilter===ws&&(e.minFilter=yn),new oC(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,i,s){const r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,i,s);t.setRenderTarget(r)}}class ng{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new kt(t),this.density=e}clone(){return new ng(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class ig{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new kt(t),this.near=e,this.far=i}clone(){return new ig(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}let b0=class extends qe{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 Ys,this.environmentIntensity=1,this.environmentRotation=new Ys,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 Rf{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=$u,this.updateRanges=[],this.version=0,this.uuid=ss()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let s=0,r=this.stride;st.far||e.push({distance:l,point:qh.clone(),uv:ta.getInterpolation(qh,dp,$h,pp,Ww,p_,jw,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 mp(n,t,e,i,s,r){ec.subVectors(n,e).addScalar(.5).multiply(i),s!==void 0?(Yh.x=r*ec.x-s*ec.y,Yh.y=s*ec.x+r*ec.y):Yh.copy(ec),n.copy(t),n.x+=Yh.x,n.y+=Yh.y,n.applyMatrix4(cC)}const gp=new O,Xw=new O;class uC extends qe{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,s=e.length;i0){let i,s;for(i=1,s=e.length;i0){gp.setFromMatrixPosition(this.matrixWorld);const s=t.ray.origin.distanceTo(gp);this.getObjectForDistance(s).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){gp.setFromMatrixPosition(t.matrixWorld),Xw.setFromMatrixPosition(this.matrixWorld);const i=gp.distanceTo(Xw)/t.zoom;e[0].object.visible=!0;let s,r;for(s=1,r=e.length;s=a)e[s-1].object.visible=!1,e[s].object.visible=!0;else break}for(this._currentLevel=s-1;s1?null:e.copy(t.start).addScaledVector(i,r)}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||ZO.getNormalMatrix(t),s=this.coplanarPoint(y_).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const wo=new Yn,xp=new O;class If{constructor(t=new gr,e=new gr,i=new gr,s=new gr,r=new gr,a=new gr){this.planes=[t,e,i,s,r,a]}set(t,e,i,s,r,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(s),o[4].copy(r),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=vr){const i=this.planes,s=t.elements,r=s[0],a=s[1],o=s[2],l=s[3],c=s[4],h=s[5],u=s[6],p=s[7],m=s[8],g=s[9],x=s[10],y=s[11],_=s[12],b=s[13],S=s[14],w=s[15];if(i[0].setComponents(l-r,p-c,y-m,w-_).normalize(),i[1].setComponents(l+r,p+c,y+m,w+_).normalize(),i[2].setComponents(l+a,p+h,y+g,w+b).normalize(),i[3].setComponents(l-a,p-h,y-g,w-b).normalize(),i[4].setComponents(l-o,p-u,y-x,w-S).normalize(),e===vr)i[5].setComponents(l+o,p+u,y+x,w+S).normalize();else if(e===Zu)i[5].setComponents(o,u,x,S).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(),wo.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),wo.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(wo)}intersectsSprite(t){return wo.center.set(0,0,0),wo.radius=.7071067811865476,wo.applyMatrix4(t.matrixWorld),this.intersectsSphere(wo)}intersectsSphere(t){const e=this.planes,i=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(i)0?t.max.x:t.min.x,xp.y=s.normal.y>0?t.max.y:t.min.y,xp.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(xp)<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 __(n,t){return n-t}function KO(n,t){return n.z-t.z}function JO(n,t){return t.z-n.z}class QO{constructor(){this.index=0,this.pool=[],this.list=[]}push(t,e,i,s){const r=this.pool,a=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];a.push(o),this.index++,o.start=t,o.count=e,o.z=i,o.index=s}reset(){this.list.length=0,this.index=0}}const Ii=new ye,tF=new kt(1,1,1),x_=new If,vp=new pi,So=new Yn,Jh=new O,eS=new O,eF=new O,v_=new QO,li=new Mn,Mp=[];function nF(n,t,e=0){const i=t.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==t.array.constructor){const s=n.count;for(let r=0;r65535?new Uint32Array(s):new Uint16Array(s);e.setIndex(new De(r,1))}this._geometryInitialized=!0}}_validateGeometry(t){const e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in e.attributes){if(!t.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const s=t.getAttribute(i),r=e.getAttribute(i);if(s.itemSize!==r.itemSize||s.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(t){const e=this._instanceInfo;if(t<0||t>=e.length||e[t].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${t}. Instance is either out of range or has been deleted.`)}validateGeometryId(t){const e=this._geometryInfo;if(t<0||t>=e.length||e[t].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${t}. Geometry is either out of range or has been deleted.`)}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new pi);const t=this.boundingBox,e=this._instanceInfo;t.makeEmpty();for(let i=0,s=e.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:t};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(__),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=i):(s=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;Ii.identity().toArray(r.image.data,s*16),r.needsUpdate=!0;const a=this._colorsTexture;return a&&(tF.toArray(a.image.data,s*4),a.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(t,e=-1,i=-1){this._initializeGeometry(t),this._validateGeometry(t);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=e===-1?t.getAttribute("position").count:e;const a=t.getIndex();if(a!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=i===-1?a.count:i),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(__),l=this._availableGeometryIds.shift(),r[l]=s):(l=this._geometryCount,this._geometryCount++,r.push(s)),this.setGeometryAt(l,t),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,l}setGeometryAt(t,e){if(t>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const i=this.geometry,s=i.getIndex()!==null,r=i.getIndex(),a=e.getIndex(),o=this._geometryInfo[t];if(s&&a.count>o.reservedIndexCount||e.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=e.getAttribute("position").count;for(const h in i.attributes){const u=e.getAttribute(h),p=i.getAttribute(h);nF(u,p,l);const m=u.itemSize;for(let g=u.count,x=c;g=e.length||e[t].active===!1)return this;const i=this._instanceInfo;for(let s=0,r=i.length;so).sort((a,o)=>i[a].vertexStart-i[o].vertexStart),r=this.geometry;for(let a=0,o=i.length;a=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[t];if(s.boundingBox===null){const r=new pi,a=i.index,o=i.attributes.position;for(let l=s.start,c=s.start+s.count;l=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[t];if(s.boundingSphere===null){const r=new Yn;this.getBoundingBoxAt(t,vp),vp.getCenter(r.center);const a=i.index,o=i.attributes.position;let l=0;for(let c=s.start,h=s.start+s.count;co.active);if(Math.max(...i.map(o=>o.vertexStart+o.reservedVertexCount))>t)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${e}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>e)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${e}. Cannot shrink further.`);const r=this.geometry;r.dispose(),this._maxVertexCount=t,this._maxIndexCount=e,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new ve,this._initializeGeometry(r));const a=this.geometry;r.index&&Eo(r.index.array,a.index.array);for(const o in r.attributes)Eo(r.attributes[o].array,a.attributes[o].array)}raycast(t,e){const i=this._instanceInfo,s=this._geometryInfo,r=this.matrixWorld,a=this.geometry;li.material=this.material,li.geometry.index=a.index,li.geometry.attributes=a.attributes,li.geometry.boundingBox===null&&(li.geometry.boundingBox=new pi),li.geometry.boundingSphere===null&&(li.geometry.boundingSphere=new Yn);for(let o=0,l=i.length;o({...e,boundingBox:e.boundingBox!==null?e.boundingBox.clone():null,boundingSphere:e.boundingSphere!==null?e.boundingSphere.clone():null})),this._instanceInfo=t._instanceInfo.map(e=>({...e})),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,s,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=s.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,h=this._multiDrawCounts,u=this._geometryInfo,p=this.perObjectFrustumCulled,m=this._indirectTexture,g=m.image.data;p&&(Ii.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),x_.setFromProjectionMatrix(Ii,t.coordinateSystem));let x=0;if(this.sortObjects){Ii.copy(this.matrixWorld).invert(),Jh.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Ii),eS.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Ii);for(let b=0,S=l.length;b0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;ri)return;M_.applyMatrix4(n.matrixWorld);const l=t.ray.origin.distanceTo(M_);if(!(lt.far))return{distance:l,point:iS.clone().applyMatrix4(n.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:n}}const sS=new O,rS=new O;class Ks extends da{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 s=0,r=e.count;s0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class na extends qe{constructor(){super(),this.isGroup=!0,this.type="Group"}}class iF extends bn{constructor(t,e,i,s,r,a,o,l,c){super(t,e,i,s,r,a,o,l,c),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:yn,this.magFilter=r!==void 0?r:yn,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 sF extends bn{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=Dn,this.minFilter=Dn,this.generateMipmaps=!1,this.needsUpdate=!0}}class ag extends bn{constructor(t,e,i,s,r,a,o,l,c,h,u,p){super(null,a,o,l,c,h,s,r,u,p),this.isCompressedTexture=!0,this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class rF extends ag{constructor(t,e,i,s,r,a){super(t,e,i,r,a),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=es,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class aF extends ag{constructor(t,e,i){super(void 0,t[0].width,t[0].height,e,i,ua),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class dC extends bn{constructor(t,e,i,s,r,a,o,l,c){super(t,e,i,s,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}let _1=class extends bn{constructor(t,e,i,s,r,a,o,l,c,h=tl){if(h!==tl&&h!==cl)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===tl&&(i=fa),i===void 0&&h===cl&&(i=ll),super(null,s,r,a,o,l,h,i,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:Dn,this.minFilter=l!==void 0?l:Dn,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}};class Js{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,s=this.getPoint(0),r=0;e.push(0);for(let a=1;a<=t;a++)i=this.getPoint(a/t),r+=i.distanceTo(s),e.push(r),s=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let s=0;const r=i.length;let a;e?a=e:a=t*i[r-1];let o=0,l=r-1,c;for(;o<=l;)if(s=Math.floor(o+(l-o)/2),c=i[s]-a,c<0)o=s+1;else if(c>0)l=s-1;else{l=s;break}if(s=l,i[s]===a)return s/(r-1);const h=i[s],p=i[s+1]-h,m=(a-h)/p;return(s+m)/(r-1)}getTangent(t,e){let s=t-1e-4,r=t+1e-4;s<0&&(s=0),r>1&&(r=1);const a=this.getPoint(s),o=this.getPoint(r),l=e||(a.isVector2?new xt:new O);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 O,s=[],r=[],a=[],o=new O,l=new ye;for(let m=0;m<=t;m++){const g=m/t;s[m]=this.getTangentAt(g,new O)}r[0]=new O,a[0]=new O;let c=Number.MAX_VALUE;const h=Math.abs(s[0].x),u=Math.abs(s[0].y),p=Math.abs(s[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(s[0],i).normalize(),r[0].crossVectors(s[0],o),a[0].crossVectors(s[0],r[0]);for(let m=1;m<=t;m++){if(r[m]=r[m-1].clone(),a[m]=a[m-1].clone(),o.crossVectors(s[m-1],s[m]),o.length()>Number.EPSILON){o.normalize();const g=Math.acos(Se(s[m-1].dot(s[m]),-1,1));r[m].applyMatrix4(l.makeRotationAxis(o,g))}a[m].crossVectors(s[m],r[m])}if(e===!0){let m=Math.acos(Se(r[0].dot(r[t]),-1,1));m/=t,s[0].dot(o.crossVectors(r[0],r[t]))>0&&(m=-m);for(let g=1;g<=t;g++)r[g].applyMatrix4(l.makeRotationAxis(s[g],m*g)),a[g].crossVectors(s[g],r[g])}return{tangents:s,normals:r,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 og extends Js{constructor(t=0,e=0,i=1,s=1,r=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=s,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(t,e=new xt){const i=e,s=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const a=Math.abs(r)s;)r-=s;r0?0:(Math.floor(Math.abs(o)/r)+1)*r:l===0&&o===r-1&&(o=r-2,l=1);let c,h;this.closed||o>0?c=s[(o-1)%r]:(Ap.subVectors(s[0],s[1]).add(s[0]),c=Ap);const u=s[o%r],p=s[(o+1)%r];if(this.closed||o+2s.length-2?s.length-1:a+1],u=s[a>s.length-3?s.length-1:a+2];return i.set(lS(o,l.x,c.x,h.x,u.x),lS(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=s[r]-i,o=this.curves[r],l=o.getLength(),c=l===0?0:1-a/l;return o.getPointAt(c,e)}r++}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,s=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 Df extends ve{constructor(t=[new xt(0,-.5),new xt(.5,0),new xt(0,.5)],e=12,i=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:s},e=Math.floor(e),s=Se(s,0,Math.PI*2);const r=[],a=[],o=[],l=[],c=[],h=1/e,u=new O,p=new xt,m=new O,g=new O,x=new O;let y=0,_=0;for(let b=0;b<=t.length-1;b++)switch(b){case 0:y=t[b+1].x-t[b].x,_=t[b+1].y-t[b].y,m.x=_*1,m.y=-y,m.z=_*0,x.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case t.length-1:l.push(x.x,x.y,x.z);break;default:y=t[b+1].x-t[b].x,_=t[b+1].y-t[b].y,m.x=_*1,m.y=-y,m.z=_*0,g.copy(m),m.x+=x.x,m.y+=x.y,m.z+=x.z,m.normalize(),l.push(m.x,m.y,m.z),x.copy(g)}for(let b=0;b<=e;b++){const S=i+b*h*s,w=Math.sin(S),R=Math.cos(S);for(let T=0;T<=t.length-1;T++){u.x=t[T].x*w,u.y=t[T].y,u.z=t[T].x*R,a.push(u.x,u.y,u.z),p.x=b/e,p.y=T/(t.length-1),o.push(p.x,p.y);const C=l[3*T+0]*w,L=l[3*T+1],P=l[3*T+0]*R;c.push(C,L,P)}}for(let b=0;b0&&S(!0),e>0&&S(!1)),this.setIndex(h),this.setAttribute("position",new re(u,3)),this.setAttribute("normal",new re(p,3)),this.setAttribute("uv",new re(m,2));function b(){const w=new O,R=new O;let T=0;const C=(e-t)/i;for(let L=0;L<=r;L++){const P=[],E=L/r,D=E*(e-t)+t;for(let z=0;z<=s;z++){const G=z/s,W=G*l+o,Q=Math.sin(W),Y=Math.cos(W);R.x=D*Q,R.y=-E*i+y,R.z=D*Y,u.push(R.x,R.y,R.z),w.set(Q,C,Y).normalize(),p.push(w.x,w.y,w.z),m.push(G,1-E),P.push(g++)}x.push(P)}for(let L=0;L0||P!==0)&&(h.push(E,D,G),T+=3),(e>0||P!==r-1)&&(h.push(D,z,G),T+=3)}c.addGroup(_,T,0),_+=T}function S(w){const R=g,T=new xt,C=new O;let L=0;const P=w===!0?t:e,E=w===!0?1:-1;for(let z=1;z<=s;z++)u.push(0,y*E,0),p.push(0,E,0),m.push(.5,.5),g++;const D=g;for(let z=0;z<=s;z++){const W=z/s*l+o,Q=Math.cos(W),Y=Math.sin(W);C.x=P*Y,C.y=y*E,C.z=P*Q,u.push(C.x,C.y,C.z),p.push(0,E,0),T.x=Q*.5+.5,T.y=Y*.5*E+.5,m.push(T.x,T.y),g++}for(let z=0;z.9&&C<.1&&(S<.2&&(a[b+0]+=1),w<.2&&(a[b+2]+=1),R<.2&&(a[b+4]+=1))}}function p(b){r.push(b.x,b.y,b.z)}function m(b,S){const w=b*3;S.x=t[w+0],S.y=t[w+1],S.z=t[w+2]}function g(){const b=new O,S=new O,w=new O,R=new O,T=new xt,C=new xt,L=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 Qu(r,a,e,o,l,m,0),a}};function vC(n,t,e,i,s){let r,a;if(s===PF(n,t,e,i)>0)for(r=t;r=t;r-=i)a=cS(r,n[r],n[r+1],a);return a&&fg(a,a.next)&&(ef(a),a=a.next),a}function ul(n,t){if(!n)return n;t||(t=n);let e=n,i;do if(i=!1,!e.steiner&&(fg(e,e.next)||dn(e.prev,e,e.next)===0)){if(ef(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Qu(n,t,e,i,s,r,a){if(!n)return;!a&&r&&SF(n,i,s,r);let o=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,r?gF(n,i,s,r):mF(n)){t.push(l.i/e|0),t.push(n.i/e|0),t.push(c.i/e|0),ef(n),n=c.next,o=c.next;continue}if(n=c,n===o){a?a===1?(n=yF(ul(n),t,e),Qu(n,t,e,i,s,r,2)):a===2&&_F(n,t,e,i,s,r):Qu(ul(n),t,e,i,s,r,1);break}}}function mF(n){const t=n.prev,e=n,i=n.next;if(dn(t,e,i)>=0)return!1;const s=t.x,r=e.x,a=i.x,o=t.y,l=e.y,c=i.y,h=sr?s>a?s:a:r>a?r: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&&Cc(s,o,r,l,a,c,g.x,g.y)&&dn(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function gF(n,t,e,i){const s=n.prev,r=n,a=n.next;if(dn(s,r,a)>=0)return!1;const o=s.x,l=r.x,c=a.x,h=s.y,u=r.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,_=Qx(m,g,t,e,i),b=Qx(x,y,t,e,i);let S=n.prevZ,w=n.nextZ;for(;S&&S.z>=_&&w&&w.z<=b;){if(S.x>=m&&S.x<=x&&S.y>=g&&S.y<=y&&S!==s&&S!==a&&Cc(o,h,l,u,c,p,S.x,S.y)&&dn(S.prev,S,S.next)>=0||(S=S.prevZ,w.x>=m&&w.x<=x&&w.y>=g&&w.y<=y&&w!==s&&w!==a&&Cc(o,h,l,u,c,p,w.x,w.y)&&dn(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;S&&S.z>=_;){if(S.x>=m&&S.x<=x&&S.y>=g&&S.y<=y&&S!==s&&S!==a&&Cc(o,h,l,u,c,p,S.x,S.y)&&dn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;w&&w.z<=b;){if(w.x>=m&&w.x<=x&&w.y>=g&&w.y<=y&&w!==s&&w!==a&&Cc(o,h,l,u,c,p,w.x,w.y)&&dn(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function yF(n,t,e){let i=n;do{const s=i.prev,r=i.next.next;!fg(s,r)&&MC(s,i,i.next,r)&&tf(s,r)&&tf(r,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(r.i/e|0),ef(i),ef(i.next),i=n=r),i=i.next}while(i!==n);return ul(i)}function _F(n,t,e,i,s,r){let a=n;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&TF(a,o)){let l=bC(a,o);a=ul(a,a.next),l=ul(l,l.next),Qu(a,t,e,i,s,r,0),Qu(l,t,e,i,s,r,0);return}o=o.next}a=a.next}while(a!==n)}function xF(n,t,e,i){const s=[];let r,a,o,l,c;for(r=0,a=t.length;r=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<=r&&p>i&&(i=p,s=e.x=e.x&&e.x>=l&&r!==e.x&&Cc(as.x||e.x===s.x&&wF(s,e)))&&(s=e,h=u)),e=e.next;while(e!==o);return s}function wF(n,t){return dn(n.prev,n,t.prev)<0&&dn(t.next,n,n.next)<0}function SF(n,t,e,i){let s=n;do s.z===0&&(s.z=Qx(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,EF(s)}function EF(n){let t,e,i,s,r,a,o,l,c=1;do{for(e=n,n=null,r=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)?(s=e,e=e.nextZ,o--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;e=i}r.nextZ=null,c*=2}while(a>1);return n}function Qx(n,t,e,i,s){return n=(n-e)*s|0,t=(t-i)*s|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 AF(n){let t=n,e=n;do(t.x=(n-a)*(r-o)&&(n-a)*(i-o)>=(e-a)*(t-o)&&(e-a)*(r-o)>=(s-a)*(i-o)}function TF(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!CF(n,t)&&(tf(n,t)&&tf(t,n)&&RF(n,t)&&(dn(n.prev,n,t.prev)||dn(n,t.prev,t))||fg(n,t)&&dn(n.prev,n,n.next)>0&&dn(t.prev,t,t.next)>0)}function dn(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function fg(n,t){return n.x===t.x&&n.y===t.y}function MC(n,t,e,i){const s=Ip(dn(n,t,e)),r=Ip(dn(n,t,i)),a=Ip(dn(e,i,n)),o=Ip(dn(e,i,t));return!!(s!==r&&a!==o||s===0&&Pp(n,e,t)||r===0&&Pp(n,i,t)||a===0&&Pp(e,n,i)||o===0&&Pp(e,t,i))}function Pp(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 Ip(n){return n>0?1:n<0?-1:0}function CF(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&&MC(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function tf(n,t){return dn(n.prev,n,n.next)<0?dn(n,t,n.next)>=0&&dn(n,n.prev,t)>=0:dn(n,t,n.prev)<0||dn(n,n.next,t)<0}function RF(n,t){let e=n,i=!1;const s=(n.x+t.x)/2,r=(n.y+t.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&s<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function bC(n,t){const e=new tv(n.i,n.x,n.y),i=new tv(t.i,t.x,t.y),s=n.next,r=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,r.next=i,i.prev=r,i}function cS(n,t,e,i){const s=new tv(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function ef(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 tv(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 PF(n,t,e,i){let s=0;for(let r=t,a=e-i;r2&&n[t-1].equals(n[0])&&n.pop()}function uS(n,t){for(let e=0;eNumber.EPSILON){const yt=Math.sqrt(N),Rt=Math.sqrt(Ft*Ft+U*U),Mt=gt.x-ne/yt,te=gt.y+Ct/yt,zt=k.x-U/Rt,Zt=k.y+Ft/Rt,Re=((zt-Mt)*U-(Zt-te)*Ft)/(Ct*U-ne*Ft);Et=Mt+Ct*Re-ht.x,wt=te+ne*Re-ht.y;const at=Et*Et+wt*wt;if(at<=2)return new xt(Et,wt);Lt=Math.sqrt(at/2)}else{let yt=!1;Ct>Number.EPSILON?Ft>Number.EPSILON&&(yt=!0):Ct<-Number.EPSILON?Ft<-Number.EPSILON&&(yt=!0):Math.sign(ne)===Math.sign(U)&&(yt=!0),yt?(Et=-ne,wt=Ct,Lt=Math.sqrt(N)):(Et=Ct,wt=ne,Lt=Math.sqrt(N/2))}return new xt(Et/Lt,wt/Lt)}const Z=[];for(let ht=0,gt=W.length,k=gt-1,Et=ht+1;ht=0;ht--){const gt=ht/y,k=m*Math.cos(gt*Math.PI/2),Et=g*Math.sin(gt*Math.PI/2)+x;for(let wt=0,Lt=W.length;wt=0;){const Et=k;let wt=k-1;wt<0&&(wt=ht.length-1);for(let Lt=0,Ct=h+y*2;Lt0)&&m.push(S,w,T),(_!==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 AC extends Rn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new kt(16777215),this.specular=new kt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eo,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 Ys,this.combine=Ef,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 TC extends Rn{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new kt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eo,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 CC extends Rn{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eo,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 ph extends Rn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new kt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eo,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 Ys,this.combine=Ef,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 E1 extends Rn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=z2,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 A1 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}}class RC extends Rn{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new kt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eo,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 PC extends Zn{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 qo(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 IC(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function LC(n){function t(s,r){return n[s]-n[r]}const e=n.length,i=new Array(e);for(let s=0;s!==e;++s)i[s]=s;return i.sort(t),i}function ev(n,t,e){const i=n.length,s=new n.constructor(i);for(let r=0,a=0;a!==i;++r){const o=e[r]*t;for(let l=0;l!==t;++l)s[a++]=n[o+l]}return s}function T1(n,t,e,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let a=r[i];if(a!==void 0)if(Array.isArray(a))do a=r[i],a!==void 0&&(t.push(r.time),e.push.apply(e,a)),r=n[s++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[i],a!==void 0&&(t.push(r.time),a.toArray(e,e.length)),r=n[s++];while(r!==void 0);else do a=r[i],a!==void 0&&(t.push(r.time),e.push(a)),r=n[s++];while(r!==void 0)}function NF(n,t,e,i,s=30){const r=n.clone();r.name=t;const a=[];for(let l=0;l=i)){u.push(c.times[m]);for(let x=0;xr.tracks[l].times[0]&&(o=r.tracks[l].times[0]);for(let l=0;l=o.times[g]){const _=g*u+h,b=_+u-h;x=o.values.slice(_,b)}else{const _=o.createInterpolant(),b=h,S=u-h;_.evaluate(r),x=_.resultBuffer.slice(b,S)}l==="quaternion"&&new Cn().fromArray(x).normalize().conjugate().toArray(x);const y=c.times.length;for(let _=0;_=r)){const o=e[1];t=r)break e}a=i,i=0;break n}break t}for(;i>>1;te;)--a;if(++a,r!==0||a!==s){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=i.slice(r,a),this.values=this.values.slice(r*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,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==r;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(s!==void 0&&IC(s))for(let o=0,l=s.length;o!==l;++o){const c=s[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(),s=this.getInterpolation()===Em,r=t.length-1;let a=1;for(let o=1;o0){t[a]=t[r];for(let o=r*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,s=new i(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}}Qs.prototype.TimeBufferType=Float32Array;Qs.prototype.ValueBufferType=Float32Array;Qs.prototype.DefaultInterpolation=Kc;class vl extends Qs{constructor(t,e,i){super(t,e,i)}}vl.prototype.ValueTypeName="bool";vl.prototype.ValueBufferType=Array;vl.prototype.DefaultInterpolation=Zc;vl.prototype.InterpolantFactoryMethodLinear=void 0;vl.prototype.InterpolantFactoryMethodSmooth=void 0;class R1 extends Qs{}R1.prototype.ValueTypeName="color";class fl extends Qs{}fl.prototype.ValueTypeName="number";class OC extends mh{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(i-e)/(s-e);let c=t*o;for(let h=c+o;c!==h;c+=4)Cn.slerpFlat(r,0,a,c-o,a,c,l);return r}}class dl extends Qs{InterpolantFactoryMethodLinear(t){return new OC(this.times,this.values,this.getValueSize(),t)}}dl.prototype.ValueTypeName="quaternion";dl.prototype.InterpolantFactoryMethodSmooth=void 0;class Ml extends Qs{constructor(t,e,i){super(t,e,i)}}Ml.prototype.ValueTypeName="string";Ml.prototype.ValueBufferType=Array;Ml.prototype.DefaultInterpolation=Zc;Ml.prototype.InterpolantFactoryMethodLinear=void 0;Ml.prototype.InterpolantFactoryMethodSmooth=void 0;class pl extends Qs{}pl.prototype.ValueTypeName="vector";class th{constructor(t="",e=-1,i=[],s=tg){this.name=t,this.tracks=i,this.duration=e,this.blendMode=s,this.uuid=ss(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,s=1/(t.fps||1);for(let a=0,o=i.length;a!==o;++a)e.push(kF(i[a]).scale(s));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],i=t.tracks,s={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let r=0,a=i.length;r!==a;++r)e.push(Qs.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(t,e,i,s){const r=e.length,a=[];for(let o=0;o1){const u=h[1];let p=s[u];p||(s[u]=p=[]),p.push(c)}}const a=[];for(const o in s)a.push(this.CreateFromMorphTargetSequence(o,s[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,x){if(m.length!==0){const y=[],_=[];T1(m,y,_,g),y.length!==0&&x.push(new u(p,y,_))}},s=[],r=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(r),this.manager.itemEnd(t)},0),r;if(Vr[t]!==void 0){Vr[t].push({onLoad:e,onProgress:i,onError:s});return}Vr[t]=[],Vr[t].push({onLoad:e,onProgress:i,onError:s});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=Vr[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 x=0;const y=new ReadableStream({start(_){b();function b(){u.read().then(({done:S,value:w})=>{if(S)_.close();else{x+=w.byteLength;const R=new ProgressEvent("progress",{lengthComputable:g,loaded:x,total:m});for(let T=0,C=h.length;T{_.error(S)})}}});return new Response(y)}else throw new zF(`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=>{ia.add(t,c);const h=Vr[t];delete Vr[t];for(let u=0,p=h.length;u{const h=Vr[t];if(h===void 0)throw this.manager.itemError(t),c;delete Vr[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 BF extends mi{constructor(t){super(t)}load(t,e,i,s){const r=this,a=new as(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(o){try{e(r.parse(JSON.parse(o)))}catch(l){s?s(l):console.error(l),r.manager.itemError(t)}},i,s)}parse(t){const e=[];for(let i=0;i0:s.vertexColors=t.vertexColors),t.uniforms!==void 0)for(const r in t.uniforms){const a=t.uniforms[r];switch(s.uniforms[r]={},a.type){case"t":s.uniforms[r].value=i(a.value);break;case"c":s.uniforms[r].value=new kt().setHex(a.value);break;case"v2":s.uniforms[r].value=new xt().fromArray(a.value);break;case"v3":s.uniforms[r].value=new O().fromArray(a.value);break;case"v4":s.uniforms[r].value=new Ge().fromArray(a.value);break;case"m3":s.uniforms[r].value=new Te().fromArray(a.value);break;case"m4":s.uniforms[r].value=new ye().fromArray(a.value);break;default:s.uniforms[r].value=a.value}}if(t.defines!==void 0&&(s.defines=t.defines),t.vertexShader!==void 0&&(s.vertexShader=t.vertexShader),t.fragmentShader!==void 0&&(s.fragmentShader=t.fragmentShader),t.glslVersion!==void 0&&(s.glslVersion=t.glslVersion),t.extensions!==void 0)for(const r in t.extensions)s.extensions[r]=t.extensions[r];if(t.lights!==void 0&&(s.lights=t.lights),t.clipping!==void 0&&(s.clipping=t.clipping),t.size!==void 0&&(s.size=t.size),t.sizeAttenuation!==void 0&&(s.sizeAttenuation=t.sizeAttenuation),t.map!==void 0&&(s.map=i(t.map)),t.matcap!==void 0&&(s.matcap=i(t.matcap)),t.alphaMap!==void 0&&(s.alphaMap=i(t.alphaMap)),t.bumpMap!==void 0&&(s.bumpMap=i(t.bumpMap)),t.bumpScale!==void 0&&(s.bumpScale=t.bumpScale),t.normalMap!==void 0&&(s.normalMap=i(t.normalMap)),t.normalMapType!==void 0&&(s.normalMapType=t.normalMapType),t.normalScale!==void 0){let r=t.normalScale;Array.isArray(r)===!1&&(r=[r,r]),s.normalScale=new xt().fromArray(r)}return t.displacementMap!==void 0&&(s.displacementMap=i(t.displacementMap)),t.displacementScale!==void 0&&(s.displacementScale=t.displacementScale),t.displacementBias!==void 0&&(s.displacementBias=t.displacementBias),t.roughnessMap!==void 0&&(s.roughnessMap=i(t.roughnessMap)),t.metalnessMap!==void 0&&(s.metalnessMap=i(t.metalnessMap)),t.emissiveMap!==void 0&&(s.emissiveMap=i(t.emissiveMap)),t.emissiveIntensity!==void 0&&(s.emissiveIntensity=t.emissiveIntensity),t.specularMap!==void 0&&(s.specularMap=i(t.specularMap)),t.specularIntensityMap!==void 0&&(s.specularIntensityMap=i(t.specularIntensityMap)),t.specularColorMap!==void 0&&(s.specularColorMap=i(t.specularColorMap)),t.envMap!==void 0&&(s.envMap=i(t.envMap)),t.envMapRotation!==void 0&&s.envMapRotation.fromArray(t.envMapRotation),t.envMapIntensity!==void 0&&(s.envMapIntensity=t.envMapIntensity),t.reflectivity!==void 0&&(s.reflectivity=t.reflectivity),t.refractionRatio!==void 0&&(s.refractionRatio=t.refractionRatio),t.lightMap!==void 0&&(s.lightMap=i(t.lightMap)),t.lightMapIntensity!==void 0&&(s.lightMapIntensity=t.lightMapIntensity),t.aoMap!==void 0&&(s.aoMap=i(t.aoMap)),t.aoMapIntensity!==void 0&&(s.aoMapIntensity=t.aoMapIntensity),t.gradientMap!==void 0&&(s.gradientMap=i(t.gradientMap)),t.clearcoatMap!==void 0&&(s.clearcoatMap=i(t.clearcoatMap)),t.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),t.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=i(t.clearcoatNormalMap)),t.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new xt().fromArray(t.clearcoatNormalScale)),t.iridescenceMap!==void 0&&(s.iridescenceMap=i(t.iridescenceMap)),t.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=i(t.iridescenceThicknessMap)),t.transmissionMap!==void 0&&(s.transmissionMap=i(t.transmissionMap)),t.thicknessMap!==void 0&&(s.thicknessMap=i(t.thicknessMap)),t.anisotropyMap!==void 0&&(s.anisotropyMap=i(t.anisotropyMap)),t.sheenColorMap!==void 0&&(s.sheenColorMap=i(t.sheenColorMap)),t.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=i(t.sheenRoughnessMap)),s}setTextures(t){return this.textures=t,this}createMaterialFromType(t){return Mg.createMaterialFromType(t)}static createMaterialFromType(t){const e={ShadowMaterial:SC,SpriteMaterial:sg,RawShaderMaterial:EC,ShaderMaterial:$s,PointsMaterial:Lf,MeshPhysicalMaterial:Rs,MeshStandardMaterial:dh,MeshPhongMaterial:AC,MeshToonMaterial:TC,MeshNormalMaterial:CC,MeshLambertMaterial:ph,MeshDepthMaterial:E1,MeshDistanceMaterial:A1,MeshBasicMaterial:ns,MeshMatcapMaterial:RC,LineDashedMaterial:PC,LineBasicMaterial:Zn,Material:Rn};return new e[t]}}class Ga{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,s=t.length;i0){const l=new P1(e);r=new nf(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,h=t.length;c0){s=new nf(this.manager),s.setCrossOrigin(this.crossOrigin);for(let a=0,o=t.length;a{const y=new pi;y.min.fromArray(x.boxMin),y.max.fromArray(x.boxMax);const _=new Yn;return _.radius=x.sphereRadius,_.center.fromArray(x.sphereCenter),{boxInitialized:x.boxInitialized,box:y,sphereInitialized:x.sphereInitialized,sphere:_}}),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 uC;break;case"Line":a=new da(o(t.geometry),l(t.material));break;case"LineLoop":a=new g1(o(t.geometry),l(t.material));break;case"LineSegments":a=new Ks(o(t.geometry),l(t.material));break;case"PointCloud":case"Points":a=new y1(o(t.geometry),l(t.material));break;case"Sprite":a=new hC(l(t.material));break;case"Group":a=new na;break;case"Bone":a=new rg;break;default:a=new qe}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,s){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,a=ia.get(t);if(a!==void 0){if(r.manager.itemStart(t),a.then){a.then(c=>{e&&e(c),r.manager.itemEnd(t)}).catch(c=>{s&&s(c)});return}return setTimeout(function(){e&&e(a),r.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(r.options,{colorSpaceConversion:"none"}))}).then(function(c){return ia.add(t,c),e&&e(c),r.manager.itemEnd(t),c}).catch(function(c){s&&s(c),ia.remove(t),r.manager.itemError(t),r.manager.itemEnd(t)});ia.add(t,l),r.manager.itemStart(t)}}let Lp;class F1{static getContext(){return Lp===void 0&&(Lp=new(window.AudioContext||window.webkitAudioContext)),Lp}static setContext(t){Lp=t}}class $F extends mi{constructor(t){super(t)}load(t,e,i,s){const r=this,a=new as(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);F1.getContext().decodeAudioData(c,function(u){e(u)}).catch(o)}catch(c){o(c)}},i,s);function o(l){s?s(l):console.error(l),r.manager.itemError(t)}}}const xS=new ye,vS=new ye,Ao=new ye;class ZF{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new gn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new gn,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,Ao.copy(t.projectionMatrix);const s=e.eyeSep/2,r=s*e.near/e.focus,a=e.near*Math.tan(el*e.fov*.5)/e.zoom;let o,l;vS.elements[12]=-s,xS.elements[12]=s,o=-a*e.aspect+r,l=a*e.aspect+r,Ao.elements[0]=2*e.near/(l-o),Ao.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(Ao),o=-a*e.aspect-r,l=a*e.aspect-r,Ao.elements[0]=2*e.near/(l-o),Ao.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(Ao)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(vS),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(xS)}}class jC extends gn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class U1{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=MS(),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=MS();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function MS(){return performance.now()}const To=new O,bS=new Cn,KF=new O,Co=new O;class JF extends qe{constructor(){super(),this.type="AudioListener",this.context=F1.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new U1}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(To,bS,KF),Co.set(0,0,-1).applyQuaternion(bS),e.positionX){const s=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(To.x,s),e.positionY.linearRampToValueAtTime(To.y,s),e.positionZ.linearRampToValueAtTime(To.z,s),e.forwardX.linearRampToValueAtTime(Co.x,s),e.forwardY.linearRampToValueAtTime(Co.y,s),e.forwardZ.linearRampToValueAtTime(Co.z,s),e.upX.linearRampToValueAtTime(i.x,s),e.upY.linearRampToValueAtTime(i.y,s),e.upZ.linearRampToValueAtTime(i.z,s)}else e.setPosition(To.x,To.y,To.z),e.setOrientation(Co.x,Co.y,Co.z,i.x,i.y,i.z)}}class XC extends qe{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(t=0){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.context.currentTime+t),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(i,s,this._addIndex*e,1,e);for(let l=e,c=e+e;l!==c;++l)if(i[l]!==i[l+e]){o.setValue(i,s);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,s=i*this._origIndex;t.getValue(e,s);for(let r=i,a=s;r!==a;++r)e[r]=e[s+r%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!==r;++a)t[e+a]=t[i+a]}_slerp(t,e,i,s){Cn.slerpFlat(t,e,t,e,t,i,s)}_slerpAdditive(t,e,i,s,r){const a=this._workIndex*r;Cn.multiplyQuaternionsFlat(t,a,t,e,t,i),Cn.slerpFlat(t,e,t,e,t,a,s)}_lerp(t,e,i,s,r){const a=1-s;for(let o=0;o!==r;++o){const l=e+o;t[l]=t[l]*a+t[i+o]*s}}_lerpAdditive(t,e,i,s,r){for(let a=0;a!==r;++a){const o=e+a;t[o]=t[o]+t[i+a]*s}}}const k1="\\[\\]\\.:\\/",nU=new RegExp("["+k1+"]","g"),z1="[^"+k1+"]",iU="[^"+k1.replace("\\.","")+"]",sU=/((?:WC+[\/:])*)/.source.replace("WC",z1),rU=/(WCOD+)?/.source.replace("WCOD",iU),aU=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",z1),oU=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",z1),lU=new RegExp("^"+sU+rU+aU+oU+"$"),cU=["material","materials","bones","map"];class hU{constructor(t,e,i){const s=i||He.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].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 He{constructor(t,e,i){this.path=e,this.parsedPath=i||He.parseTrackName(e),this.node=He.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 He.Composite(t,e,i):new He(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(nU,"")}static parseTrackName(t){const e=lU.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]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);cU.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}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(r){for(let a=0;a=r){const u=r++,p=t[u];e[p.uuid]=h,t[h]=p,e[c]=u,t[u]=l;for(let m=0,g=s;m!==g;++m){const x=i[m],y=x[u],_=x[h];x[h]=y,x[u]=_}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,s=i.length;let r=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,x=s;g!==x;++g){const y=i[g];y[u]=y[p],y.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const i=this._bindingsIndicesByPath;let s=i[t];const r=this._bindings;if(s!==void 0)return r[s];const a=this._paths,o=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);s=r.length,i[t]=s,a.push(t),o.push(e),r.push(u);for(let p=h,m=l.length;p!==m;++p){const g=l[p];u[p]=new He(g,t,e)}return u}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(i!==void 0){const s=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,l=a[o],c=t[o];e[c]=i,a[i]=l,a.pop(),r[i]=r[o],r.pop(),s[i]=s[o],s.pop()}}}class YC{constructor(t,e,i=null,s=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=s;const r=e.tracks,a=r.length,o=new Array(a),l={endingStart:Wo,endingEnd:Wo};for(let c=0;c!==a;++c){const h=r[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=F2,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 s=this._clip.duration,r=t._clip.duration,a=r/s,o=s/r;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 s=this._mixer,r=s.time,a=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=s._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,c=o.sampleValues;return l[0]=r,l[1]=r+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,s){if(!this.enabled){this._updateWeight(t);return}const r=this._startTime;if(r!==null){const l=(t-r)*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 a1:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulateAdditive(o);break;case tg:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulate(s,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(t)[0];e*=s,t>i.parameterPositions[1]&&(this.stopFading(),s===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 s=i.evaluate(t)[0];e*=s,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 s=this.time+t,r=this._loopCount;const a=i===U2;if(t===0)return r===-1?s:a&&(r&1)===1?e-s:s;if(i===O2){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(s>=e)s=e;else if(s<0)s=0;else{this.time=s;break t}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(r===-1&&(t>=0?(r=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),s>=e||s<0){const o=Math.floor(s/e);s-=e*o,r+=Math.abs(o);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=t>0?e:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(l===1){const c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=s;if(a&&(r&1)===1)return e-s}return s}_setEndings(t,e,i){const s=this._interpolantSettings;i?(s.endingStart=jo,s.endingEnd=jo):(t?s.endingStart=this.zeroSlopeAtStart?jo:Wo:s.endingStart=qu,e?s.endingEnd=this.zeroSlopeAtEnd?jo:Wo:s.endingEnd=qu)}_scheduleFading(t,e,i){const s=this._mixer,r=s.time;let a=this._weightInterpolant;a===null&&(a=s._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=r,l[0]=e,o[1]=r+t,l[1]=i,this}}const fU=new Float32Array(1);class dU extends Zs{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,s=t._clip.tracks,r=s.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!==r;++u){const p=s[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 x=e&&e._propertyBindings[u].binding.parsedPath;g=new qC(He.create(i,m,x),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,s=t._clip.uuid,r=this._actionsByClip[s];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,s,i)}const e=t._propertyBindings;for(let i=0,s=e.length;i!==s;++i){const r=e[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let i=0,s=e.length;i!==s;++i){const r=e[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}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,s=this.time+=t,r=Math.sign(t),a=this._accuIndex^=1;for(let c=0;c!==i;++c)e[c]._update(s,t,r,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,AS).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 TS=new O,Dp=new O;class vU{constructor(t=new O,e=new O){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){TS.subVectors(t,this.start),Dp.subVectors(this.end,this.start);const i=Dp.dot(Dp);let r=Dp.dot(TS)/i;return e&&(r=Se(r,0,1)),r}closestPointToPoint(t,e,i){const s=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(s).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 CS=new O;class MU extends qe{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const i=new ve,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let 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{DS.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(DS,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 NU extends Ks{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],s=new ve;s.setAttribute("position",new re(e,3)),s.setAttribute("color",new re(i,3));const r=new Zn({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(t,e,i){const s=new kt,r=this.geometry.attributes.color.array;return s.set(t),s.toArray(r,0),s.toArray(r,3),s.set(e),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class OU{constructor(){this.type="ShapePath",this.color=new kt,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Ju,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.currentPath.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,r,a){return this.currentPath.bezierCurveTo(t,e,i,s,r,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(_){const b=[];for(let S=0,w=_.length;SNumber.EPSILON){if(E<0&&(C=b[T],P=-P,L=b[R],E=-E),_.yL.y)continue;if(_.y===C.y){if(_.x===C.x)return!0}else{const D=E*(_.x-C.x)-P*(_.y-C.y);if(D===0)return!0;if(D<0)continue;w=!w}}else{if(_.y!==C.y)continue;if(L.x<=_.x&&_.x<=C.x||C.x<=_.x&&_.x<=L.x)return!0}}return w}const s=Er.isClockWise,r=this.subPaths;if(r.length===0)return[];let a,o,l;const c=[];if(r.length===1)return o=r[0],l=new il,l.curves=o.curves,c.push(l),c;let h=!s(r[0].getPoints());h=t?!h:h;const u=[],p=[];let m=[],g=0,x;p[g]=void 0,m[g]=[];for(let _=0,b=r.length;_1){let _=!1,b=0;for(let S=0,w=p.length;S0&&_===!1&&(m=u)}let y;for(let _=0,b=p.length;_t?(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 UU(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 kU(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function iv(n,t,e,i){const s=zU(i);switch(e){case t1:return n*t;case n1:return n*t;case i1:return n*t*2;case K0:return n*t/s.components*s.byteLength;case Af:return n*t/s.components*s.byteLength;case s1:return n*t*2/s.components*s.byteLength;case J0:return n*t*2/s.components*s.byteLength;case e1:return n*t*3/s.components*s.byteLength;case di:return n*t*4/s.components*s.byteLength;case Q0:return n*t*4/s.components*s.byteLength;case Su:case Eu:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case Au:case Tu:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Zm:case Jm:return Math.max(n,16)*Math.max(t,8)/4;case $m:case Km:return Math.max(n,8)*Math.max(t,8)/2;case Qm:case t0:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case e0:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case n0:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case i0:return Math.floor((n+4)/5)*Math.floor((t+3)/4)*16;case s0:return Math.floor((n+4)/5)*Math.floor((t+4)/5)*16;case r0:return Math.floor((n+5)/6)*Math.floor((t+4)/5)*16;case a0:return Math.floor((n+5)/6)*Math.floor((t+5)/6)*16;case o0:return Math.floor((n+7)/8)*Math.floor((t+4)/5)*16;case l0:return Math.floor((n+7)/8)*Math.floor((t+5)/6)*16;case c0:return Math.floor((n+7)/8)*Math.floor((t+7)/8)*16;case h0:return Math.floor((n+9)/10)*Math.floor((t+4)/5)*16;case u0:return Math.floor((n+9)/10)*Math.floor((t+5)/6)*16;case f0:return Math.floor((n+9)/10)*Math.floor((t+7)/8)*16;case d0:return Math.floor((n+9)/10)*Math.floor((t+9)/10)*16;case p0:return Math.floor((n+11)/12)*Math.floor((t+9)/10)*16;case m0:return Math.floor((n+11)/12)*Math.floor((t+11)/12)*16;case Cu:case g0:case y0:return Math.ceil(n/4)*Math.ceil(t/4)*16;case r1:case _0:return Math.ceil(n/4)*Math.ceil(t/4)*8;case x0:case v0:return Math.ceil(n/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function zU(n){switch(n){case Xs:case Kv:return{byteLength:1,components:1};case $c:case Jv:case hh:return{byteLength:2,components:1};case $0:case Z0:return{byteLength:2,components:4};case fa:case Y0:case ki:return{byteLength:4,components:1};case Qv:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const BU={contain:FU,cover:UU,fill:kU,getByteLength:iv};class HU extends qs{constructor(t=1,e=1,i=1,s={}){console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'),super(t,e,{...s,count:i}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:W0}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=W0);/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT - */function KC(){let n=null,t=!1,e=null,i=null;function s(r,a){e(r,a),i=n.requestAnimationFrame(s)}return{start:function(){t!==!0&&e!==null&&(i=n.requestAnimationFrame(s),t=!0)},stop:function(){n.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(r){e=r},setContext:function(r){n=r}}}function BU(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.updateRanges;if(n.bindBuffer(c,o),u.length===0)n.bufferSubData(c,0,h);else{u.sort((m,g)=>m.start-g.start);let p=0;for(let m=1;mm.start-g.start);let p=0;for(let m=1;mt in n?iI(n,t,{enumerable:!0,config : cases.z; return clamp( threshold , 1.0e-6, 1.0 ); } -#endif`,VU=`#ifdef USE_ALPHAMAP +#endif`,jU=`#ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; -#endif`,WU=`#ifdef USE_ALPHAMAP +#endif`,XU=`#ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,jU=`#ifdef USE_ALPHATEST +#endif`,qU=`#ifdef USE_ALPHATEST #ifdef ALPHA_TO_COVERAGE diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); if ( diffuseColor.a == 0.0 ) discard; #else if ( diffuseColor.a < alphaTest ) discard; #endif -#endif`,XU=`#ifdef USE_ALPHATEST +#endif`,YU=`#ifdef USE_ALPHATEST uniform float alphaTest; -#endif`,qU=`#ifdef USE_AOMAP +#endif`,$U=`#ifdef USE_AOMAP float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; reflectedLight.indirectDiffuse *= ambientOcclusion; #if defined( USE_CLEARCOAT ) @@ -109,10 +109,10 @@ var iI=Object.defineProperty;var sI=(n,t,e)=>t in n?iI(n,t,{enumerable:!0,config float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); #endif -#endif`,YU=`#ifdef USE_AOMAP +#endif`,ZU=`#ifdef USE_AOMAP uniform sampler2D aoMap; uniform float aoMapIntensity; -#endif`,$U=`#ifdef USE_BATCHING +#endif`,KU=`#ifdef USE_BATCHING #if ! defined( GL_ANGLE_multi_draw ) #define gl_DrawID _gl_DrawID uniform int _gl_DrawID; @@ -146,15 +146,15 @@ var iI=Object.defineProperty;var sI=(n,t,e)=>t in n?iI(n,t,{enumerable:!0,config int y = j / size; return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb; } -#endif`,ZU=`#ifdef USE_BATCHING +#endif`,JU=`#ifdef USE_BATCHING mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); -#endif`,KU=`vec3 transformed = vec3( position ); +#endif`,QU=`vec3 transformed = vec3( position ); #ifdef USE_ALPHAHASH vPosition = vec3( position ); -#endif`,JU=`vec3 objectNormal = vec3( normal ); +#endif`,tk=`vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); -#endif`,QU=`float G_BlinnPhong_Implicit( ) { +#endif`,ek=`float G_BlinnPhong_Implicit( ) { return 0.25; } float D_BlinnPhong( const in float shininess, const in float dotNH ) { @@ -168,7 +168,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve float G = G_BlinnPhong_Implicit( ); float D = D_BlinnPhong( shininess, dotNH ); return F * ( G * D ); -} // validated`,tk=`#ifdef USE_IRIDESCENCE +} // validated`,nk=`#ifdef USE_IRIDESCENCE const mat3 XYZ_TO_REC709 = mat3( 3.2404542, -0.9692660, 0.0556434, -1.5371385, 1.8760108, -0.2040259, @@ -231,7 +231,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve } return max( I, vec3( 0.0 ) ); } -#endif`,ek=`#ifdef USE_BUMPMAP +#endif`,ik=`#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { @@ -252,7 +252,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); return normalize( abs( fDet ) * surf_norm - vGrad ); } -#endif`,nk=`#if NUM_CLIPPING_PLANES > 0 +#endif`,sk=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -298,26 +298,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,ik=`#if NUM_CLIPPING_PLANES > 0 +#endif`,rk=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,sk=`#if NUM_CLIPPING_PLANES > 0 +#endif`,ak=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,rk=`#if NUM_CLIPPING_PLANES > 0 +#endif`,ok=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,ak=`#if defined( USE_COLOR_ALPHA ) +#endif`,lk=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,ok=`#if defined( USE_COLOR_ALPHA ) +#endif`,ck=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,lk=`#if defined( USE_COLOR_ALPHA ) +#endif`,hk=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; -#endif`,ck=`#if defined( USE_COLOR_ALPHA ) +#endif`,uk=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec3( 1.0 ); @@ -331,7 +331,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; -#endif`,hk=`#define PI 3.141592653589793 +#endif`,fk=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -405,7 +405,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,uk=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,dk=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -498,7 +498,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,fk=`vec3 transformedNormal = objectNormal; +#endif`,pk=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -527,21 +527,21 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,dk=`#ifdef USE_DISPLACEMENTMAP +#endif`,mk=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,pk=`#ifdef USE_DISPLACEMENTMAP +#endif`,gk=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,mk=`#ifdef USE_EMISSIVEMAP +#endif`,yk=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE emissiveColor = sRGBTransferEOTF( emissiveColor ); #endif totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,gk=`#ifdef USE_EMISSIVEMAP +#endif`,_k=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,yk="gl_FragColor = linearToOutputTexel( gl_FragColor );",_k=`vec4 LinearTransferOETF( in vec4 value ) { +#endif`,xk="gl_FragColor = linearToOutputTexel( gl_FragColor );",vk=`vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferEOTF( in vec4 value ) { @@ -549,7 +549,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) { } vec4 sRGBTransferOETF( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,xk=`#ifdef USE_ENVMAP +}`,Mk=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -578,7 +578,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,vk=`#ifdef USE_ENVMAP +#endif`,bk=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -588,7 +588,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,Mk=`#ifdef USE_ENVMAP +#endif`,wk=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -599,7 +599,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,bk=`#ifdef USE_ENVMAP +#endif`,Sk=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -610,7 +610,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,wk=`#ifdef USE_ENVMAP +#endif`,Ek=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -627,18 +627,18 @@ vec4 sRGBTransferOETF( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,Sk=`#ifdef USE_FOG +#endif`,Ak=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,Ek=`#ifdef USE_FOG +#endif`,Tk=`#ifdef USE_FOG varying float vFogDepth; -#endif`,Ak=`#ifdef USE_FOG +#endif`,Ck=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Tk=`#ifdef USE_FOG +#endif`,Rk=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -647,7 +647,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,Ck=`#ifdef USE_GRADIENTMAP +#endif`,Pk=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -659,12 +659,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,Rk=`#ifdef USE_LIGHTMAP +}`,Ik=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,Pk=`LambertMaterial material; +#endif`,Lk=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,Ik=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,Dk=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -678,7 +678,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Lk=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Nk=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -794,7 +794,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,Dk=`#ifdef USE_ENVMAP +#endif`,Ok=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -827,8 +827,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,Nk=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,Ok=`varying vec3 vViewPosition; +#endif`,Fk=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,Uk=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -840,11 +840,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Fk=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,kk=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,Uk=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,zk=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -861,7 +861,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,kk=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Bk=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -947,7 +947,7 @@ material.roughness = min( material.roughness, 1.0 ); material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,zk=`struct PhysicalMaterial { +#endif`,Hk=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1248,7 +1248,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,Bk=` +}`,Gk=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1363,7 +1363,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,Hk=`#if defined( RE_IndirectDiffuse ) +#endif`,Vk=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1382,32 +1382,32 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,Gk=`#if defined( RE_IndirectDiffuse ) +#endif`,Wk=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,Vk=`#if defined( USE_LOGDEPTHBUF ) +#endif`,jk=`#if defined( USE_LOGDEPTHBUF ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,Wk=`#if defined( USE_LOGDEPTHBUF ) +#endif`,Xk=`#if defined( USE_LOGDEPTHBUF ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,jk=`#ifdef USE_LOGDEPTHBUF +#endif`,qk=`#ifdef USE_LOGDEPTHBUF varying float vFragDepth; varying float vIsPerspective; -#endif`,Xk=`#ifdef USE_LOGDEPTHBUF +#endif`,Yk=`#ifdef USE_LOGDEPTHBUF vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,qk=`#ifdef USE_MAP +#endif`,$k=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,Yk=`#ifdef USE_MAP +#endif`,Zk=`#ifdef USE_MAP uniform sampler2D map; -#endif`,$k=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,Kk=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1419,7 +1419,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,Zk=`#if defined( USE_POINTS_UV ) +#endif`,Jk=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1431,19 +1431,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,Kk=`float metalnessFactor = metalness; +#endif`,Qk=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,Jk=`#ifdef USE_METALNESSMAP +#endif`,tz=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,Qk=`#ifdef USE_INSTANCING_MORPH +#endif`,ez=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } -#endif`,tz=`#if defined( USE_MORPHCOLORS ) +#endif`,nz=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1452,12 +1452,12 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,ez=`#ifdef USE_MORPHNORMALS +#endif`,iz=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } -#endif`,nz=`#ifdef USE_MORPHTARGETS +#endif`,sz=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1471,12 +1471,12 @@ IncidentLight directLight; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } -#endif`,iz=`#ifdef USE_MORPHTARGETS +#endif`,rz=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } -#endif`,sz=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,az=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1517,7 +1517,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,rz=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,oz=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1532,25 +1532,25 @@ vec3 nonPerturbedNormal = normal;`,rz=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,az=`#ifndef FLAT_SHADED +#endif`,lz=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,oz=`#ifndef FLAT_SHADED +#endif`,cz=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,lz=`#ifndef FLAT_SHADED +#endif`,hz=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,cz=`#ifdef USE_NORMALMAP +#endif`,uz=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1572,13 +1572,13 @@ vec3 nonPerturbedNormal = normal;`,rz=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,hz=`#ifdef USE_CLEARCOAT +#endif`,fz=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,uz=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,dz=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,fz=`#ifdef USE_CLEARCOATMAP +#endif`,pz=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1587,18 +1587,18 @@ vec3 nonPerturbedNormal = normal;`,rz=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,dz=`#ifdef USE_IRIDESCENCEMAP +#endif`,mz=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,pz=`#ifdef OPAQUE +#endif`,gz=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,mz=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,yz=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1667,9 +1667,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,gz=`#ifdef PREMULTIPLIED_ALPHA +}`,_z=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,yz=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,xz=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1677,22 +1677,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,_z=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,vz=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,xz=`#ifdef DITHERING +#endif`,Mz=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,vz=`float roughnessFactor = roughness; +#endif`,bz=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,Mz=`#ifdef USE_ROUGHNESSMAP +#endif`,wz=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,bz=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Sz=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1878,7 +1878,7 @@ gl_Position = projectionMatrix * mvPosition;`,_z=`#ifdef DITHERING } return mix( 1.0, shadow, shadowIntensity ); } -#endif`,wz=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Ez=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -1919,7 +1919,7 @@ gl_Position = projectionMatrix * mvPosition;`,_z=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,Sz=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,Az=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -1951,7 +1951,7 @@ gl_Position = projectionMatrix * mvPosition;`,_z=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,Ez=`float getShadowMask() { +#endif`,Tz=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -1983,12 +1983,12 @@ gl_Position = projectionMatrix * mvPosition;`,_z=`#ifdef DITHERING #endif #endif return shadow; -}`,Az=`#ifdef USE_SKINNING +}`,Cz=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,Tz=`#ifdef USE_SKINNING +#endif`,Rz=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2003,7 +2003,7 @@ gl_Position = projectionMatrix * mvPosition;`,_z=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,Cz=`#ifdef USE_SKINNING +#endif`,Pz=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2011,7 +2011,7 @@ gl_Position = projectionMatrix * mvPosition;`,_z=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,Rz=`#ifdef USE_SKINNING +#endif`,Iz=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2022,17 +2022,17 @@ gl_Position = projectionMatrix * mvPosition;`,_z=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,Pz=`float specularStrength; +#endif`,Lz=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,Iz=`#ifdef USE_SPECULARMAP +#endif`,Dz=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,Lz=`#if defined( TONE_MAPPING ) +#endif`,Nz=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,Dz=`#ifndef saturate +#endif`,Oz=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2129,7 +2129,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,Nz=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,Fz=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2150,7 +2150,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Nz=`#ifdef USE_TRANSMISS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,Oz=`#ifdef USE_TRANSMISSION +#endif`,Uz=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2281,7 +2281,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Nz=`#ifdef USE_TRANSMISS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,Fz=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,kz=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2351,7 +2351,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Nz=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,Uz=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,zz=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2445,7 +2445,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Nz=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,kz=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,Bz=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2516,7 +2516,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Nz=`#ifdef USE_TRANSMISS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,zz=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Hz=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -2525,12 +2525,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Nz=`#ifdef USE_TRANSMISS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const Bz=`varying vec2 vUv; +#endif`;const Gz=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,Hz=`uniform sampler2D t2D; +}`,Vz=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2542,14 +2542,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,Gz=`varying vec3 vWorldDirection; +}`,Wz=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,Vz=`#ifdef ENVMAP_TYPE_CUBE +}`,jz=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2572,14 +2572,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,Wz=`varying vec3 vWorldDirection; +}`,Xz=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,jz=`uniform samplerCube tCube; +}`,qz=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2589,7 +2589,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,Xz=`#include +}`,Yz=`#include #include #include #include @@ -2616,7 +2616,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,qz=`#if DEPTH_PACKING == 3200 +}`,$z=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2650,7 +2650,7 @@ void main() { #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif -}`,Yz=`#define DISTANCE +}`,Zz=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2677,7 +2677,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,$z=`#define DISTANCE +}`,Kz=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2701,13 +2701,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,Zz=`varying vec3 vWorldDirection; +}`,Jz=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,Kz=`uniform sampler2D tEquirect; +}`,Qz=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2716,7 +2716,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,Jz=`uniform float scale; +}`,tB=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2738,7 +2738,7 @@ void main() { #include #include #include -}`,Qz=`uniform vec3 diffuse; +}`,eB=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2766,7 +2766,7 @@ void main() { #include #include #include -}`,tB=`#include +}`,nB=`#include #include #include #include @@ -2798,7 +2798,7 @@ void main() { #include #include #include -}`,eB=`uniform vec3 diffuse; +}`,iB=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2846,7 +2846,7 @@ void main() { #include #include #include -}`,nB=`#define LAMBERT +}`,sB=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2885,7 +2885,7 @@ void main() { #include #include #include -}`,iB=`#define LAMBERT +}`,rB=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2942,7 +2942,7 @@ void main() { #include #include #include -}`,sB=`#define MATCAP +}`,aB=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -2976,7 +2976,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,rB=`#define MATCAP +}`,oB=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3022,7 +3022,7 @@ void main() { #include #include #include -}`,aB=`#define NORMAL +}`,lB=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3055,7 +3055,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,oB=`#define NORMAL +}`,cB=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3077,7 +3077,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,lB=`#define PHONG +}`,hB=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3116,7 +3116,7 @@ void main() { #include #include #include -}`,cB=`#define PHONG +}`,uB=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3175,7 +3175,7 @@ void main() { #include #include #include -}`,hB=`#define STANDARD +}`,fB=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3218,7 +3218,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,uB=`#define STANDARD +}`,dB=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3343,7 +3343,7 @@ void main() { #include #include #include -}`,fB=`#define TOON +}`,pB=`#define TOON varying vec3 vViewPosition; #include #include @@ -3380,7 +3380,7 @@ void main() { #include #include #include -}`,dB=`#define TOON +}`,mB=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3433,7 +3433,7 @@ void main() { #include #include #include -}`,pB=`uniform float size; +}`,gB=`uniform float size; uniform float scale; #include #include @@ -3464,7 +3464,7 @@ void main() { #include #include #include -}`,mB=`uniform vec3 diffuse; +}`,yB=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3489,7 +3489,7 @@ void main() { #include #include #include -}`,gB=`#include +}`,_B=`#include #include #include #include @@ -3512,7 +3512,7 @@ void main() { #include #include #include -}`,yB=`uniform vec3 color; +}`,xB=`uniform vec3 color; uniform float opacity; #include #include @@ -3528,7 +3528,7 @@ void main() { #include #include #include -}`,_B=`uniform float rotation; +}`,vB=`uniform float rotation; uniform vec2 center; #include #include @@ -3552,7 +3552,7 @@ void main() { #include #include #include -}`,xB=`uniform vec3 diffuse; +}`,MB=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3577,7 +3577,7 @@ void main() { #include #include #include -}`,Pe={alphahash_fragment:HU,alphahash_pars_fragment:GU,alphamap_fragment:VU,alphamap_pars_fragment:WU,alphatest_fragment:jU,alphatest_pars_fragment:XU,aomap_fragment:qU,aomap_pars_fragment:YU,batching_pars_vertex:$U,batching_vertex:ZU,begin_vertex:KU,beginnormal_vertex:JU,bsdfs:QU,iridescence_fragment:tk,bumpmap_pars_fragment:ek,clipping_planes_fragment:nk,clipping_planes_pars_fragment:ik,clipping_planes_pars_vertex:sk,clipping_planes_vertex:rk,color_fragment:ak,color_pars_fragment:ok,color_pars_vertex:lk,color_vertex:ck,common:hk,cube_uv_reflection_fragment:uk,defaultnormal_vertex:fk,displacementmap_pars_vertex:dk,displacementmap_vertex:pk,emissivemap_fragment:mk,emissivemap_pars_fragment:gk,colorspace_fragment:yk,colorspace_pars_fragment:_k,envmap_fragment:xk,envmap_common_pars_fragment:vk,envmap_pars_fragment:Mk,envmap_pars_vertex:bk,envmap_physical_pars_fragment:Dk,envmap_vertex:wk,fog_vertex:Sk,fog_pars_vertex:Ek,fog_fragment:Ak,fog_pars_fragment:Tk,gradientmap_pars_fragment:Ck,lightmap_pars_fragment:Rk,lights_lambert_fragment:Pk,lights_lambert_pars_fragment:Ik,lights_pars_begin:Lk,lights_toon_fragment:Nk,lights_toon_pars_fragment:Ok,lights_phong_fragment:Fk,lights_phong_pars_fragment:Uk,lights_physical_fragment:kk,lights_physical_pars_fragment:zk,lights_fragment_begin:Bk,lights_fragment_maps:Hk,lights_fragment_end:Gk,logdepthbuf_fragment:Vk,logdepthbuf_pars_fragment:Wk,logdepthbuf_pars_vertex:jk,logdepthbuf_vertex:Xk,map_fragment:qk,map_pars_fragment:Yk,map_particle_fragment:$k,map_particle_pars_fragment:Zk,metalnessmap_fragment:Kk,metalnessmap_pars_fragment:Jk,morphinstance_vertex:Qk,morphcolor_vertex:tz,morphnormal_vertex:ez,morphtarget_pars_vertex:nz,morphtarget_vertex:iz,normal_fragment_begin:sz,normal_fragment_maps:rz,normal_pars_fragment:az,normal_pars_vertex:oz,normal_vertex:lz,normalmap_pars_fragment:cz,clearcoat_normal_fragment_begin:hz,clearcoat_normal_fragment_maps:uz,clearcoat_pars_fragment:fz,iridescence_pars_fragment:dz,opaque_fragment:pz,packing:mz,premultiplied_alpha_fragment:gz,project_vertex:yz,dithering_fragment:_z,dithering_pars_fragment:xz,roughnessmap_fragment:vz,roughnessmap_pars_fragment:Mz,shadowmap_pars_fragment:bz,shadowmap_pars_vertex:wz,shadowmap_vertex:Sz,shadowmask_pars_fragment:Ez,skinbase_vertex:Az,skinning_pars_vertex:Tz,skinning_vertex:Cz,skinnormal_vertex:Rz,specularmap_fragment:Pz,specularmap_pars_fragment:Iz,tonemapping_fragment:Lz,tonemapping_pars_fragment:Dz,transmission_fragment:Nz,transmission_pars_fragment:Oz,uv_pars_fragment:Fz,uv_pars_vertex:Uz,uv_vertex:kz,worldpos_vertex:zz,background_vert:Bz,background_frag:Hz,backgroundCube_vert:Gz,backgroundCube_frag:Vz,cube_vert:Wz,cube_frag:jz,depth_vert:Xz,depth_frag:qz,distanceRGBA_vert:Yz,distanceRGBA_frag:$z,equirect_vert:Zz,equirect_frag:Kz,linedashed_vert:Jz,linedashed_frag:Qz,meshbasic_vert:tB,meshbasic_frag:eB,meshlambert_vert:nB,meshlambert_frag:iB,meshmatcap_vert:sB,meshmatcap_frag:rB,meshnormal_vert:aB,meshnormal_frag:oB,meshphong_vert:lB,meshphong_frag:cB,meshphysical_vert:hB,meshphysical_frag:uB,meshtoon_vert:fB,meshtoon_frag:dB,points_vert:pB,points_frag:mB,shadow_vert:gB,shadow_frag:yB,sprite_vert:_B,sprite_frag:xB},Xt={common:{diffuse:{value:new kt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Te},alphaMap:{value:null},alphaMapTransform:{value:new Te},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Te}},envmap:{envMap:{value:null},envMapRotation:{value:new Te},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Te}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Te}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Te},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Te},normalScale:{value:new xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Te},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Te}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Te}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Te}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new kt(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 kt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Te},alphaTest:{value:0},uvTransform:{value:new Te}},sprite:{diffuse:{value:new kt(16777215)},opacity:{value:1},center:{value:new xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Te},alphaMap:{value:null},alphaMapTransform:{value:new Te},alphaTest:{value:0}}},Gs={basic:{uniforms:xi([Xt.common,Xt.specularmap,Xt.envmap,Xt.aomap,Xt.lightmap,Xt.fog]),vertexShader:Pe.meshbasic_vert,fragmentShader:Pe.meshbasic_frag},lambert:{uniforms:xi([Xt.common,Xt.specularmap,Xt.envmap,Xt.aomap,Xt.lightmap,Xt.emissivemap,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,Xt.fog,Xt.lights,{emissive:{value:new kt(0)}}]),vertexShader:Pe.meshlambert_vert,fragmentShader:Pe.meshlambert_frag},phong:{uniforms:xi([Xt.common,Xt.specularmap,Xt.envmap,Xt.aomap,Xt.lightmap,Xt.emissivemap,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,Xt.fog,Xt.lights,{emissive:{value:new kt(0)},specular:{value:new kt(1118481)},shininess:{value:30}}]),vertexShader:Pe.meshphong_vert,fragmentShader:Pe.meshphong_frag},standard:{uniforms:xi([Xt.common,Xt.envmap,Xt.aomap,Xt.lightmap,Xt.emissivemap,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,Xt.roughnessmap,Xt.metalnessmap,Xt.fog,Xt.lights,{emissive:{value:new kt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Pe.meshphysical_vert,fragmentShader:Pe.meshphysical_frag},toon:{uniforms:xi([Xt.common,Xt.aomap,Xt.lightmap,Xt.emissivemap,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,Xt.gradientmap,Xt.fog,Xt.lights,{emissive:{value:new kt(0)}}]),vertexShader:Pe.meshtoon_vert,fragmentShader:Pe.meshtoon_frag},matcap:{uniforms:xi([Xt.common,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,Xt.fog,{matcap:{value:null}}]),vertexShader:Pe.meshmatcap_vert,fragmentShader:Pe.meshmatcap_frag},points:{uniforms:xi([Xt.points,Xt.fog]),vertexShader:Pe.points_vert,fragmentShader:Pe.points_frag},dashed:{uniforms:xi([Xt.common,Xt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Pe.linedashed_vert,fragmentShader:Pe.linedashed_frag},depth:{uniforms:xi([Xt.common,Xt.displacementmap]),vertexShader:Pe.depth_vert,fragmentShader:Pe.depth_frag},normal:{uniforms:xi([Xt.common,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,{opacity:{value:1}}]),vertexShader:Pe.meshnormal_vert,fragmentShader:Pe.meshnormal_frag},sprite:{uniforms:xi([Xt.sprite,Xt.fog]),vertexShader:Pe.sprite_vert,fragmentShader:Pe.sprite_frag},background:{uniforms:{uvTransform:{value:new Te},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Pe.background_vert,fragmentShader:Pe.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Te}},vertexShader:Pe.backgroundCube_vert,fragmentShader:Pe.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Pe.cube_vert,fragmentShader:Pe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Pe.equirect_vert,fragmentShader:Pe.equirect_frag},distanceRGBA:{uniforms:xi([Xt.common,Xt.displacementmap,{referencePosition:{value:new O},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Pe.distanceRGBA_vert,fragmentShader:Pe.distanceRGBA_frag},shadow:{uniforms:xi([Xt.lights,Xt.fog,{color:{value:new kt(0)},opacity:{value:1}}]),vertexShader:Pe.shadow_vert,fragmentShader:Pe.shadow_frag}};Gs.physical={uniforms:xi([Gs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Te},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Te},clearcoatNormalScale:{value:new xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Te},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Te},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Te},sheen:{value:0},sheenColor:{value:new kt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Te},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Te},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Te},transmissionSamplerSize:{value:new xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Te},attenuationDistance:{value:0},attenuationColor:{value:new kt(0)},specularColor:{value:new kt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Te},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Te},anisotropyVector:{value:new xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Te}}]),vertexShader:Pe.meshphysical_vert,fragmentShader:Pe.meshphysical_frag};const zp={r:0,b:0,g:0},Io=new Ys,vB=new ye;function MB(n,t,e,i,s,r,a){const o=new kt(0);let l=r===!0?0:1,c,h,u=null,p=0,m=null;function g(S){let w=S.isScene===!0?S.background:null;return w&&w.isTexture&&(w=(S.backgroundBlurriness>0?e:t).get(w)),w}function x(S){let w=!1;const R=g(S);R===null?_(o,l):R&&R.isColor&&(_(R,1),w=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,a):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,a),(n.autoClear||w)&&(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(S,w){const R=g(w);R&&(R.isCubeTexture||R.mapping===ch)?(h===void 0&&(h=new Mn(new io(1,1,1),new $s({name:"BackgroundCubeMaterial",uniforms:Qc(Gs.backgroundCube.uniforms),vertexShader:Gs.backgroundCube.vertexShader,fragmentShader:Gs.backgroundCube.fragmentShader,side:Si,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(T,C,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),Io.copy(w.backgroundRotation),Io.x*=-1,Io.y*=-1,Io.z*=-1,R.isCubeTexture&&R.isRenderTargetTexture===!1&&(Io.y*=-1,Io.z*=-1),h.material.uniforms.envMap.value=R,h.material.uniforms.flipEnvMap.value=R.isCubeTexture&&R.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(vB.makeRotationFromEuler(Io)),h.material.toneMapped=Ue.getTransfer(R.colorSpace)!==Je,(u!==R||p!==R.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,u=R,p=R.version,m=n.toneMapping),h.layers.enableAll(),S.unshift(h,h.geometry,h.material,0,0,null)):R&&R.isTexture&&(c===void 0&&(c=new Mn(new fh(2,2),new $s({name:"BackgroundMaterial",uniforms:Qc(Gs.background.uniforms),vertexShader:Gs.background.vertexShader,fragmentShader:Gs.background.fragmentShader,side:js,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=R,c.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,c.material.toneMapped=Ue.getTransfer(R.colorSpace)!==Je,R.matrixAutoUpdate===!0&&R.updateMatrix(),c.material.uniforms.uvTransform.value.copy(R.matrix),(u!==R||p!==R.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,u=R,p=R.version,m=n.toneMapping),c.layers.enableAll(),S.unshift(c,c.geometry,c.material,0,0,null))}function _(S,w){S.getRGB(zp,rC(n)),i.buffers.color.setClear(zp.r,zp.g,zp.b,w,a)}function b(){h!==void 0&&(h.geometry.dispose(),h.material.dispose()),c!==void 0&&(c.geometry.dispose(),c.material.dispose())}return{getClearColor:function(){return o},setClearColor:function(S,w=1){o.set(S),l=w,_(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(S){l=S,_(o,l)},render:x,addToRenderList:y,dispose:b}}function bB(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=p(null);let r=s,a=!1;function o(E,D,z,G,W){let Q=!1;const Y=u(G,z,D);r!==Y&&(r=Y,c(r.object)),Q=m(E,G,z,W),Q&&g(E,G,z,W),W!==null&&t.update(W,n.ELEMENT_ARRAY_BUFFER),(Q||a)&&(a=!1,w(E,D,z,G),W!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(W).buffer))}function l(){return n.createVertexArray()}function c(E){return n.bindVertexArray(E)}function h(E){return n.deleteVertexArray(E)}function u(E,D,z){const G=z.wireframe===!0;let W=i[E.id];W===void 0&&(W={},i[E.id]=W);let Q=W[D.id];Q===void 0&&(Q={},W[D.id]=Q);let Y=Q[G];return Y===void 0&&(Y=p(l()),Q[G]=Y),Y}function p(E){const D=[],z=[],G=[];for(let W=0;W=0){const it=W[H];let $=Q[H];if($===void 0&&(H==="instanceMatrix"&&E.instanceMatrix&&($=E.instanceMatrix),H==="instanceColor"&&E.instanceColor&&($=E.instanceColor)),it===void 0||it.attribute!==$||$&&it.data!==$.data)return!0;Y++}return r.attributesNum!==Y||r.index!==G}function g(E,D,z,G){const W={},Q=D.attributes;let Y=0;const ot=z.getAttributes();for(const H in ot)if(ot[H].location>=0){let it=Q[H];it===void 0&&(H==="instanceMatrix"&&E.instanceMatrix&&(it=E.instanceMatrix),H==="instanceColor"&&E.instanceColor&&(it=E.instanceColor));const $={};$.attribute=it,it&&it.data&&($.data=it.data),W[H]=$,Y++}r.attributes=W,r.attributesNum=Y,r.index=G}function x(){const E=r.newAttributes;for(let D=0,z=E.length;D=0){let Z=W[ot];if(Z===void 0&&(ot==="instanceMatrix"&&E.instanceMatrix&&(Z=E.instanceMatrix),ot==="instanceColor"&&E.instanceColor&&(Z=E.instanceColor)),Z!==void 0){const it=Z.normalized,$=Z.itemSize,lt=t.get(Z);if(lt===void 0)continue;const _t=lt.buffer,q=lt.type,rt=lt.bytesPerElement,St=q===n.INT||q===n.UNSIGNED_INT||Z.gpuType===Y0;if(Z.isInterleavedBufferAttribute){const dt=Z.data,It=dt.stride,Ht=Z.offset;if(dt.isInstancedInterleavedBuffer){for(let Bt=0;Bt0&&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=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),m=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),g=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),x=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),_=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),S=n.getParameter(n.MAX_VARYING_VECTORS),w=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),R=g>0,T=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:p,maxTextures:m,maxVertexTextures:g,maxTextureSize:x,maxCubemapSize:y,maxAttributes:_,maxVertexUniforms:b,maxVaryings:S,maxFragmentUniforms:w,vertexTextures:R,maxSamples:T}}function EB(n){const t=this;let e=null,i=0,s=!1,r=!1;const a=new gr,o=new Te,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||s;return s=p,i=u.length,m},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(u,p){e=h(u,p,0)},this.setState=function(u,p,m){const g=u.clippingPlanes,x=u.clipIntersection,y=u.clipShadows,_=n.get(u);if(!s||g===null||g.length===0||r&&!y)r?h(null):c();else{const b=r?0:i,S=b*4;let w=_.clippingState||null;l.value=w,w=h(g,p,S,m);for(let R=0;R!==S;++R)w[R]=e[R];_.clippingState=w,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=b}};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 x=u!==null?u.length:0;let y=null;if(x!==0){if(y=l.value,g!==!0||y===null){const _=m+x*4,b=p.matrixWorldInverse;o.getNormalMatrix(b),(y===null||y.length<_)&&(y=new Float32Array(_));for(let S=0,w=m;S!==x;++S,w+=4)a.copy(u[S]).applyMatrix4(b,o),a.normal.toArray(y,w),y[w+3]=a.constant}l.value=y,l.needsUpdate=!0}return t.numPlanes=x,t.numIntersection=0,y}}function AB(n){let t=new WeakMap;function e(a,o){return o===ju?a.mapping=ua:o===Xu&&(a.mapping=Ya),a}function i(a){if(a&&a.isTexture){const o=a.mapping;if(o===ju||o===Xu)if(t.has(a)){const l=t.get(a).texture;return e(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new lC(l.height);return c.fromEquirectangularTexture(n,a),t.set(a,c),a.addEventListener("dispose",s),e(c.texture,a.mapping)}else return null}}return a}function s(a){const o=a.target;o.removeEventListener("dispose",s);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function r(){t=new WeakMap}return{get:i,dispose:r}}const Rc=4,NS=[.125,.215,.35,.446,.526,.582],Ho=20,P_=new aa,OS=new kt;let I_=null,L_=0,D_=0,N_=!1;const ko=(1+Math.sqrt(5))/2,ic=1/ko,FS=[new O(-ko,ic,0),new O(ko,ic,0),new O(-ic,0,ko),new O(ic,0,ko),new O(0,ko,-ic),new O(0,ko,ic),new O(-1,1,-1),new O(1,1,-1),new O(-1,1,1),new O(1,1,1)];class sv{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,s=100){I_=this._renderer.getRenderTarget(),L_=this._renderer.getActiveCubeFace(),D_=this._renderer.getActiveMipmapLevel(),N_=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,i,s,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=zS(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=kS(),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?S:0,S,S),h.setRenderTarget(s),x&&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,s=t.mapping===ua||t.mapping===Ya;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=zS()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=kS());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new Mn(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;const l=this._cubeSize;Bp(e,0,0,3*l,2*l),i.setRenderTarget(e),i.render(a,P_)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rHo&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${Ho}`);const _=[];let b=0;for(let C=0;CS-Rc?s-S+Rc:0),T=4*(this._cubeSize-w);Bp(e,R,T,3*w,2*w),l.setRenderTarget(e),l.render(u,P_)}}function TB(n){const t=[],e=[],i=[];let s=n;const r=n-Rc+1+NS.length;for(let a=0;an-Rc?l=NS[a-n+Rc-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,x=3,y=2,_=1,b=new Float32Array(x*g*m),S=new Float32Array(y*g*m),w=new Float32Array(_*g*m);for(let T=0;T2?0:-1,P=[C,L,0,C+2/3,L,0,C+2/3,L+1,0,C,L,0,C+2/3,L+1,0,C,L+1,0];b.set(P,x*g*T),S.set(p,y*g*T);const E=[T,T,T,T,T,T];w.set(E,_*g*T)}const R=new ve;R.setAttribute("position",new De(b,x)),R.setAttribute("uv",new De(S,y)),R.setAttribute("faceIndex",new De(w,_)),t.push(R),s>Rc&&s--}return{lodPlanes:t,sizeLods:e,sigmas:i}}function US(n,t,e){const i=new qs(n,t,e);return i.texture.mapping=ch,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Bp(n,t,e,i,s){n.viewport.set(t,e,i,s),n.scissor.set(t,e,i,s)}function CB(n,t,e){const i=new Float32Array(Ho),s=new O(0,1,0);return new $s({name:"SphericalGaussianBlur",defines:{n:Ho,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:s}},vertexShader:G1(),fragmentShader:` +}`,Pe={alphahash_fragment:VU,alphahash_pars_fragment:WU,alphamap_fragment:jU,alphamap_pars_fragment:XU,alphatest_fragment:qU,alphatest_pars_fragment:YU,aomap_fragment:$U,aomap_pars_fragment:ZU,batching_pars_vertex:KU,batching_vertex:JU,begin_vertex:QU,beginnormal_vertex:tk,bsdfs:ek,iridescence_fragment:nk,bumpmap_pars_fragment:ik,clipping_planes_fragment:sk,clipping_planes_pars_fragment:rk,clipping_planes_pars_vertex:ak,clipping_planes_vertex:ok,color_fragment:lk,color_pars_fragment:ck,color_pars_vertex:hk,color_vertex:uk,common:fk,cube_uv_reflection_fragment:dk,defaultnormal_vertex:pk,displacementmap_pars_vertex:mk,displacementmap_vertex:gk,emissivemap_fragment:yk,emissivemap_pars_fragment:_k,colorspace_fragment:xk,colorspace_pars_fragment:vk,envmap_fragment:Mk,envmap_common_pars_fragment:bk,envmap_pars_fragment:wk,envmap_pars_vertex:Sk,envmap_physical_pars_fragment:Ok,envmap_vertex:Ek,fog_vertex:Ak,fog_pars_vertex:Tk,fog_fragment:Ck,fog_pars_fragment:Rk,gradientmap_pars_fragment:Pk,lightmap_pars_fragment:Ik,lights_lambert_fragment:Lk,lights_lambert_pars_fragment:Dk,lights_pars_begin:Nk,lights_toon_fragment:Fk,lights_toon_pars_fragment:Uk,lights_phong_fragment:kk,lights_phong_pars_fragment:zk,lights_physical_fragment:Bk,lights_physical_pars_fragment:Hk,lights_fragment_begin:Gk,lights_fragment_maps:Vk,lights_fragment_end:Wk,logdepthbuf_fragment:jk,logdepthbuf_pars_fragment:Xk,logdepthbuf_pars_vertex:qk,logdepthbuf_vertex:Yk,map_fragment:$k,map_pars_fragment:Zk,map_particle_fragment:Kk,map_particle_pars_fragment:Jk,metalnessmap_fragment:Qk,metalnessmap_pars_fragment:tz,morphinstance_vertex:ez,morphcolor_vertex:nz,morphnormal_vertex:iz,morphtarget_pars_vertex:sz,morphtarget_vertex:rz,normal_fragment_begin:az,normal_fragment_maps:oz,normal_pars_fragment:lz,normal_pars_vertex:cz,normal_vertex:hz,normalmap_pars_fragment:uz,clearcoat_normal_fragment_begin:fz,clearcoat_normal_fragment_maps:dz,clearcoat_pars_fragment:pz,iridescence_pars_fragment:mz,opaque_fragment:gz,packing:yz,premultiplied_alpha_fragment:_z,project_vertex:xz,dithering_fragment:vz,dithering_pars_fragment:Mz,roughnessmap_fragment:bz,roughnessmap_pars_fragment:wz,shadowmap_pars_fragment:Sz,shadowmap_pars_vertex:Ez,shadowmap_vertex:Az,shadowmask_pars_fragment:Tz,skinbase_vertex:Cz,skinning_pars_vertex:Rz,skinning_vertex:Pz,skinnormal_vertex:Iz,specularmap_fragment:Lz,specularmap_pars_fragment:Dz,tonemapping_fragment:Nz,tonemapping_pars_fragment:Oz,transmission_fragment:Fz,transmission_pars_fragment:Uz,uv_pars_fragment:kz,uv_pars_vertex:zz,uv_vertex:Bz,worldpos_vertex:Hz,background_vert:Gz,background_frag:Vz,backgroundCube_vert:Wz,backgroundCube_frag:jz,cube_vert:Xz,cube_frag:qz,depth_vert:Yz,depth_frag:$z,distanceRGBA_vert:Zz,distanceRGBA_frag:Kz,equirect_vert:Jz,equirect_frag:Qz,linedashed_vert:tB,linedashed_frag:eB,meshbasic_vert:nB,meshbasic_frag:iB,meshlambert_vert:sB,meshlambert_frag:rB,meshmatcap_vert:aB,meshmatcap_frag:oB,meshnormal_vert:lB,meshnormal_frag:cB,meshphong_vert:hB,meshphong_frag:uB,meshphysical_vert:fB,meshphysical_frag:dB,meshtoon_vert:pB,meshtoon_frag:mB,points_vert:gB,points_frag:yB,shadow_vert:_B,shadow_frag:xB,sprite_vert:vB,sprite_frag:MB},Xt={common:{diffuse:{value:new kt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Te},alphaMap:{value:null},alphaMapTransform:{value:new Te},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Te}},envmap:{envMap:{value:null},envMapRotation:{value:new Te},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Te}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Te}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Te},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Te},normalScale:{value:new xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Te},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Te}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Te}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Te}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new kt(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 kt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Te},alphaTest:{value:0},uvTransform:{value:new Te}},sprite:{diffuse:{value:new kt(16777215)},opacity:{value:1},center:{value:new xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Te},alphaMap:{value:null},alphaMapTransform:{value:new Te},alphaTest:{value:0}}},Gs={basic:{uniforms:xi([Xt.common,Xt.specularmap,Xt.envmap,Xt.aomap,Xt.lightmap,Xt.fog]),vertexShader:Pe.meshbasic_vert,fragmentShader:Pe.meshbasic_frag},lambert:{uniforms:xi([Xt.common,Xt.specularmap,Xt.envmap,Xt.aomap,Xt.lightmap,Xt.emissivemap,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,Xt.fog,Xt.lights,{emissive:{value:new kt(0)}}]),vertexShader:Pe.meshlambert_vert,fragmentShader:Pe.meshlambert_frag},phong:{uniforms:xi([Xt.common,Xt.specularmap,Xt.envmap,Xt.aomap,Xt.lightmap,Xt.emissivemap,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,Xt.fog,Xt.lights,{emissive:{value:new kt(0)},specular:{value:new kt(1118481)},shininess:{value:30}}]),vertexShader:Pe.meshphong_vert,fragmentShader:Pe.meshphong_frag},standard:{uniforms:xi([Xt.common,Xt.envmap,Xt.aomap,Xt.lightmap,Xt.emissivemap,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,Xt.roughnessmap,Xt.metalnessmap,Xt.fog,Xt.lights,{emissive:{value:new kt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Pe.meshphysical_vert,fragmentShader:Pe.meshphysical_frag},toon:{uniforms:xi([Xt.common,Xt.aomap,Xt.lightmap,Xt.emissivemap,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,Xt.gradientmap,Xt.fog,Xt.lights,{emissive:{value:new kt(0)}}]),vertexShader:Pe.meshtoon_vert,fragmentShader:Pe.meshtoon_frag},matcap:{uniforms:xi([Xt.common,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,Xt.fog,{matcap:{value:null}}]),vertexShader:Pe.meshmatcap_vert,fragmentShader:Pe.meshmatcap_frag},points:{uniforms:xi([Xt.points,Xt.fog]),vertexShader:Pe.points_vert,fragmentShader:Pe.points_frag},dashed:{uniforms:xi([Xt.common,Xt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Pe.linedashed_vert,fragmentShader:Pe.linedashed_frag},depth:{uniforms:xi([Xt.common,Xt.displacementmap]),vertexShader:Pe.depth_vert,fragmentShader:Pe.depth_frag},normal:{uniforms:xi([Xt.common,Xt.bumpmap,Xt.normalmap,Xt.displacementmap,{opacity:{value:1}}]),vertexShader:Pe.meshnormal_vert,fragmentShader:Pe.meshnormal_frag},sprite:{uniforms:xi([Xt.sprite,Xt.fog]),vertexShader:Pe.sprite_vert,fragmentShader:Pe.sprite_frag},background:{uniforms:{uvTransform:{value:new Te},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Pe.background_vert,fragmentShader:Pe.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Te}},vertexShader:Pe.backgroundCube_vert,fragmentShader:Pe.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Pe.cube_vert,fragmentShader:Pe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Pe.equirect_vert,fragmentShader:Pe.equirect_frag},distanceRGBA:{uniforms:xi([Xt.common,Xt.displacementmap,{referencePosition:{value:new O},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Pe.distanceRGBA_vert,fragmentShader:Pe.distanceRGBA_frag},shadow:{uniforms:xi([Xt.lights,Xt.fog,{color:{value:new kt(0)},opacity:{value:1}}]),vertexShader:Pe.shadow_vert,fragmentShader:Pe.shadow_frag}};Gs.physical={uniforms:xi([Gs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Te},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Te},clearcoatNormalScale:{value:new xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Te},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Te},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Te},sheen:{value:0},sheenColor:{value:new kt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Te},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Te},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Te},transmissionSamplerSize:{value:new xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Te},attenuationDistance:{value:0},attenuationColor:{value:new kt(0)},specularColor:{value:new kt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Te},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Te},anisotropyVector:{value:new xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Te}}]),vertexShader:Pe.meshphysical_vert,fragmentShader:Pe.meshphysical_frag};const zp={r:0,b:0,g:0},Io=new Ys,bB=new ye;function wB(n,t,e,i,s,r,a){const o=new kt(0);let l=r===!0?0:1,c,h,u=null,p=0,m=null;function g(S){let w=S.isScene===!0?S.background:null;return w&&w.isTexture&&(w=(S.backgroundBlurriness>0?e:t).get(w)),w}function x(S){let w=!1;const R=g(S);R===null?_(o,l):R&&R.isColor&&(_(R,1),w=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,a):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,a),(n.autoClear||w)&&(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(S,w){const R=g(w);R&&(R.isCubeTexture||R.mapping===ch)?(h===void 0&&(h=new Mn(new io(1,1,1),new $s({name:"BackgroundCubeMaterial",uniforms:Qc(Gs.backgroundCube.uniforms),vertexShader:Gs.backgroundCube.vertexShader,fragmentShader:Gs.backgroundCube.fragmentShader,side:Si,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(T,C,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),Io.copy(w.backgroundRotation),Io.x*=-1,Io.y*=-1,Io.z*=-1,R.isCubeTexture&&R.isRenderTargetTexture===!1&&(Io.y*=-1,Io.z*=-1),h.material.uniforms.envMap.value=R,h.material.uniforms.flipEnvMap.value=R.isCubeTexture&&R.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(bB.makeRotationFromEuler(Io)),h.material.toneMapped=Ue.getTransfer(R.colorSpace)!==Je,(u!==R||p!==R.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,u=R,p=R.version,m=n.toneMapping),h.layers.enableAll(),S.unshift(h,h.geometry,h.material,0,0,null)):R&&R.isTexture&&(c===void 0&&(c=new Mn(new fh(2,2),new $s({name:"BackgroundMaterial",uniforms:Qc(Gs.background.uniforms),vertexShader:Gs.background.vertexShader,fragmentShader:Gs.background.fragmentShader,side:js,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=R,c.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,c.material.toneMapped=Ue.getTransfer(R.colorSpace)!==Je,R.matrixAutoUpdate===!0&&R.updateMatrix(),c.material.uniforms.uvTransform.value.copy(R.matrix),(u!==R||p!==R.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,u=R,p=R.version,m=n.toneMapping),c.layers.enableAll(),S.unshift(c,c.geometry,c.material,0,0,null))}function _(S,w){S.getRGB(zp,rC(n)),i.buffers.color.setClear(zp.r,zp.g,zp.b,w,a)}function b(){h!==void 0&&(h.geometry.dispose(),h.material.dispose()),c!==void 0&&(c.geometry.dispose(),c.material.dispose())}return{getClearColor:function(){return o},setClearColor:function(S,w=1){o.set(S),l=w,_(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(S){l=S,_(o,l)},render:x,addToRenderList:y,dispose:b}}function SB(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=p(null);let r=s,a=!1;function o(E,D,z,G,W){let Q=!1;const Y=u(G,z,D);r!==Y&&(r=Y,c(r.object)),Q=m(E,G,z,W),Q&&g(E,G,z,W),W!==null&&t.update(W,n.ELEMENT_ARRAY_BUFFER),(Q||a)&&(a=!1,w(E,D,z,G),W!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(W).buffer))}function l(){return n.createVertexArray()}function c(E){return n.bindVertexArray(E)}function h(E){return n.deleteVertexArray(E)}function u(E,D,z){const G=z.wireframe===!0;let W=i[E.id];W===void 0&&(W={},i[E.id]=W);let Q=W[D.id];Q===void 0&&(Q={},W[D.id]=Q);let Y=Q[G];return Y===void 0&&(Y=p(l()),Q[G]=Y),Y}function p(E){const D=[],z=[],G=[];for(let W=0;W=0){const it=W[H];let $=Q[H];if($===void 0&&(H==="instanceMatrix"&&E.instanceMatrix&&($=E.instanceMatrix),H==="instanceColor"&&E.instanceColor&&($=E.instanceColor)),it===void 0||it.attribute!==$||$&&it.data!==$.data)return!0;Y++}return r.attributesNum!==Y||r.index!==G}function g(E,D,z,G){const W={},Q=D.attributes;let Y=0;const ot=z.getAttributes();for(const H in ot)if(ot[H].location>=0){let it=Q[H];it===void 0&&(H==="instanceMatrix"&&E.instanceMatrix&&(it=E.instanceMatrix),H==="instanceColor"&&E.instanceColor&&(it=E.instanceColor));const $={};$.attribute=it,it&&it.data&&($.data=it.data),W[H]=$,Y++}r.attributes=W,r.attributesNum=Y,r.index=G}function x(){const E=r.newAttributes;for(let D=0,z=E.length;D=0){let Z=W[ot];if(Z===void 0&&(ot==="instanceMatrix"&&E.instanceMatrix&&(Z=E.instanceMatrix),ot==="instanceColor"&&E.instanceColor&&(Z=E.instanceColor)),Z!==void 0){const it=Z.normalized,$=Z.itemSize,lt=t.get(Z);if(lt===void 0)continue;const _t=lt.buffer,q=lt.type,rt=lt.bytesPerElement,St=q===n.INT||q===n.UNSIGNED_INT||Z.gpuType===Y0;if(Z.isInterleavedBufferAttribute){const dt=Z.data,It=dt.stride,Ht=Z.offset;if(dt.isInstancedInterleavedBuffer){for(let Bt=0;Bt0&&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=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),m=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),g=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),x=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),_=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),S=n.getParameter(n.MAX_VARYING_VECTORS),w=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),R=g>0,T=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:p,maxTextures:m,maxVertexTextures:g,maxTextureSize:x,maxCubemapSize:y,maxAttributes:_,maxVertexUniforms:b,maxVaryings:S,maxFragmentUniforms:w,vertexTextures:R,maxSamples:T}}function TB(n){const t=this;let e=null,i=0,s=!1,r=!1;const a=new gr,o=new Te,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||s;return s=p,i=u.length,m},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(u,p){e=h(u,p,0)},this.setState=function(u,p,m){const g=u.clippingPlanes,x=u.clipIntersection,y=u.clipShadows,_=n.get(u);if(!s||g===null||g.length===0||r&&!y)r?h(null):c();else{const b=r?0:i,S=b*4;let w=_.clippingState||null;l.value=w,w=h(g,p,S,m);for(let R=0;R!==S;++R)w[R]=e[R];_.clippingState=w,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=b}};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 x=u!==null?u.length:0;let y=null;if(x!==0){if(y=l.value,g!==!0||y===null){const _=m+x*4,b=p.matrixWorldInverse;o.getNormalMatrix(b),(y===null||y.length<_)&&(y=new Float32Array(_));for(let S=0,w=m;S!==x;++S,w+=4)a.copy(u[S]).applyMatrix4(b,o),a.normal.toArray(y,w),y[w+3]=a.constant}l.value=y,l.needsUpdate=!0}return t.numPlanes=x,t.numIntersection=0,y}}function CB(n){let t=new WeakMap;function e(a,o){return o===ju?a.mapping=ua:o===Xu&&(a.mapping=Ya),a}function i(a){if(a&&a.isTexture){const o=a.mapping;if(o===ju||o===Xu)if(t.has(a)){const l=t.get(a).texture;return e(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new lC(l.height);return c.fromEquirectangularTexture(n,a),t.set(a,c),a.addEventListener("dispose",s),e(c.texture,a.mapping)}else return null}}return a}function s(a){const o=a.target;o.removeEventListener("dispose",s);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function r(){t=new WeakMap}return{get:i,dispose:r}}const Rc=4,NS=[.125,.215,.35,.446,.526,.582],Ho=20,P_=new aa,OS=new kt;let I_=null,L_=0,D_=0,N_=!1;const ko=(1+Math.sqrt(5))/2,ic=1/ko,FS=[new O(-ko,ic,0),new O(ko,ic,0),new O(-ic,0,ko),new O(ic,0,ko),new O(0,ko,-ic),new O(0,ko,ic),new O(-1,1,-1),new O(1,1,-1),new O(-1,1,1),new O(1,1,1)];class sv{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,s=100){I_=this._renderer.getRenderTarget(),L_=this._renderer.getActiveCubeFace(),D_=this._renderer.getActiveMipmapLevel(),N_=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,i,s,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=zS(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=kS(),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?S:0,S,S),h.setRenderTarget(s),x&&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,s=t.mapping===ua||t.mapping===Ya;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=zS()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=kS());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new Mn(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;const l=this._cubeSize;Bp(e,0,0,3*l,2*l),i.setRenderTarget(e),i.render(a,P_)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rHo&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${Ho}`);const _=[];let b=0;for(let C=0;CS-Rc?s-S+Rc:0),T=4*(this._cubeSize-w);Bp(e,R,T,3*w,2*w),l.setRenderTarget(e),l.render(u,P_)}}function RB(n){const t=[],e=[],i=[];let s=n;const r=n-Rc+1+NS.length;for(let a=0;an-Rc?l=NS[a-n+Rc-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,x=3,y=2,_=1,b=new Float32Array(x*g*m),S=new Float32Array(y*g*m),w=new Float32Array(_*g*m);for(let T=0;T2?0:-1,P=[C,L,0,C+2/3,L,0,C+2/3,L+1,0,C,L,0,C+2/3,L+1,0,C,L+1,0];b.set(P,x*g*T),S.set(p,y*g*T);const E=[T,T,T,T,T,T];w.set(E,_*g*T)}const R=new ve;R.setAttribute("position",new De(b,x)),R.setAttribute("uv",new De(S,y)),R.setAttribute("faceIndex",new De(w,_)),t.push(R),s>Rc&&s--}return{lodPlanes:t,sizeLods:e,sigmas:i}}function US(n,t,e){const i=new qs(n,t,e);return i.texture.mapping=ch,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Bp(n,t,e,i,s){n.viewport.set(t,e,i,s),n.scissor.set(t,e,i,s)}function PB(n,t,e){const i=new Float32Array(Ho),s=new O(0,1,0);return new $s({name:"SphericalGaussianBlur",defines:{n:Ho,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:s}},vertexShader:G1(),fragmentShader:` precision mediump float; precision mediump int; @@ -3727,17 +3727,17 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function RB(n){let t=new WeakMap,e=null;function i(o){if(o&&o.isTexture){const l=o.mapping,c=l===ju||l===Xu,h=l===ua||l===Ya;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 sv(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&&s(m)?(e===null&&(e=new sv(n)),u=c?e.fromEquirectangular(o):e.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),o.addEventListener("dispose",r),u.texture):null}}}return o}function s(o){let l=0;const c=6;for(let h=0;ht.maxTextureSize&&(R=Math.ceil(w/t.maxTextureSize),w=t.maxTextureSize);const T=new Float32Array(w*R*4*u),C=new eg(T,w,R,u);C.type=ki,C.needsUpdate=!0;const L=S*4;for(let E=0;E0)return n;const s=t*e;let r=HS[s];if(r===void 0&&(r=new Float32Array(s),HS[s]=r),t!==0){i.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,n[a].toArray(r,o)}return r}function Nn(n,t){if(n.length!==t.length)return!1;for(let e=0,i=n.length;e0||h&&m&&s(m)?(e===null&&(e=new sv(n)),u=c?e.fromEquirectangular(o):e.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),o.addEventListener("dispose",r),u.texture):null}}}return o}function s(o){let l=0;const c=6;for(let h=0;ht.maxTextureSize&&(R=Math.ceil(w/t.maxTextureSize),w=t.maxTextureSize);const T=new Float32Array(w*R*4*u),C=new eg(T,w,R,u);C.type=ki,C.needsUpdate=!0;const L=S*4;for(let E=0;E0)return n;const s=t*e;let r=HS[s];if(r===void 0&&(r=new Float32Array(s),HS[s]=r),t!==0){i.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,n[a].toArray(r,o)}return r}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(` -`)}const YS=new Te;function R4(n){Ue._getMatrix(YS,Ue.workingColorSpace,n);const t=`mat3( ${YS.elements.map(e=>e.toFixed(4))} )`;switch(Ue.getTransfer(n)){case Yu:return[t,"LinearTransferOETF"];case Je:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[t,"LinearTransferOETF"]}}function $S(n,t,e){const i=n.getShaderParameter(t,n.COMPILE_STATUS),s=n.getShaderInfoLog(t).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const a=parseInt(r[1]);return e.toUpperCase()+` +`)}const YS=new Te;function I4(n){Ue._getMatrix(YS,Ue.workingColorSpace,n);const t=`mat3( ${YS.elements.map(e=>e.toFixed(4))} )`;switch(Ue.getTransfer(n)){case Yu:return[t,"LinearTransferOETF"];case Je:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[t,"LinearTransferOETF"]}}function $S(n,t,e){const i=n.getShaderParameter(t,n.COMPILE_STATUS),s=n.getShaderInfoLog(t).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const a=parseInt(r[1]);return e.toUpperCase()+` `+s+` -`+C4(n.getShaderSource(t),a)}else return s}function P4(n,t){const e=R4(t);return[`vec4 ${n}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(` -`)}function I4(n,t){let e;switch(t){case C2:e="Linear";break;case R2:e="Reinhard";break;case P2:e="Cineon";break;case Zv:e="ACESFilmic";break;case L2:e="AgX";break;case D2:e="Neutral";break;case I2:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+n+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const Hp=new O;function L4(){Ue.getLuminanceCoefficients(Hp);const n=Hp.x.toFixed(4),t=Hp.y.toFixed(4),e=Hp.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(` -`)}function D4(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(du).join(` -`)}function N4(n){const t=[];for(const e in n){const i=n[e];i!==!1&&t.push("#define "+e+" "+i)}return t.join(` -`)}function O4(n,t){const e={},i=n.getProgramParameter(t,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function rv(n){return n.replace(F4,k4)}const U4=new Map;function k4(n,t){let e=Pe[t];if(e===void 0){const i=U4.get(t);if(i!==void 0)e=Pe[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,i);else throw new Error("Can not resolve #include <"+t+">")}return rv(e)}const z4=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function JS(n){return n.replace(z4,B4)}function B4(n,t,e,i){let s="";for(let r=parseInt(t);r/gm;function rv(n){return n.replace(k4,B4)}const z4=new Map;function B4(n,t){let e=Pe[t];if(e===void 0){const i=z4.get(t);if(i!==void 0)e=Pe[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,i);else throw new Error("Can not resolve #include <"+t+">")}return rv(e)}const H4=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function JS(n){return n.replace(H4,G4)}function G4(n,t,e,i){let s="";for(let r=parseInt(t);r0&&(y+=` `),_=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g].filter(du).join(` `),_.length>0&&(_+=` `)):(y=[QS(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(du).join(` -`),_=[QS(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+u:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==wr?"#define TONE_MAPPING":"",e.toneMapping!==wr?Pe.tonemapping_pars_fragment:"",e.toneMapping!==wr?I4("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Pe.colorspace_pars_fragment,P4("linearToOutputTexel",e.outputColorSpace),L4(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`),_=[QS(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+u:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==wr?"#define TONE_MAPPING":"",e.toneMapping!==wr?Pe.tonemapping_pars_fragment:"",e.toneMapping!==wr?D4("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Pe.colorspace_pars_fragment,L4("linearToOutputTexel",e.outputColorSpace),N4(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` `].filter(du).join(` `)),a=rv(a),a=ZS(a,e),a=KS(a,e),o=rv(o),o=ZS(o,e),o=KS(o,e),a=JS(a),o=JS(o),e.isRawShaderMaterial!==!0&&(b=`#version 300 es `,y=[m,"#define attribute in","#define varying out","#define texture2D texture"].join(` @@ -3778,9 +3778,9 @@ Material Type: `+D.type+` Program Info Log: `+z+` `+ot+` -`+H)}else z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",z):(G===""||W==="")&&(Y=!1);Y&&(D.diagnostics={runnable:Q,programLog:z,vertexShader:{log:G,prefix:y},fragmentShader:{log:W,prefix:_}})}s.deleteShader(R),s.deleteShader(T),L=new Cm(s,x),P=O4(s,x)}let L;this.getUniforms=function(){return L===void 0&&C(this),L};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=s.getProgramParameter(x,A4)),E},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(x),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=T4++,this.cacheKey=t,this.usedTimes=1,this.program=x,this.vertexShader=R,this.fragmentShader=T,this}let q4=0;class Y4{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,i=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(i),a=this._getShaderCacheForMaterial(t);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.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 $4(t),e.set(t,i)),i}}class $4{constructor(t){this.id=q4++,this.code=t,this.usedTimes=0}}function Z4(n,t,e,i,s,r,a){const o=new nl,l=new Y4,c=new Set,h=[],u=s.logarithmicDepthBuffer,p=s.vertexTextures;let m=s.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 x(P){return c.add(P),P===0?"uv":`uv${P}`}function y(P,E,D,z,G){const W=z.fog,Q=G.geometry,Y=P.isMeshStandardMaterial?z.environment:null,ot=(P.isMeshStandardMaterial?e:t).get(P.envMap||Y),H=ot&&ot.mapping===ch?ot.image.height:null,Z=g[P.type];P.precision!==null&&(m=s.getMaxPrecision(P.precision),m!==P.precision&&console.warn("THREE.WebGLProgram.getParameters:",P.precision,"not supported, using",m,"instead."));const it=Q.morphAttributes.position||Q.morphAttributes.normal||Q.morphAttributes.color,$=it!==void 0?it.length:0;let lt=0;Q.morphAttributes.position!==void 0&&(lt=1),Q.morphAttributes.normal!==void 0&&(lt=2),Q.morphAttributes.color!==void 0&&(lt=3);let _t,q,rt,St;if(Z){const Fe=Gs[Z];_t=Fe.vertexShader,q=Fe.fragmentShader}else _t=P.vertexShader,q=P.fragmentShader,l.update(P),rt=l.getVertexShaderID(P),St=l.getFragmentShaderID(P);const dt=n.getRenderTarget(),It=n.state.buffers.depth.getReversed(),Ht=G.isInstancedMesh===!0,Bt=G.isBatchedMesh===!0,Qt=!!P.map,ht=!!P.matcap,gt=!!ot,k=!!P.aoMap,Et=!!P.lightMap,wt=!!P.bumpMap,Lt=!!P.normalMap,Ct=!!P.displacementMap,ne=!!P.emissiveMap,Ft=!!P.metalnessMap,U=!!P.roughnessMap,N=P.anisotropy>0,st=P.clearcoat>0,yt=P.dispersion>0,Rt=P.iridescence>0,Mt=P.sheen>0,te=P.transmission>0,zt=N&&!!P.anisotropyMap,Zt=st&&!!P.clearcoatMap,Re=st&&!!P.clearcoatNormalMap,at=st&&!!P.clearcoatRoughnessMap,Tt=Rt&&!!P.iridescenceMap,ae=Rt&&!!P.iridescenceThicknessMap,ue=Mt&&!!P.sheenColorMap,Vt=Mt&&!!P.sheenRoughnessMap,X=!!P.specularMap,bt=!!P.specularColorMap,Gt=!!P.specularIntensityMap,j=te&&!!P.transmissionMap,Ot=te&&!!P.thicknessMap,pt=!!P.gradientMap,At=!!P.alphaMap,Kt=P.alphaTest>0,Wt=!!P.alphaHash,pe=!!P.extensions;let Be=wr;P.toneMapped&&(dt===null||dt.isXRRenderTarget===!0)&&(Be=n.toneMapping);const nn={shaderID:Z,shaderType:P.type,shaderName:P.name,vertexShader:_t,fragmentShader:q,defines:P.defines,customVertexShaderID:rt,customFragmentShaderID:St,isRawShaderMaterial:P.isRawShaderMaterial===!0,glslVersion:P.glslVersion,precision:m,batching:Bt,batchingColor:Bt&&G._colorsTexture!==null,instancing:Ht,instancingColor:Ht&&G.instanceColor!==null,instancingMorph:Ht&&G.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:dt===null?n.outputColorSpace:dt.isXRRenderTarget===!0?dt.texture.colorSpace:$n,alphaToCoverage:!!P.alphaToCoverage,map:Qt,matcap:ht,envMap:gt,envMapMode:gt&&ot.mapping,envMapCubeUVHeight:H,aoMap:k,lightMap:Et,bumpMap:wt,normalMap:Lt,displacementMap:p&&Ct,emissiveMap:ne,normalMapObjectSpace:Lt&&P.normalMapType===H2,normalMapTangentSpace:Lt&&P.normalMapType===eo,metalnessMap:Ft,roughnessMap:U,anisotropy:N,anisotropyMap:zt,clearcoat:st,clearcoatMap:Zt,clearcoatNormalMap:Re,clearcoatRoughnessMap:at,dispersion:yt,iridescence:Rt,iridescenceMap:Tt,iridescenceThicknessMap:ae,sheen:Mt,sheenColorMap:ue,sheenRoughnessMap:Vt,specularMap:X,specularColorMap:bt,specularIntensityMap:Gt,transmission:te,transmissionMap:j,thicknessMap:Ot,gradientMap:pt,opaque:P.transparent===!1&&P.blending===Qo&&P.alphaToCoverage===!1,alphaMap:At,alphaTest:Kt,alphaHash:Wt,combine:P.combine,mapUv:Qt&&x(P.map.channel),aoMapUv:k&&x(P.aoMap.channel),lightMapUv:Et&&x(P.lightMap.channel),bumpMapUv:wt&&x(P.bumpMap.channel),normalMapUv:Lt&&x(P.normalMap.channel),displacementMapUv:Ct&&x(P.displacementMap.channel),emissiveMapUv:ne&&x(P.emissiveMap.channel),metalnessMapUv:Ft&&x(P.metalnessMap.channel),roughnessMapUv:U&&x(P.roughnessMap.channel),anisotropyMapUv:zt&&x(P.anisotropyMap.channel),clearcoatMapUv:Zt&&x(P.clearcoatMap.channel),clearcoatNormalMapUv:Re&&x(P.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:at&&x(P.clearcoatRoughnessMap.channel),iridescenceMapUv:Tt&&x(P.iridescenceMap.channel),iridescenceThicknessMapUv:ae&&x(P.iridescenceThicknessMap.channel),sheenColorMapUv:ue&&x(P.sheenColorMap.channel),sheenRoughnessMapUv:Vt&&x(P.sheenRoughnessMap.channel),specularMapUv:X&&x(P.specularMap.channel),specularColorMapUv:bt&&x(P.specularColorMap.channel),specularIntensityMapUv:Gt&&x(P.specularIntensityMap.channel),transmissionMapUv:j&&x(P.transmissionMap.channel),thicknessMapUv:Ot&&x(P.thicknessMap.channel),alphaMapUv:At&&x(P.alphaMap.channel),vertexTangents:!!Q.attributes.tangent&&(Lt||N),vertexColors:P.vertexColors,vertexAlphas:P.vertexColors===!0&&!!Q.attributes.color&&Q.attributes.color.itemSize===4,pointsUvs:G.isPoints===!0&&!!Q.attributes.uv&&(Qt||At),fog:!!W,useFog:P.fog===!0,fogExp2:!!W&&W.isFogExp2,flatShading:P.flatShading===!0,sizeAttenuation:P.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:It,skinning:G.isSkinnedMesh===!0,morphTargets:Q.morphAttributes.position!==void 0,morphNormals:Q.morphAttributes.normal!==void 0,morphColors:Q.morphAttributes.color!==void 0,morphTargetsCount:$,morphTextureStride:lt,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&&D.length>0,shadowMapType:n.shadowMap.type,toneMapping:Be,decodeVideoTexture:Qt&&P.map.isVideoTexture===!0&&Ue.getTransfer(P.map.colorSpace)===Je,decodeVideoTextureEmissive:ne&&P.emissiveMap.isVideoTexture===!0&&Ue.getTransfer(P.emissiveMap.colorSpace)===Je,premultipliedAlpha:P.premultipliedAlpha,doubleSided:P.side===fi,flipSided:P.side===Si,useDepthPacking:P.depthPacking>=0,depthPacking:P.depthPacking||0,index0AttributeName:P.index0AttributeName,extensionClipCullDistance:pe&&P.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(pe&&P.extensions.multiDraw===!0||Bt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:P.customProgramCacheKey()};return nn.vertexUv1s=c.has(1),nn.vertexUv2s=c.has(2),nn.vertexUv3s=c.has(3),c.clear(),nn}function _(P){const E=[];if(P.shaderID?E.push(P.shaderID):(E.push(P.customVertexShaderID),E.push(P.customFragmentShaderID)),P.defines!==void 0)for(const D in P.defines)E.push(D),E.push(P.defines[D]);return P.isRawShaderMaterial===!1&&(b(E,P),S(E,P),E.push(n.outputColorSpace)),E.push(P.customProgramCacheKey),E.join()}function b(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 S(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.reverseDepthBuffer&&o.enable(4),E.skinning&&o.enable(5),E.morphTargets&&o.enable(6),E.morphNormals&&o.enable(7),E.morphColors&&o.enable(8),E.premultipliedAlpha&&o.enable(9),E.shadowMapEnabled&&o.enable(10),E.doubleSided&&o.enable(11),E.flipSided&&o.enable(12),E.useDepthPacking&&o.enable(13),E.dithering&&o.enable(14),E.transmission&&o.enable(15),E.sheen&&o.enable(16),E.opaque&&o.enable(17),E.pointsUvs&&o.enable(18),E.decodeVideoTexture&&o.enable(19),E.decodeVideoTextureEmissive&&o.enable(20),E.alphaToCoverage&&o.enable(21),P.push(o.mask)}function w(P){const E=g[P.type];let D;if(E){const z=Gs[E];D=aC.clone(z.uniforms)}else D=P.uniforms;return D}function R(P,E){let D;for(let z=0,G=h.length;z0?i.push(_):m.transparent===!0?s.push(_):e.push(_)}function l(u,p,m,g,x,y){const _=a(u,p,m,g,x,y);m.transmission>0?i.unshift(_):m.transparent===!0?s.unshift(_):e.unshift(_)}function c(u,p){e.length>1&&e.sort(u||J4),i.length>1&&i.sort(p||tE),s.length>1&&s.sort(p||tE)}function h(){for(let u=t,p=n.length;u=r.length?(a=new eE,r.push(a)):a=r[s],a}function e(){n=new WeakMap}return{get:t,dispose:e}}function t5(){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 O,color:new kt};break;case"SpotLight":e={position:new O,direction:new O,color:new kt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new O,color:new kt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new O,skyColor:new kt,groundColor:new kt};break;case"RectAreaLight":e={color:new kt,position:new O,halfWidth:new O,halfHeight:new O};break}return n[t.id]=e,e}}}function e5(){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 n5=0;function i5(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function s5(n){const t=new t5,e=e5(),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 O);const s=new O,r=new ye,a=new ye;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,x=0,y=0,_=0,b=0,S=0,w=0,R=0,T=0,C=0;c.sort(i5);for(let P=0,E=c.length;P0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Xt.LTC_FLOAT_1,i.rectAreaLTC2=Xt.LTC_FLOAT_2):(i.rectAreaLTC1=Xt.LTC_HALF_1,i.rectAreaLTC2=Xt.LTC_HALF_2)),i.ambient[0]=h,i.ambient[1]=u,i.ambient[2]=p;const L=i.hash;(L.directionalLength!==m||L.pointLength!==g||L.spotLength!==x||L.rectAreaLength!==y||L.hemiLength!==_||L.numDirectionalShadows!==b||L.numPointShadows!==S||L.numSpotShadows!==w||L.numSpotMaps!==R||L.numLightProbes!==C)&&(i.directional.length=m,i.spot.length=x,i.rectArea.length=y,i.point.length=g,i.hemi.length=_,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=S,i.pointShadowMap.length=S,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=S,i.spotLightMatrix.length=w+R-T,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=C,L.directionalLength=m,L.pointLength=g,L.spotLength=x,L.rectAreaLength=y,L.hemiLength=_,L.numDirectionalShadows=b,L.numPointShadows=S,L.numSpotShadows=w,L.numSpotMaps=R,L.numLightProbes=C,i.version=n5++)}function l(c,h){let u=0,p=0,m=0,g=0,x=0;const y=h.matrixWorldInverse;for(let _=0,b=c.length;_=a.length?(o=new nE(n),a.push(o)):o=a[r],o}function i(){t=new WeakMap}return{get:e,dispose:i}}const a5=`void main() { +`+H)}else z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",z):(G===""||W==="")&&(Y=!1);Y&&(D.diagnostics={runnable:Q,programLog:z,vertexShader:{log:G,prefix:y},fragmentShader:{log:W,prefix:_}})}s.deleteShader(R),s.deleteShader(T),L=new Cm(s,x),P=U4(s,x)}let L;this.getUniforms=function(){return L===void 0&&C(this),L};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=s.getProgramParameter(x,C4)),E},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(x),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=R4++,this.cacheKey=t,this.usedTimes=1,this.program=x,this.vertexShader=R,this.fragmentShader=T,this}let $4=0;class Z4{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,i=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(i),a=this._getShaderCacheForMaterial(t);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.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 K4(t),e.set(t,i)),i}}class K4{constructor(t){this.id=$4++,this.code=t,this.usedTimes=0}}function J4(n,t,e,i,s,r,a){const o=new nl,l=new Z4,c=new Set,h=[],u=s.logarithmicDepthBuffer,p=s.vertexTextures;let m=s.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 x(P){return c.add(P),P===0?"uv":`uv${P}`}function y(P,E,D,z,G){const W=z.fog,Q=G.geometry,Y=P.isMeshStandardMaterial?z.environment:null,ot=(P.isMeshStandardMaterial?e:t).get(P.envMap||Y),H=ot&&ot.mapping===ch?ot.image.height:null,Z=g[P.type];P.precision!==null&&(m=s.getMaxPrecision(P.precision),m!==P.precision&&console.warn("THREE.WebGLProgram.getParameters:",P.precision,"not supported, using",m,"instead."));const it=Q.morphAttributes.position||Q.morphAttributes.normal||Q.morphAttributes.color,$=it!==void 0?it.length:0;let lt=0;Q.morphAttributes.position!==void 0&&(lt=1),Q.morphAttributes.normal!==void 0&&(lt=2),Q.morphAttributes.color!==void 0&&(lt=3);let _t,q,rt,St;if(Z){const Fe=Gs[Z];_t=Fe.vertexShader,q=Fe.fragmentShader}else _t=P.vertexShader,q=P.fragmentShader,l.update(P),rt=l.getVertexShaderID(P),St=l.getFragmentShaderID(P);const dt=n.getRenderTarget(),It=n.state.buffers.depth.getReversed(),Ht=G.isInstancedMesh===!0,Bt=G.isBatchedMesh===!0,Qt=!!P.map,ht=!!P.matcap,gt=!!ot,k=!!P.aoMap,Et=!!P.lightMap,wt=!!P.bumpMap,Lt=!!P.normalMap,Ct=!!P.displacementMap,ne=!!P.emissiveMap,Ft=!!P.metalnessMap,U=!!P.roughnessMap,N=P.anisotropy>0,st=P.clearcoat>0,yt=P.dispersion>0,Rt=P.iridescence>0,Mt=P.sheen>0,te=P.transmission>0,zt=N&&!!P.anisotropyMap,Zt=st&&!!P.clearcoatMap,Re=st&&!!P.clearcoatNormalMap,at=st&&!!P.clearcoatRoughnessMap,Tt=Rt&&!!P.iridescenceMap,ae=Rt&&!!P.iridescenceThicknessMap,ue=Mt&&!!P.sheenColorMap,Vt=Mt&&!!P.sheenRoughnessMap,X=!!P.specularMap,bt=!!P.specularColorMap,Gt=!!P.specularIntensityMap,j=te&&!!P.transmissionMap,Ot=te&&!!P.thicknessMap,pt=!!P.gradientMap,At=!!P.alphaMap,Kt=P.alphaTest>0,Wt=!!P.alphaHash,pe=!!P.extensions;let Be=wr;P.toneMapped&&(dt===null||dt.isXRRenderTarget===!0)&&(Be=n.toneMapping);const nn={shaderID:Z,shaderType:P.type,shaderName:P.name,vertexShader:_t,fragmentShader:q,defines:P.defines,customVertexShaderID:rt,customFragmentShaderID:St,isRawShaderMaterial:P.isRawShaderMaterial===!0,glslVersion:P.glslVersion,precision:m,batching:Bt,batchingColor:Bt&&G._colorsTexture!==null,instancing:Ht,instancingColor:Ht&&G.instanceColor!==null,instancingMorph:Ht&&G.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:dt===null?n.outputColorSpace:dt.isXRRenderTarget===!0?dt.texture.colorSpace:$n,alphaToCoverage:!!P.alphaToCoverage,map:Qt,matcap:ht,envMap:gt,envMapMode:gt&&ot.mapping,envMapCubeUVHeight:H,aoMap:k,lightMap:Et,bumpMap:wt,normalMap:Lt,displacementMap:p&&Ct,emissiveMap:ne,normalMapObjectSpace:Lt&&P.normalMapType===H2,normalMapTangentSpace:Lt&&P.normalMapType===eo,metalnessMap:Ft,roughnessMap:U,anisotropy:N,anisotropyMap:zt,clearcoat:st,clearcoatMap:Zt,clearcoatNormalMap:Re,clearcoatRoughnessMap:at,dispersion:yt,iridescence:Rt,iridescenceMap:Tt,iridescenceThicknessMap:ae,sheen:Mt,sheenColorMap:ue,sheenRoughnessMap:Vt,specularMap:X,specularColorMap:bt,specularIntensityMap:Gt,transmission:te,transmissionMap:j,thicknessMap:Ot,gradientMap:pt,opaque:P.transparent===!1&&P.blending===Qo&&P.alphaToCoverage===!1,alphaMap:At,alphaTest:Kt,alphaHash:Wt,combine:P.combine,mapUv:Qt&&x(P.map.channel),aoMapUv:k&&x(P.aoMap.channel),lightMapUv:Et&&x(P.lightMap.channel),bumpMapUv:wt&&x(P.bumpMap.channel),normalMapUv:Lt&&x(P.normalMap.channel),displacementMapUv:Ct&&x(P.displacementMap.channel),emissiveMapUv:ne&&x(P.emissiveMap.channel),metalnessMapUv:Ft&&x(P.metalnessMap.channel),roughnessMapUv:U&&x(P.roughnessMap.channel),anisotropyMapUv:zt&&x(P.anisotropyMap.channel),clearcoatMapUv:Zt&&x(P.clearcoatMap.channel),clearcoatNormalMapUv:Re&&x(P.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:at&&x(P.clearcoatRoughnessMap.channel),iridescenceMapUv:Tt&&x(P.iridescenceMap.channel),iridescenceThicknessMapUv:ae&&x(P.iridescenceThicknessMap.channel),sheenColorMapUv:ue&&x(P.sheenColorMap.channel),sheenRoughnessMapUv:Vt&&x(P.sheenRoughnessMap.channel),specularMapUv:X&&x(P.specularMap.channel),specularColorMapUv:bt&&x(P.specularColorMap.channel),specularIntensityMapUv:Gt&&x(P.specularIntensityMap.channel),transmissionMapUv:j&&x(P.transmissionMap.channel),thicknessMapUv:Ot&&x(P.thicknessMap.channel),alphaMapUv:At&&x(P.alphaMap.channel),vertexTangents:!!Q.attributes.tangent&&(Lt||N),vertexColors:P.vertexColors,vertexAlphas:P.vertexColors===!0&&!!Q.attributes.color&&Q.attributes.color.itemSize===4,pointsUvs:G.isPoints===!0&&!!Q.attributes.uv&&(Qt||At),fog:!!W,useFog:P.fog===!0,fogExp2:!!W&&W.isFogExp2,flatShading:P.flatShading===!0,sizeAttenuation:P.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:It,skinning:G.isSkinnedMesh===!0,morphTargets:Q.morphAttributes.position!==void 0,morphNormals:Q.morphAttributes.normal!==void 0,morphColors:Q.morphAttributes.color!==void 0,morphTargetsCount:$,morphTextureStride:lt,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&&D.length>0,shadowMapType:n.shadowMap.type,toneMapping:Be,decodeVideoTexture:Qt&&P.map.isVideoTexture===!0&&Ue.getTransfer(P.map.colorSpace)===Je,decodeVideoTextureEmissive:ne&&P.emissiveMap.isVideoTexture===!0&&Ue.getTransfer(P.emissiveMap.colorSpace)===Je,premultipliedAlpha:P.premultipliedAlpha,doubleSided:P.side===fi,flipSided:P.side===Si,useDepthPacking:P.depthPacking>=0,depthPacking:P.depthPacking||0,index0AttributeName:P.index0AttributeName,extensionClipCullDistance:pe&&P.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(pe&&P.extensions.multiDraw===!0||Bt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:P.customProgramCacheKey()};return nn.vertexUv1s=c.has(1),nn.vertexUv2s=c.has(2),nn.vertexUv3s=c.has(3),c.clear(),nn}function _(P){const E=[];if(P.shaderID?E.push(P.shaderID):(E.push(P.customVertexShaderID),E.push(P.customFragmentShaderID)),P.defines!==void 0)for(const D in P.defines)E.push(D),E.push(P.defines[D]);return P.isRawShaderMaterial===!1&&(b(E,P),S(E,P),E.push(n.outputColorSpace)),E.push(P.customProgramCacheKey),E.join()}function b(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 S(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.reverseDepthBuffer&&o.enable(4),E.skinning&&o.enable(5),E.morphTargets&&o.enable(6),E.morphNormals&&o.enable(7),E.morphColors&&o.enable(8),E.premultipliedAlpha&&o.enable(9),E.shadowMapEnabled&&o.enable(10),E.doubleSided&&o.enable(11),E.flipSided&&o.enable(12),E.useDepthPacking&&o.enable(13),E.dithering&&o.enable(14),E.transmission&&o.enable(15),E.sheen&&o.enable(16),E.opaque&&o.enable(17),E.pointsUvs&&o.enable(18),E.decodeVideoTexture&&o.enable(19),E.decodeVideoTextureEmissive&&o.enable(20),E.alphaToCoverage&&o.enable(21),P.push(o.mask)}function w(P){const E=g[P.type];let D;if(E){const z=Gs[E];D=aC.clone(z.uniforms)}else D=P.uniforms;return D}function R(P,E){let D;for(let z=0,G=h.length;z0?i.push(_):m.transparent===!0?s.push(_):e.push(_)}function l(u,p,m,g,x,y){const _=a(u,p,m,g,x,y);m.transmission>0?i.unshift(_):m.transparent===!0?s.unshift(_):e.unshift(_)}function c(u,p){e.length>1&&e.sort(u||t5),i.length>1&&i.sort(p||tE),s.length>1&&s.sort(p||tE)}function h(){for(let u=t,p=n.length;u=r.length?(a=new eE,r.push(a)):a=r[s],a}function e(){n=new WeakMap}return{get:t,dispose:e}}function n5(){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 O,color:new kt};break;case"SpotLight":e={position:new O,direction:new O,color:new kt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new O,color:new kt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new O,skyColor:new kt,groundColor:new kt};break;case"RectAreaLight":e={color:new kt,position:new O,halfWidth:new O,halfHeight:new O};break}return n[t.id]=e,e}}}function i5(){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 s5=0;function r5(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function a5(n){const t=new n5,e=i5(),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 O);const s=new O,r=new ye,a=new ye;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,x=0,y=0,_=0,b=0,S=0,w=0,R=0,T=0,C=0;c.sort(r5);for(let P=0,E=c.length;P0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Xt.LTC_FLOAT_1,i.rectAreaLTC2=Xt.LTC_FLOAT_2):(i.rectAreaLTC1=Xt.LTC_HALF_1,i.rectAreaLTC2=Xt.LTC_HALF_2)),i.ambient[0]=h,i.ambient[1]=u,i.ambient[2]=p;const L=i.hash;(L.directionalLength!==m||L.pointLength!==g||L.spotLength!==x||L.rectAreaLength!==y||L.hemiLength!==_||L.numDirectionalShadows!==b||L.numPointShadows!==S||L.numSpotShadows!==w||L.numSpotMaps!==R||L.numLightProbes!==C)&&(i.directional.length=m,i.spot.length=x,i.rectArea.length=y,i.point.length=g,i.hemi.length=_,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=S,i.pointShadowMap.length=S,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=S,i.spotLightMatrix.length=w+R-T,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=C,L.directionalLength=m,L.pointLength=g,L.spotLength=x,L.rectAreaLength=y,L.hemiLength=_,L.numDirectionalShadows=b,L.numPointShadows=S,L.numSpotShadows=w,L.numSpotMaps=R,L.numLightProbes=C,i.version=s5++)}function l(c,h){let u=0,p=0,m=0,g=0,x=0;const y=h.matrixWorldInverse;for(let _=0,b=c.length;_=a.length?(o=new nE(n),a.push(o)):o=a[r],o}function i(){t=new WeakMap}return{get:e,dispose:i}}const l5=`void main() { gl_Position = vec4( position, 1.0 ); -}`,o5=`uniform sampler2D shadow_pass; +}`,c5=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3806,12 +3806,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function l5(n,t,e){let i=new If;const s=new xt,r=new xt,a=new Ge,o=new E1({depthPacking:B2}),l=new A1,c={},h=e.maxTextureSize,u={[js]:Si,[Si]:js,[fi]:fi},p=new $s({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xt},radius:{value:4}},vertexShader:a5,fragmentShader:o5}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const g=new ve;g.setAttribute("position",new De(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new Mn(g,p),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=j0;let _=this.type;this.render=function(T,C,L){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||T.length===0)return;const P=n.getRenderTarget(),E=n.getActiveCubeFace(),D=n.getActiveMipmapLevel(),z=n.state;z.setBlending(sa),z.buffers.color.setClear(1,1,1,1),z.buffers.depth.setTest(!0),z.setScissorTest(!1);const G=_!==Bs&&this.type===Bs,W=_===Bs&&this.type!==Bs;for(let Q=0,Y=T.length;Qh||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/Z.x),s.x=r.x*Z.x,H.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/Z.y),s.y=r.y*Z.y,H.mapSize.y=r.y)),H.map===null||G===!0||W===!0){const $=this.type!==Bs?{minFilter:Dn,magFilter:Dn}:{};H.map!==null&&H.map.dispose(),H.map=new qs(s.x,s.y,$),H.map.texture.name=ot.name+".shadowMap",H.camera.updateProjectionMatrix()}n.setRenderTarget(H.map),n.clear();const it=H.getViewportCount();for(let $=0;$0||C.map&&C.alphaTest>0){const z=E.uuid,G=C.uuid;let W=c[z];W===void 0&&(W={},c[z]=W);let Q=W[G];Q===void 0&&(Q=E.clone(),W[G]=Q,C.addEventListener("dispose",R)),E=Q}if(E.visible=C.visible,E.wireframe=C.wireframe,P===Bs?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,L.isPointLight===!0&&E.isMeshDistanceMaterial===!0){const z=n.properties.get(E);z.light=L}return E}function w(T,C,L,P,E){if(T.visible===!1)return;if(T.layers.test(C.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&E===Bs)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,T.matrixWorld);const G=t.update(T),W=T.material;if(Array.isArray(W)){const Q=G.groups;for(let Y=0,ot=Q.length;Y=1):H.indexOf("OpenGL ES")!==-1&&(ot=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),Y=ot>=2);let Z=null,it={};const $=n.getParameter(n.SCISSOR_BOX),lt=n.getParameter(n.VIEWPORT),_t=new Ge().fromArray($),q=new Ge().fromArray(lt);function rt(j,Ot,pt,At){const Kt=new Uint8Array(4),Wt=n.createTexture();n.bindTexture(j,Wt),n.texParameteri(j,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(j,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let pe=0;pe"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(U,N){return m?new OffscreenCanvas(U,N):Ku("canvas")}function x(U,N,st){let yt=1;const Rt=Ft(U);if((Rt.width>st||Rt.height>st)&&(yt=st/Math.max(Rt.width,Rt.height)),yt<1)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap||typeof VideoFrame<"u"&&U instanceof VideoFrame){const Mt=Math.floor(yt*Rt.width),te=Math.floor(yt*Rt.height);u===void 0&&(u=g(Mt,te));const zt=N?g(Mt,te):u;return zt.width=Mt,zt.height=te,zt.getContext("2d").drawImage(U,0,0,Mt,te),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Rt.width+"x"+Rt.height+") to ("+Mt+"x"+te+")."),zt}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Rt.width+"x"+Rt.height+")."),U;return U}function y(U){return U.generateMipmaps}function _(U){n.generateMipmap(U)}function b(U){return U.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:U.isWebGL3DRenderTarget?n.TEXTURE_3D:U.isWebGLArrayRenderTarget||U.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function S(U,N,st,yt,Rt=!1){if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let Mt=N;if(N===n.RED&&(st===n.FLOAT&&(Mt=n.R32F),st===n.HALF_FLOAT&&(Mt=n.R16F),st===n.UNSIGNED_BYTE&&(Mt=n.R8)),N===n.RED_INTEGER&&(st===n.UNSIGNED_BYTE&&(Mt=n.R8UI),st===n.UNSIGNED_SHORT&&(Mt=n.R16UI),st===n.UNSIGNED_INT&&(Mt=n.R32UI),st===n.BYTE&&(Mt=n.R8I),st===n.SHORT&&(Mt=n.R16I),st===n.INT&&(Mt=n.R32I)),N===n.RG&&(st===n.FLOAT&&(Mt=n.RG32F),st===n.HALF_FLOAT&&(Mt=n.RG16F),st===n.UNSIGNED_BYTE&&(Mt=n.RG8)),N===n.RG_INTEGER&&(st===n.UNSIGNED_BYTE&&(Mt=n.RG8UI),st===n.UNSIGNED_SHORT&&(Mt=n.RG16UI),st===n.UNSIGNED_INT&&(Mt=n.RG32UI),st===n.BYTE&&(Mt=n.RG8I),st===n.SHORT&&(Mt=n.RG16I),st===n.INT&&(Mt=n.RG32I)),N===n.RGB_INTEGER&&(st===n.UNSIGNED_BYTE&&(Mt=n.RGB8UI),st===n.UNSIGNED_SHORT&&(Mt=n.RGB16UI),st===n.UNSIGNED_INT&&(Mt=n.RGB32UI),st===n.BYTE&&(Mt=n.RGB8I),st===n.SHORT&&(Mt=n.RGB16I),st===n.INT&&(Mt=n.RGB32I)),N===n.RGBA_INTEGER&&(st===n.UNSIGNED_BYTE&&(Mt=n.RGBA8UI),st===n.UNSIGNED_SHORT&&(Mt=n.RGBA16UI),st===n.UNSIGNED_INT&&(Mt=n.RGBA32UI),st===n.BYTE&&(Mt=n.RGBA8I),st===n.SHORT&&(Mt=n.RGBA16I),st===n.INT&&(Mt=n.RGBA32I)),N===n.RGB&&st===n.UNSIGNED_INT_5_9_9_9_REV&&(Mt=n.RGB9_E5),N===n.RGBA){const te=Rt?Yu:Ue.getTransfer(yt);st===n.FLOAT&&(Mt=n.RGBA32F),st===n.HALF_FLOAT&&(Mt=n.RGBA16F),st===n.UNSIGNED_BYTE&&(Mt=te===Je?n.SRGB8_ALPHA8:n.RGBA8),st===n.UNSIGNED_SHORT_4_4_4_4&&(Mt=n.RGBA4),st===n.UNSIGNED_SHORT_5_5_5_1&&(Mt=n.RGB5_A1)}return(Mt===n.R16F||Mt===n.R32F||Mt===n.RG16F||Mt===n.RG32F||Mt===n.RGBA16F||Mt===n.RGBA32F)&&t.get("EXT_color_buffer_float"),Mt}function w(U,N){let st;return U?N===null||N===fa||N===ll?st=n.DEPTH24_STENCIL8:N===ki?st=n.DEPTH32F_STENCIL8:N===$c&&(st=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):N===null||N===fa||N===ll?st=n.DEPTH_COMPONENT24:N===ki?st=n.DEPTH_COMPONENT32F:N===$c&&(st=n.DEPTH_COMPONENT16),st}function R(U,N){return y(U)===!0||U.isFramebufferTexture&&U.minFilter!==Dn&&U.minFilter!==yn?Math.log2(Math.max(N.width,N.height))+1:U.mipmaps!==void 0&&U.mipmaps.length>0?U.mipmaps.length:U.isCompressedTexture&&Array.isArray(U.image)?N.mipmaps.length:1}function T(U){const N=U.target;N.removeEventListener("dispose",T),L(N),N.isVideoTexture&&h.delete(N)}function C(U){const N=U.target;N.removeEventListener("dispose",C),E(N)}function L(U){const N=i.get(U);if(N.__webglInit===void 0)return;const st=U.source,yt=p.get(st);if(yt){const Rt=yt[N.__cacheKey];Rt.usedTimes--,Rt.usedTimes===0&&P(U),Object.keys(yt).length===0&&p.delete(st)}i.remove(U)}function P(U){const N=i.get(U);n.deleteTexture(N.__webglTexture);const st=U.source,yt=p.get(st);delete yt[N.__cacheKey],a.memory.textures--}function E(U){const N=i.get(U);if(U.depthTexture&&(U.depthTexture.dispose(),i.remove(U.depthTexture)),U.isWebGLCubeRenderTarget)for(let yt=0;yt<6;yt++){if(Array.isArray(N.__webglFramebuffer[yt]))for(let Rt=0;Rt=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+s.maxTextures),D+=1,U}function W(U){const N=[];return N.push(U.wrapS),N.push(U.wrapT),N.push(U.wrapR||0),N.push(U.magFilter),N.push(U.minFilter),N.push(U.anisotropy),N.push(U.internalFormat),N.push(U.format),N.push(U.type),N.push(U.generateMipmaps),N.push(U.premultiplyAlpha),N.push(U.flipY),N.push(U.unpackAlignment),N.push(U.colorSpace),N.join()}function Q(U,N){const st=i.get(U);if(U.isVideoTexture&&Ct(U),U.isRenderTargetTexture===!1&&U.version>0&&st.__version!==U.version){const yt=U.image;if(yt===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(yt.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{q(st,U,N);return}}e.bindTexture(n.TEXTURE_2D,st.__webglTexture,n.TEXTURE0+N)}function Y(U,N){const st=i.get(U);if(U.version>0&&st.__version!==U.version){q(st,U,N);return}e.bindTexture(n.TEXTURE_2D_ARRAY,st.__webglTexture,n.TEXTURE0+N)}function ot(U,N){const st=i.get(U);if(U.version>0&&st.__version!==U.version){q(st,U,N);return}e.bindTexture(n.TEXTURE_3D,st.__webglTexture,n.TEXTURE0+N)}function H(U,N){const st=i.get(U);if(U.version>0&&st.__version!==U.version){rt(st,U,N);return}e.bindTexture(n.TEXTURE_CUBE_MAP,st.__webglTexture,n.TEXTURE0+N)}const Z={[$a]:n.REPEAT,[es]:n.CLAMP_TO_EDGE,[Yc]:n.MIRRORED_REPEAT},it={[Dn]:n.NEAREST,[q0]:n.NEAREST_MIPMAP_NEAREST,[Vo]:n.NEAREST_MIPMAP_LINEAR,[yn]:n.LINEAR,[Fc]:n.LINEAR_MIPMAP_NEAREST,[ws]:n.LINEAR_MIPMAP_LINEAR},$={[G2]:n.NEVER,[Y2]:n.ALWAYS,[V2]:n.LESS,[l1]:n.LEQUAL,[W2]:n.EQUAL,[q2]:n.GEQUAL,[j2]:n.GREATER,[X2]:n.NOTEQUAL};function lt(U,N){if(N.type===ki&&t.has("OES_texture_float_linear")===!1&&(N.magFilter===yn||N.magFilter===Fc||N.magFilter===Vo||N.magFilter===ws||N.minFilter===yn||N.minFilter===Fc||N.minFilter===Vo||N.minFilter===ws)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(U,n.TEXTURE_WRAP_S,Z[N.wrapS]),n.texParameteri(U,n.TEXTURE_WRAP_T,Z[N.wrapT]),(U===n.TEXTURE_3D||U===n.TEXTURE_2D_ARRAY)&&n.texParameteri(U,n.TEXTURE_WRAP_R,Z[N.wrapR]),n.texParameteri(U,n.TEXTURE_MAG_FILTER,it[N.magFilter]),n.texParameteri(U,n.TEXTURE_MIN_FILTER,it[N.minFilter]),N.compareFunction&&(n.texParameteri(U,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(U,n.TEXTURE_COMPARE_FUNC,$[N.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(N.magFilter===Dn||N.minFilter!==Vo&&N.minFilter!==ws||N.type===ki&&t.has("OES_texture_float_linear")===!1)return;if(N.anisotropy>1||i.get(N).__currentAnisotropy){const st=t.get("EXT_texture_filter_anisotropic");n.texParameterf(U,st.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,s.getMaxAnisotropy())),i.get(N).__currentAnisotropy=N.anisotropy}}}function _t(U,N){let st=!1;U.__webglInit===void 0&&(U.__webglInit=!0,N.addEventListener("dispose",T));const yt=N.source;let Rt=p.get(yt);Rt===void 0&&(Rt={},p.set(yt,Rt));const Mt=W(N);if(Mt!==U.__cacheKey){Rt[Mt]===void 0&&(Rt[Mt]={texture:n.createTexture(),usedTimes:0},a.memory.textures++,st=!0),Rt[Mt].usedTimes++;const te=Rt[U.__cacheKey];te!==void 0&&(Rt[U.__cacheKey].usedTimes--,te.usedTimes===0&&P(N)),U.__cacheKey=Mt,U.__webglTexture=Rt[Mt].texture}return st}function q(U,N,st){let yt=n.TEXTURE_2D;(N.isDataArrayTexture||N.isCompressedArrayTexture)&&(yt=n.TEXTURE_2D_ARRAY),N.isData3DTexture&&(yt=n.TEXTURE_3D);const Rt=_t(U,N),Mt=N.source;e.bindTexture(yt,U.__webglTexture,n.TEXTURE0+st);const te=i.get(Mt);if(Mt.version!==te.__version||Rt===!0){e.activeTexture(n.TEXTURE0+st);const zt=Ue.getPrimaries(Ue.workingColorSpace),Zt=N.colorSpace===Qr?null:Ue.getPrimaries(N.colorSpace),Re=N.colorSpace===Qr||zt===Zt?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,N.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,N.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Re);let at=x(N.image,!1,s.maxTextureSize);at=ne(N,at);const Tt=r.convert(N.format,N.colorSpace),ae=r.convert(N.type);let ue=S(N.internalFormat,Tt,ae,N.colorSpace,N.isVideoTexture);lt(yt,N);let Vt;const X=N.mipmaps,bt=N.isVideoTexture!==!0,Gt=te.__version===void 0||Rt===!0,j=Mt.dataReady,Ot=R(N,at);if(N.isDepthTexture)ue=w(N.format===cl,N.type),Gt&&(bt?e.texStorage2D(n.TEXTURE_2D,1,ue,at.width,at.height):e.texImage2D(n.TEXTURE_2D,0,ue,at.width,at.height,0,Tt,ae,null));else if(N.isDataTexture)if(X.length>0){bt&&Gt&&e.texStorage2D(n.TEXTURE_2D,Ot,ue,X[0].width,X[0].height);for(let pt=0,At=X.length;pt0){const Kt=iv(Vt.width,Vt.height,N.format,N.type);for(const Wt of N.layerUpdates){const pe=Vt.data.subarray(Wt*Kt/Vt.data.BYTES_PER_ELEMENT,(Wt+1)*Kt/Vt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,pt,0,0,Wt,Vt.width,Vt.height,1,Tt,pe)}N.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,pt,0,0,0,Vt.width,Vt.height,at.depth,Tt,Vt.data)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,pt,ue,Vt.width,Vt.height,at.depth,0,Vt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else bt?j&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,pt,0,0,0,Vt.width,Vt.height,at.depth,Tt,ae,Vt.data):e.texImage3D(n.TEXTURE_2D_ARRAY,pt,ue,Vt.width,Vt.height,at.depth,0,Tt,ae,Vt.data)}else{bt&&Gt&&e.texStorage2D(n.TEXTURE_2D,Ot,ue,X[0].width,X[0].height);for(let pt=0,At=X.length;pt0){const pt=iv(at.width,at.height,N.format,N.type);for(const At of N.layerUpdates){const Kt=at.data.subarray(At*pt/at.data.BYTES_PER_ELEMENT,(At+1)*pt/at.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,At,at.width,at.height,1,Tt,ae,Kt)}N.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,at.width,at.height,at.depth,Tt,ae,at.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,ue,at.width,at.height,at.depth,0,Tt,ae,at.data);else if(N.isData3DTexture)bt?(Gt&&e.texStorage3D(n.TEXTURE_3D,Ot,ue,at.width,at.height,at.depth),j&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,at.width,at.height,at.depth,Tt,ae,at.data)):e.texImage3D(n.TEXTURE_3D,0,ue,at.width,at.height,at.depth,0,Tt,ae,at.data);else if(N.isFramebufferTexture){if(Gt)if(bt)e.texStorage2D(n.TEXTURE_2D,Ot,ue,at.width,at.height);else{let pt=at.width,At=at.height;for(let Kt=0;Kt>=1,At>>=1}}else if(X.length>0){if(bt&&Gt){const pt=Ft(X[0]);e.texStorage2D(n.TEXTURE_2D,Ot,ue,pt.width,pt.height)}for(let pt=0,At=X.length;pt0&&Ot++;const At=Ft(Tt[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,Ot,X,At.width,At.height)}for(let At=0;At<6;At++)if(at){bt?j&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+At,0,0,0,Tt[At].width,Tt[At].height,ue,Vt,Tt[At].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+At,0,X,Tt[At].width,Tt[At].height,0,ue,Vt,Tt[At].data);for(let Kt=0;Kt>Mt),ae=Math.max(1,N.height>>Mt);Rt===n.TEXTURE_3D||Rt===n.TEXTURE_2D_ARRAY?e.texImage3D(Rt,Mt,Zt,Tt,ae,N.depth,0,te,zt,null):e.texImage2D(Rt,Mt,Zt,Tt,ae,0,te,zt,null)}e.bindFramebuffer(n.FRAMEBUFFER,U),Lt(N)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,yt,Rt,at.__webglTexture,0,wt(N)):(Rt===n.TEXTURE_2D||Rt>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Rt<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,yt,Rt,at.__webglTexture,Mt),e.bindFramebuffer(n.FRAMEBUFFER,null)}function dt(U,N,st){if(n.bindRenderbuffer(n.RENDERBUFFER,U),N.depthBuffer){const yt=N.depthTexture,Rt=yt&&yt.isDepthTexture?yt.type:null,Mt=w(N.stencilBuffer,Rt),te=N.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,zt=wt(N);Lt(N)?o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,zt,Mt,N.width,N.height):st?n.renderbufferStorageMultisample(n.RENDERBUFFER,zt,Mt,N.width,N.height):n.renderbufferStorage(n.RENDERBUFFER,Mt,N.width,N.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,te,n.RENDERBUFFER,U)}else{const yt=N.textures;for(let Rt=0;Rt{delete N.__boundDepthTexture,delete N.__depthDisposeCallback,yt.removeEventListener("dispose",Rt)};yt.addEventListener("dispose",Rt),N.__depthDisposeCallback=Rt}N.__boundDepthTexture=yt}if(U.depthTexture&&!N.__autoAllocateDepthBuffer){if(st)throw new Error("target.depthTexture not supported in Cube render targets");It(N.__webglFramebuffer,U)}else if(st){N.__webglDepthbuffer=[];for(let yt=0;yt<6;yt++)if(e.bindFramebuffer(n.FRAMEBUFFER,N.__webglFramebuffer[yt]),N.__webglDepthbuffer[yt]===void 0)N.__webglDepthbuffer[yt]=n.createRenderbuffer(),dt(N.__webglDepthbuffer[yt],U,!1);else{const Rt=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Mt=N.__webglDepthbuffer[yt];n.bindRenderbuffer(n.RENDERBUFFER,Mt),n.framebufferRenderbuffer(n.FRAMEBUFFER,Rt,n.RENDERBUFFER,Mt)}}else if(e.bindFramebuffer(n.FRAMEBUFFER,N.__webglFramebuffer),N.__webglDepthbuffer===void 0)N.__webglDepthbuffer=n.createRenderbuffer(),dt(N.__webglDepthbuffer,U,!1);else{const yt=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Rt=N.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,Rt),n.framebufferRenderbuffer(n.FRAMEBUFFER,yt,n.RENDERBUFFER,Rt)}e.bindFramebuffer(n.FRAMEBUFFER,null)}function Bt(U,N,st){const yt=i.get(U);N!==void 0&&St(yt.__webglFramebuffer,U,U.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),st!==void 0&&Ht(U)}function Qt(U){const N=U.texture,st=i.get(U),yt=i.get(N);U.addEventListener("dispose",C);const Rt=U.textures,Mt=U.isWebGLCubeRenderTarget===!0,te=Rt.length>1;if(te||(yt.__webglTexture===void 0&&(yt.__webglTexture=n.createTexture()),yt.__version=N.version,a.memory.textures++),Mt){st.__webglFramebuffer=[];for(let zt=0;zt<6;zt++)if(N.mipmaps&&N.mipmaps.length>0){st.__webglFramebuffer[zt]=[];for(let Zt=0;Zt0){st.__webglFramebuffer=[];for(let zt=0;zt0&&Lt(U)===!1){st.__webglMultisampledFramebuffer=n.createFramebuffer(),st.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,st.__webglMultisampledFramebuffer);for(let zt=0;zt0)for(let Zt=0;Zt0)for(let Zt=0;Zt0){if(Lt(U)===!1){const N=U.textures,st=U.width,yt=U.height;let Rt=n.COLOR_BUFFER_BIT;const Mt=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,te=i.get(U),zt=N.length>1;if(zt)for(let Zt=0;Zt0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&N.__useRenderToTexture!==!1}function Ct(U){const N=a.render.frame;h.get(U)!==N&&(h.set(U,N),U.update())}function ne(U,N){const st=U.colorSpace,yt=U.format,Rt=U.type;return U.isCompressedTexture===!0||U.isVideoTexture===!0||st!==$n&&st!==Qr&&(Ue.getTransfer(st)===Je?(yt!==di||Rt!==Xs)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",st)),N}function Ft(U){return typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement?(c.width=U.naturalWidth||U.width,c.height=U.naturalHeight||U.height):typeof VideoFrame<"u"&&U instanceof VideoFrame?(c.width=U.displayWidth,c.height=U.displayHeight):(c.width=U.width,c.height=U.height),c}this.allocateTextureUnit=G,this.resetTextureUnits=z,this.setTexture2D=Q,this.setTexture2DArray=Y,this.setTexture3D=ot,this.setTextureCube=H,this.rebindTextures=Bt,this.setupRenderTarget=Qt,this.updateRenderTargetMipmap=ht,this.updateMultisampleRenderTarget=Et,this.setupDepthRenderbuffer=Ht,this.setupFrameBufferTexture=St,this.useMultisampledRTT=Lt}function nR(n,t){function e(i,s=Qr){let r;const a=Ue.getTransfer(s);if(i===Xs)return n.UNSIGNED_BYTE;if(i===$0)return n.UNSIGNED_SHORT_4_4_4_4;if(i===Z0)return n.UNSIGNED_SHORT_5_5_5_1;if(i===Qv)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===Kv)return n.BYTE;if(i===Jv)return n.SHORT;if(i===$c)return n.UNSIGNED_SHORT;if(i===Y0)return n.INT;if(i===fa)return n.UNSIGNED_INT;if(i===ki)return n.FLOAT;if(i===hh)return n.HALF_FLOAT;if(i===t1)return n.ALPHA;if(i===e1)return n.RGB;if(i===di)return n.RGBA;if(i===n1)return n.LUMINANCE;if(i===i1)return n.LUMINANCE_ALPHA;if(i===tl)return n.DEPTH_COMPONENT;if(i===cl)return n.DEPTH_STENCIL;if(i===K0)return n.RED;if(i===Af)return n.RED_INTEGER;if(i===s1)return n.RG;if(i===J0)return n.RG_INTEGER;if(i===Q0)return n.RGBA_INTEGER;if(i===Su||i===Eu||i===Au||i===Tu)if(a===Je)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===Su)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Eu)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Au)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Tu)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===Su)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Eu)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Au)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Tu)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===$m||i===Zm||i===Km||i===Jm)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===$m)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Zm)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Km)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Jm)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Qm||i===t0||i===e0)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(i===Qm||i===t0)return a===Je?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===e0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===n0||i===i0||i===s0||i===r0||i===a0||i===o0||i===l0||i===c0||i===h0||i===u0||i===f0||i===d0||i===p0||i===m0)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(i===n0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===i0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===s0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===r0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===a0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===o0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===l0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===c0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===h0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===u0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===f0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===d0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===p0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===m0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Cu||i===g0||i===y0)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(i===Cu)return a===Je?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===g0)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===y0)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===r1||i===_0||i===x0||i===v0)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(i===Cu)return r.COMPRESSED_RED_RGTC1_EXT;if(i===_0)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===x0)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===v0)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ll?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:e}}const f5={type:"move"};class F_{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new na,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 na,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new O,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new O),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new na,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new O,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new O),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 s=null,r=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 x of t.hand.values()){const y=e.getJointPose(x,i),_=this._getHandJoint(c,x);y!==null&&(_.matrix.fromArray(y.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.matrixWorldNeedsUpdate=!0,_.jointRadius=y.radius),_.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&&(r=e.getPose(t.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(s=e.getPose(t.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(f5)))}return o!==null&&(o.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const i=new na;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}const d5=` +}`;function h5(n,t,e){let i=new If;const s=new xt,r=new xt,a=new Ge,o=new E1({depthPacking:B2}),l=new A1,c={},h=e.maxTextureSize,u={[js]:Si,[Si]:js,[fi]:fi},p=new $s({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xt},radius:{value:4}},vertexShader:l5,fragmentShader:c5}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const g=new ve;g.setAttribute("position",new De(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new Mn(g,p),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=j0;let _=this.type;this.render=function(T,C,L){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||T.length===0)return;const P=n.getRenderTarget(),E=n.getActiveCubeFace(),D=n.getActiveMipmapLevel(),z=n.state;z.setBlending(sa),z.buffers.color.setClear(1,1,1,1),z.buffers.depth.setTest(!0),z.setScissorTest(!1);const G=_!==Bs&&this.type===Bs,W=_===Bs&&this.type!==Bs;for(let Q=0,Y=T.length;Qh||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/Z.x),s.x=r.x*Z.x,H.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/Z.y),s.y=r.y*Z.y,H.mapSize.y=r.y)),H.map===null||G===!0||W===!0){const $=this.type!==Bs?{minFilter:Dn,magFilter:Dn}:{};H.map!==null&&H.map.dispose(),H.map=new qs(s.x,s.y,$),H.map.texture.name=ot.name+".shadowMap",H.camera.updateProjectionMatrix()}n.setRenderTarget(H.map),n.clear();const it=H.getViewportCount();for(let $=0;$0||C.map&&C.alphaTest>0){const z=E.uuid,G=C.uuid;let W=c[z];W===void 0&&(W={},c[z]=W);let Q=W[G];Q===void 0&&(Q=E.clone(),W[G]=Q,C.addEventListener("dispose",R)),E=Q}if(E.visible=C.visible,E.wireframe=C.wireframe,P===Bs?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,L.isPointLight===!0&&E.isMeshDistanceMaterial===!0){const z=n.properties.get(E);z.light=L}return E}function w(T,C,L,P,E){if(T.visible===!1)return;if(T.layers.test(C.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&E===Bs)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,T.matrixWorld);const G=t.update(T),W=T.material;if(Array.isArray(W)){const Q=G.groups;for(let Y=0,ot=Q.length;Y=1):H.indexOf("OpenGL ES")!==-1&&(ot=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),Y=ot>=2);let Z=null,it={};const $=n.getParameter(n.SCISSOR_BOX),lt=n.getParameter(n.VIEWPORT),_t=new Ge().fromArray($),q=new Ge().fromArray(lt);function rt(j,Ot,pt,At){const Kt=new Uint8Array(4),Wt=n.createTexture();n.bindTexture(j,Wt),n.texParameteri(j,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(j,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let pe=0;pe"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(U,N){return m?new OffscreenCanvas(U,N):Ku("canvas")}function x(U,N,st){let yt=1;const Rt=Ft(U);if((Rt.width>st||Rt.height>st)&&(yt=st/Math.max(Rt.width,Rt.height)),yt<1)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap||typeof VideoFrame<"u"&&U instanceof VideoFrame){const Mt=Math.floor(yt*Rt.width),te=Math.floor(yt*Rt.height);u===void 0&&(u=g(Mt,te));const zt=N?g(Mt,te):u;return zt.width=Mt,zt.height=te,zt.getContext("2d").drawImage(U,0,0,Mt,te),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Rt.width+"x"+Rt.height+") to ("+Mt+"x"+te+")."),zt}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Rt.width+"x"+Rt.height+")."),U;return U}function y(U){return U.generateMipmaps}function _(U){n.generateMipmap(U)}function b(U){return U.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:U.isWebGL3DRenderTarget?n.TEXTURE_3D:U.isWebGLArrayRenderTarget||U.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function S(U,N,st,yt,Rt=!1){if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let Mt=N;if(N===n.RED&&(st===n.FLOAT&&(Mt=n.R32F),st===n.HALF_FLOAT&&(Mt=n.R16F),st===n.UNSIGNED_BYTE&&(Mt=n.R8)),N===n.RED_INTEGER&&(st===n.UNSIGNED_BYTE&&(Mt=n.R8UI),st===n.UNSIGNED_SHORT&&(Mt=n.R16UI),st===n.UNSIGNED_INT&&(Mt=n.R32UI),st===n.BYTE&&(Mt=n.R8I),st===n.SHORT&&(Mt=n.R16I),st===n.INT&&(Mt=n.R32I)),N===n.RG&&(st===n.FLOAT&&(Mt=n.RG32F),st===n.HALF_FLOAT&&(Mt=n.RG16F),st===n.UNSIGNED_BYTE&&(Mt=n.RG8)),N===n.RG_INTEGER&&(st===n.UNSIGNED_BYTE&&(Mt=n.RG8UI),st===n.UNSIGNED_SHORT&&(Mt=n.RG16UI),st===n.UNSIGNED_INT&&(Mt=n.RG32UI),st===n.BYTE&&(Mt=n.RG8I),st===n.SHORT&&(Mt=n.RG16I),st===n.INT&&(Mt=n.RG32I)),N===n.RGB_INTEGER&&(st===n.UNSIGNED_BYTE&&(Mt=n.RGB8UI),st===n.UNSIGNED_SHORT&&(Mt=n.RGB16UI),st===n.UNSIGNED_INT&&(Mt=n.RGB32UI),st===n.BYTE&&(Mt=n.RGB8I),st===n.SHORT&&(Mt=n.RGB16I),st===n.INT&&(Mt=n.RGB32I)),N===n.RGBA_INTEGER&&(st===n.UNSIGNED_BYTE&&(Mt=n.RGBA8UI),st===n.UNSIGNED_SHORT&&(Mt=n.RGBA16UI),st===n.UNSIGNED_INT&&(Mt=n.RGBA32UI),st===n.BYTE&&(Mt=n.RGBA8I),st===n.SHORT&&(Mt=n.RGBA16I),st===n.INT&&(Mt=n.RGBA32I)),N===n.RGB&&st===n.UNSIGNED_INT_5_9_9_9_REV&&(Mt=n.RGB9_E5),N===n.RGBA){const te=Rt?Yu:Ue.getTransfer(yt);st===n.FLOAT&&(Mt=n.RGBA32F),st===n.HALF_FLOAT&&(Mt=n.RGBA16F),st===n.UNSIGNED_BYTE&&(Mt=te===Je?n.SRGB8_ALPHA8:n.RGBA8),st===n.UNSIGNED_SHORT_4_4_4_4&&(Mt=n.RGBA4),st===n.UNSIGNED_SHORT_5_5_5_1&&(Mt=n.RGB5_A1)}return(Mt===n.R16F||Mt===n.R32F||Mt===n.RG16F||Mt===n.RG32F||Mt===n.RGBA16F||Mt===n.RGBA32F)&&t.get("EXT_color_buffer_float"),Mt}function w(U,N){let st;return U?N===null||N===fa||N===ll?st=n.DEPTH24_STENCIL8:N===ki?st=n.DEPTH32F_STENCIL8:N===$c&&(st=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):N===null||N===fa||N===ll?st=n.DEPTH_COMPONENT24:N===ki?st=n.DEPTH_COMPONENT32F:N===$c&&(st=n.DEPTH_COMPONENT16),st}function R(U,N){return y(U)===!0||U.isFramebufferTexture&&U.minFilter!==Dn&&U.minFilter!==yn?Math.log2(Math.max(N.width,N.height))+1:U.mipmaps!==void 0&&U.mipmaps.length>0?U.mipmaps.length:U.isCompressedTexture&&Array.isArray(U.image)?N.mipmaps.length:1}function T(U){const N=U.target;N.removeEventListener("dispose",T),L(N),N.isVideoTexture&&h.delete(N)}function C(U){const N=U.target;N.removeEventListener("dispose",C),E(N)}function L(U){const N=i.get(U);if(N.__webglInit===void 0)return;const st=U.source,yt=p.get(st);if(yt){const Rt=yt[N.__cacheKey];Rt.usedTimes--,Rt.usedTimes===0&&P(U),Object.keys(yt).length===0&&p.delete(st)}i.remove(U)}function P(U){const N=i.get(U);n.deleteTexture(N.__webglTexture);const st=U.source,yt=p.get(st);delete yt[N.__cacheKey],a.memory.textures--}function E(U){const N=i.get(U);if(U.depthTexture&&(U.depthTexture.dispose(),i.remove(U.depthTexture)),U.isWebGLCubeRenderTarget)for(let yt=0;yt<6;yt++){if(Array.isArray(N.__webglFramebuffer[yt]))for(let Rt=0;Rt=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+s.maxTextures),D+=1,U}function W(U){const N=[];return N.push(U.wrapS),N.push(U.wrapT),N.push(U.wrapR||0),N.push(U.magFilter),N.push(U.minFilter),N.push(U.anisotropy),N.push(U.internalFormat),N.push(U.format),N.push(U.type),N.push(U.generateMipmaps),N.push(U.premultiplyAlpha),N.push(U.flipY),N.push(U.unpackAlignment),N.push(U.colorSpace),N.join()}function Q(U,N){const st=i.get(U);if(U.isVideoTexture&&Ct(U),U.isRenderTargetTexture===!1&&U.version>0&&st.__version!==U.version){const yt=U.image;if(yt===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(yt.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{q(st,U,N);return}}e.bindTexture(n.TEXTURE_2D,st.__webglTexture,n.TEXTURE0+N)}function Y(U,N){const st=i.get(U);if(U.version>0&&st.__version!==U.version){q(st,U,N);return}e.bindTexture(n.TEXTURE_2D_ARRAY,st.__webglTexture,n.TEXTURE0+N)}function ot(U,N){const st=i.get(U);if(U.version>0&&st.__version!==U.version){q(st,U,N);return}e.bindTexture(n.TEXTURE_3D,st.__webglTexture,n.TEXTURE0+N)}function H(U,N){const st=i.get(U);if(U.version>0&&st.__version!==U.version){rt(st,U,N);return}e.bindTexture(n.TEXTURE_CUBE_MAP,st.__webglTexture,n.TEXTURE0+N)}const Z={[$a]:n.REPEAT,[es]:n.CLAMP_TO_EDGE,[Yc]:n.MIRRORED_REPEAT},it={[Dn]:n.NEAREST,[q0]:n.NEAREST_MIPMAP_NEAREST,[Vo]:n.NEAREST_MIPMAP_LINEAR,[yn]:n.LINEAR,[Fc]:n.LINEAR_MIPMAP_NEAREST,[ws]:n.LINEAR_MIPMAP_LINEAR},$={[G2]:n.NEVER,[Y2]:n.ALWAYS,[V2]:n.LESS,[l1]:n.LEQUAL,[W2]:n.EQUAL,[q2]:n.GEQUAL,[j2]:n.GREATER,[X2]:n.NOTEQUAL};function lt(U,N){if(N.type===ki&&t.has("OES_texture_float_linear")===!1&&(N.magFilter===yn||N.magFilter===Fc||N.magFilter===Vo||N.magFilter===ws||N.minFilter===yn||N.minFilter===Fc||N.minFilter===Vo||N.minFilter===ws)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(U,n.TEXTURE_WRAP_S,Z[N.wrapS]),n.texParameteri(U,n.TEXTURE_WRAP_T,Z[N.wrapT]),(U===n.TEXTURE_3D||U===n.TEXTURE_2D_ARRAY)&&n.texParameteri(U,n.TEXTURE_WRAP_R,Z[N.wrapR]),n.texParameteri(U,n.TEXTURE_MAG_FILTER,it[N.magFilter]),n.texParameteri(U,n.TEXTURE_MIN_FILTER,it[N.minFilter]),N.compareFunction&&(n.texParameteri(U,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(U,n.TEXTURE_COMPARE_FUNC,$[N.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(N.magFilter===Dn||N.minFilter!==Vo&&N.minFilter!==ws||N.type===ki&&t.has("OES_texture_float_linear")===!1)return;if(N.anisotropy>1||i.get(N).__currentAnisotropy){const st=t.get("EXT_texture_filter_anisotropic");n.texParameterf(U,st.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,s.getMaxAnisotropy())),i.get(N).__currentAnisotropy=N.anisotropy}}}function _t(U,N){let st=!1;U.__webglInit===void 0&&(U.__webglInit=!0,N.addEventListener("dispose",T));const yt=N.source;let Rt=p.get(yt);Rt===void 0&&(Rt={},p.set(yt,Rt));const Mt=W(N);if(Mt!==U.__cacheKey){Rt[Mt]===void 0&&(Rt[Mt]={texture:n.createTexture(),usedTimes:0},a.memory.textures++,st=!0),Rt[Mt].usedTimes++;const te=Rt[U.__cacheKey];te!==void 0&&(Rt[U.__cacheKey].usedTimes--,te.usedTimes===0&&P(N)),U.__cacheKey=Mt,U.__webglTexture=Rt[Mt].texture}return st}function q(U,N,st){let yt=n.TEXTURE_2D;(N.isDataArrayTexture||N.isCompressedArrayTexture)&&(yt=n.TEXTURE_2D_ARRAY),N.isData3DTexture&&(yt=n.TEXTURE_3D);const Rt=_t(U,N),Mt=N.source;e.bindTexture(yt,U.__webglTexture,n.TEXTURE0+st);const te=i.get(Mt);if(Mt.version!==te.__version||Rt===!0){e.activeTexture(n.TEXTURE0+st);const zt=Ue.getPrimaries(Ue.workingColorSpace),Zt=N.colorSpace===Qr?null:Ue.getPrimaries(N.colorSpace),Re=N.colorSpace===Qr||zt===Zt?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,N.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,N.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Re);let at=x(N.image,!1,s.maxTextureSize);at=ne(N,at);const Tt=r.convert(N.format,N.colorSpace),ae=r.convert(N.type);let ue=S(N.internalFormat,Tt,ae,N.colorSpace,N.isVideoTexture);lt(yt,N);let Vt;const X=N.mipmaps,bt=N.isVideoTexture!==!0,Gt=te.__version===void 0||Rt===!0,j=Mt.dataReady,Ot=R(N,at);if(N.isDepthTexture)ue=w(N.format===cl,N.type),Gt&&(bt?e.texStorage2D(n.TEXTURE_2D,1,ue,at.width,at.height):e.texImage2D(n.TEXTURE_2D,0,ue,at.width,at.height,0,Tt,ae,null));else if(N.isDataTexture)if(X.length>0){bt&&Gt&&e.texStorage2D(n.TEXTURE_2D,Ot,ue,X[0].width,X[0].height);for(let pt=0,At=X.length;pt0){const Kt=iv(Vt.width,Vt.height,N.format,N.type);for(const Wt of N.layerUpdates){const pe=Vt.data.subarray(Wt*Kt/Vt.data.BYTES_PER_ELEMENT,(Wt+1)*Kt/Vt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,pt,0,0,Wt,Vt.width,Vt.height,1,Tt,pe)}N.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,pt,0,0,0,Vt.width,Vt.height,at.depth,Tt,Vt.data)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,pt,ue,Vt.width,Vt.height,at.depth,0,Vt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else bt?j&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,pt,0,0,0,Vt.width,Vt.height,at.depth,Tt,ae,Vt.data):e.texImage3D(n.TEXTURE_2D_ARRAY,pt,ue,Vt.width,Vt.height,at.depth,0,Tt,ae,Vt.data)}else{bt&&Gt&&e.texStorage2D(n.TEXTURE_2D,Ot,ue,X[0].width,X[0].height);for(let pt=0,At=X.length;pt0){const pt=iv(at.width,at.height,N.format,N.type);for(const At of N.layerUpdates){const Kt=at.data.subarray(At*pt/at.data.BYTES_PER_ELEMENT,(At+1)*pt/at.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,At,at.width,at.height,1,Tt,ae,Kt)}N.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,at.width,at.height,at.depth,Tt,ae,at.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,ue,at.width,at.height,at.depth,0,Tt,ae,at.data);else if(N.isData3DTexture)bt?(Gt&&e.texStorage3D(n.TEXTURE_3D,Ot,ue,at.width,at.height,at.depth),j&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,at.width,at.height,at.depth,Tt,ae,at.data)):e.texImage3D(n.TEXTURE_3D,0,ue,at.width,at.height,at.depth,0,Tt,ae,at.data);else if(N.isFramebufferTexture){if(Gt)if(bt)e.texStorage2D(n.TEXTURE_2D,Ot,ue,at.width,at.height);else{let pt=at.width,At=at.height;for(let Kt=0;Kt>=1,At>>=1}}else if(X.length>0){if(bt&&Gt){const pt=Ft(X[0]);e.texStorage2D(n.TEXTURE_2D,Ot,ue,pt.width,pt.height)}for(let pt=0,At=X.length;pt0&&Ot++;const At=Ft(Tt[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,Ot,X,At.width,At.height)}for(let At=0;At<6;At++)if(at){bt?j&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+At,0,0,0,Tt[At].width,Tt[At].height,ue,Vt,Tt[At].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+At,0,X,Tt[At].width,Tt[At].height,0,ue,Vt,Tt[At].data);for(let Kt=0;Kt>Mt),ae=Math.max(1,N.height>>Mt);Rt===n.TEXTURE_3D||Rt===n.TEXTURE_2D_ARRAY?e.texImage3D(Rt,Mt,Zt,Tt,ae,N.depth,0,te,zt,null):e.texImage2D(Rt,Mt,Zt,Tt,ae,0,te,zt,null)}e.bindFramebuffer(n.FRAMEBUFFER,U),Lt(N)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,yt,Rt,at.__webglTexture,0,wt(N)):(Rt===n.TEXTURE_2D||Rt>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Rt<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,yt,Rt,at.__webglTexture,Mt),e.bindFramebuffer(n.FRAMEBUFFER,null)}function dt(U,N,st){if(n.bindRenderbuffer(n.RENDERBUFFER,U),N.depthBuffer){const yt=N.depthTexture,Rt=yt&&yt.isDepthTexture?yt.type:null,Mt=w(N.stencilBuffer,Rt),te=N.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,zt=wt(N);Lt(N)?o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,zt,Mt,N.width,N.height):st?n.renderbufferStorageMultisample(n.RENDERBUFFER,zt,Mt,N.width,N.height):n.renderbufferStorage(n.RENDERBUFFER,Mt,N.width,N.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,te,n.RENDERBUFFER,U)}else{const yt=N.textures;for(let Rt=0;Rt{delete N.__boundDepthTexture,delete N.__depthDisposeCallback,yt.removeEventListener("dispose",Rt)};yt.addEventListener("dispose",Rt),N.__depthDisposeCallback=Rt}N.__boundDepthTexture=yt}if(U.depthTexture&&!N.__autoAllocateDepthBuffer){if(st)throw new Error("target.depthTexture not supported in Cube render targets");It(N.__webglFramebuffer,U)}else if(st){N.__webglDepthbuffer=[];for(let yt=0;yt<6;yt++)if(e.bindFramebuffer(n.FRAMEBUFFER,N.__webglFramebuffer[yt]),N.__webglDepthbuffer[yt]===void 0)N.__webglDepthbuffer[yt]=n.createRenderbuffer(),dt(N.__webglDepthbuffer[yt],U,!1);else{const Rt=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Mt=N.__webglDepthbuffer[yt];n.bindRenderbuffer(n.RENDERBUFFER,Mt),n.framebufferRenderbuffer(n.FRAMEBUFFER,Rt,n.RENDERBUFFER,Mt)}}else if(e.bindFramebuffer(n.FRAMEBUFFER,N.__webglFramebuffer),N.__webglDepthbuffer===void 0)N.__webglDepthbuffer=n.createRenderbuffer(),dt(N.__webglDepthbuffer,U,!1);else{const yt=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Rt=N.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,Rt),n.framebufferRenderbuffer(n.FRAMEBUFFER,yt,n.RENDERBUFFER,Rt)}e.bindFramebuffer(n.FRAMEBUFFER,null)}function Bt(U,N,st){const yt=i.get(U);N!==void 0&&St(yt.__webglFramebuffer,U,U.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),st!==void 0&&Ht(U)}function Qt(U){const N=U.texture,st=i.get(U),yt=i.get(N);U.addEventListener("dispose",C);const Rt=U.textures,Mt=U.isWebGLCubeRenderTarget===!0,te=Rt.length>1;if(te||(yt.__webglTexture===void 0&&(yt.__webglTexture=n.createTexture()),yt.__version=N.version,a.memory.textures++),Mt){st.__webglFramebuffer=[];for(let zt=0;zt<6;zt++)if(N.mipmaps&&N.mipmaps.length>0){st.__webglFramebuffer[zt]=[];for(let Zt=0;Zt0){st.__webglFramebuffer=[];for(let zt=0;zt0&&Lt(U)===!1){st.__webglMultisampledFramebuffer=n.createFramebuffer(),st.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,st.__webglMultisampledFramebuffer);for(let zt=0;zt0)for(let Zt=0;Zt0)for(let Zt=0;Zt0){if(Lt(U)===!1){const N=U.textures,st=U.width,yt=U.height;let Rt=n.COLOR_BUFFER_BIT;const Mt=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,te=i.get(U),zt=N.length>1;if(zt)for(let Zt=0;Zt0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&N.__useRenderToTexture!==!1}function Ct(U){const N=a.render.frame;h.get(U)!==N&&(h.set(U,N),U.update())}function ne(U,N){const st=U.colorSpace,yt=U.format,Rt=U.type;return U.isCompressedTexture===!0||U.isVideoTexture===!0||st!==$n&&st!==Qr&&(Ue.getTransfer(st)===Je?(yt!==di||Rt!==Xs)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",st)),N}function Ft(U){return typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement?(c.width=U.naturalWidth||U.width,c.height=U.naturalHeight||U.height):typeof VideoFrame<"u"&&U instanceof VideoFrame?(c.width=U.displayWidth,c.height=U.displayHeight):(c.width=U.width,c.height=U.height),c}this.allocateTextureUnit=G,this.resetTextureUnits=z,this.setTexture2D=Q,this.setTexture2DArray=Y,this.setTexture3D=ot,this.setTextureCube=H,this.rebindTextures=Bt,this.setupRenderTarget=Qt,this.updateRenderTargetMipmap=ht,this.updateMultisampleRenderTarget=Et,this.setupDepthRenderbuffer=Ht,this.setupFrameBufferTexture=St,this.useMultisampledRTT=Lt}function nR(n,t){function e(i,s=Qr){let r;const a=Ue.getTransfer(s);if(i===Xs)return n.UNSIGNED_BYTE;if(i===$0)return n.UNSIGNED_SHORT_4_4_4_4;if(i===Z0)return n.UNSIGNED_SHORT_5_5_5_1;if(i===Qv)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===Kv)return n.BYTE;if(i===Jv)return n.SHORT;if(i===$c)return n.UNSIGNED_SHORT;if(i===Y0)return n.INT;if(i===fa)return n.UNSIGNED_INT;if(i===ki)return n.FLOAT;if(i===hh)return n.HALF_FLOAT;if(i===t1)return n.ALPHA;if(i===e1)return n.RGB;if(i===di)return n.RGBA;if(i===n1)return n.LUMINANCE;if(i===i1)return n.LUMINANCE_ALPHA;if(i===tl)return n.DEPTH_COMPONENT;if(i===cl)return n.DEPTH_STENCIL;if(i===K0)return n.RED;if(i===Af)return n.RED_INTEGER;if(i===s1)return n.RG;if(i===J0)return n.RG_INTEGER;if(i===Q0)return n.RGBA_INTEGER;if(i===Su||i===Eu||i===Au||i===Tu)if(a===Je)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===Su)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Eu)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Au)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Tu)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===Su)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Eu)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Au)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Tu)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===$m||i===Zm||i===Km||i===Jm)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===$m)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Zm)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Km)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Jm)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Qm||i===t0||i===e0)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(i===Qm||i===t0)return a===Je?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===e0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===n0||i===i0||i===s0||i===r0||i===a0||i===o0||i===l0||i===c0||i===h0||i===u0||i===f0||i===d0||i===p0||i===m0)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(i===n0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===i0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===s0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===r0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===a0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===o0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===l0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===c0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===h0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===u0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===f0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===d0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===p0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===m0)return a===Je?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Cu||i===g0||i===y0)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(i===Cu)return a===Je?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===g0)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===y0)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===r1||i===_0||i===x0||i===v0)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(i===Cu)return r.COMPRESSED_RED_RGTC1_EXT;if(i===_0)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===x0)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===v0)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ll?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:e}}const p5={type:"move"};class F_{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new na,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 na,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new O,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new O),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new na,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new O,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new O),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 s=null,r=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 x of t.hand.values()){const y=e.getJointPose(x,i),_=this._getHandJoint(c,x);y!==null&&(_.matrix.fromArray(y.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.matrixWorldNeedsUpdate=!0,_.jointRadius=y.radius),_.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&&(r=e.getPose(t.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(s=e.getPose(t.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(p5)))}return o!==null&&(o.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const i=new na;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}const m5=` void main() { gl_Position = vec4( position, 1.0 ); -}`,p5=` +}`,g5=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -3830,7 +3830,7 @@ void main() { } -}`;class m5{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){const s=new bn,r=t.properties.get(s);r.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,i=new $s({vertexShader:d5,fragmentShader:p5,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new Mn(new fh(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class g5 extends Zs{constructor(t,e){super();const i=this;let s=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,p=null,m=null,g=null;const x=new m5,y=e.getContextAttributes();let _=null,b=null;const S=[],w=[],R=new xt;let T=null;const C=new gn;C.viewport=new Ge;const L=new gn;L.viewport=new Ge;const P=[C,L],E=new jC;let D=null,z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let rt=S[q];return rt===void 0&&(rt=new F_,S[q]=rt),rt.getTargetRaySpace()},this.getControllerGrip=function(q){let rt=S[q];return rt===void 0&&(rt=new F_,S[q]=rt),rt.getGripSpace()},this.getHand=function(q){let rt=S[q];return rt===void 0&&(rt=new F_,S[q]=rt),rt.getHandSpace()};function G(q){const rt=w.indexOf(q.inputSource);if(rt===-1)return;const St=S[rt];St!==void 0&&(St.update(q.inputSource,q.frame,c||a),St.dispatchEvent({type:q.type,data:q.inputSource}))}function W(){s.removeEventListener("select",G),s.removeEventListener("selectstart",G),s.removeEventListener("selectend",G),s.removeEventListener("squeeze",G),s.removeEventListener("squeezestart",G),s.removeEventListener("squeezeend",G),s.removeEventListener("end",W),s.removeEventListener("inputsourceschange",Q);for(let q=0;q=0&&(w[dt]=null,S[dt].disconnect(St))}for(let rt=0;rt=w.length){w.push(St),dt=Ht;break}else if(w[Ht]===null){w[Ht]=St,dt=Ht;break}if(dt===-1)break}const It=S[dt];It&&It.connect(St)}}const Y=new O,ot=new O;function H(q,rt,St){Y.setFromMatrixPosition(rt.matrixWorld),ot.setFromMatrixPosition(St.matrixWorld);const dt=Y.distanceTo(ot),It=rt.projectionMatrix.elements,Ht=St.projectionMatrix.elements,Bt=It[14]/(It[10]-1),Qt=It[14]/(It[10]+1),ht=(It[9]+1)/It[5],gt=(It[9]-1)/It[5],k=(It[8]-1)/It[0],Et=(Ht[8]+1)/Ht[0],wt=Bt*k,Lt=Bt*Et,Ct=dt/(-k+Et),ne=Ct*-k;if(rt.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(ne),q.translateZ(Ct),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert(),It[10]===-1)q.projectionMatrix.copy(rt.projectionMatrix),q.projectionMatrixInverse.copy(rt.projectionMatrixInverse);else{const Ft=Bt+Ct,U=Qt+Ct,N=wt-ne,st=Lt+(dt-ne),yt=ht*Qt/U*Ft,Rt=gt*Qt/U*Ft;q.projectionMatrix.makePerspective(N,st,yt,Rt,Ft,U),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}}function Z(q,rt){rt===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(rt.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(s===null)return;let rt=q.near,St=q.far;x.texture!==null&&(x.depthNear>0&&(rt=x.depthNear),x.depthFar>0&&(St=x.depthFar)),E.near=L.near=C.near=rt,E.far=L.far=C.far=St,(D!==E.near||z!==E.far)&&(s.updateRenderState({depthNear:E.near,depthFar:E.far}),D=E.near,z=E.far),C.layers.mask=q.layers.mask|2,L.layers.mask=q.layers.mask|4,E.layers.mask=C.layers.mask|L.layers.mask;const dt=q.parent,It=E.cameras;Z(E,dt);for(let Ht=0;Ht0&&(y.alphaTest.value=_.alphaTest);const b=t.get(_),S=b.envMap,w=b.envMapRotation;S&&(y.envMap.value=S,Lo.copy(w),Lo.x*=-1,Lo.y*=-1,Lo.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(Lo.y*=-1,Lo.z*=-1),y.envMapRotation.value.setFromMatrix4(y5.makeRotationFromEuler(Lo)),y.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=_.reflectivity,y.ior.value=_.ior,y.refractionRatio.value=_.refractionRatio),_.lightMap&&(y.lightMap.value=_.lightMap,y.lightMapIntensity.value=_.lightMapIntensity,e(_.lightMap,y.lightMapTransform)),_.aoMap&&(y.aoMap.value=_.aoMap,y.aoMapIntensity.value=_.aoMapIntensity,e(_.aoMap,y.aoMapTransform))}function a(y,_){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity,_.map&&(y.map.value=_.map,e(_.map,y.mapTransform))}function o(y,_){y.dashSize.value=_.dashSize,y.totalSize.value=_.dashSize+_.gapSize,y.scale.value=_.scale}function l(y,_,b,S){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity,y.size.value=_.size*b,y.scale.value=S*.5,_.map&&(y.map.value=_.map,e(_.map,y.uvTransform)),_.alphaMap&&(y.alphaMap.value=_.alphaMap,e(_.alphaMap,y.alphaMapTransform)),_.alphaTest>0&&(y.alphaTest.value=_.alphaTest)}function c(y,_){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity,y.rotation.value=_.rotation,_.map&&(y.map.value=_.map,e(_.map,y.mapTransform)),_.alphaMap&&(y.alphaMap.value=_.alphaMap,e(_.alphaMap,y.alphaMapTransform)),_.alphaTest>0&&(y.alphaTest.value=_.alphaTest)}function h(y,_){y.specular.value.copy(_.specular),y.shininess.value=Math.max(_.shininess,1e-4)}function u(y,_){_.gradientMap&&(y.gradientMap.value=_.gradientMap)}function p(y,_){y.metalness.value=_.metalness,_.metalnessMap&&(y.metalnessMap.value=_.metalnessMap,e(_.metalnessMap,y.metalnessMapTransform)),y.roughness.value=_.roughness,_.roughnessMap&&(y.roughnessMap.value=_.roughnessMap,e(_.roughnessMap,y.roughnessMapTransform)),_.envMap&&(y.envMapIntensity.value=_.envMapIntensity)}function m(y,_,b){y.ior.value=_.ior,_.sheen>0&&(y.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),y.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(y.sheenColorMap.value=_.sheenColorMap,e(_.sheenColorMap,y.sheenColorMapTransform)),_.sheenRoughnessMap&&(y.sheenRoughnessMap.value=_.sheenRoughnessMap,e(_.sheenRoughnessMap,y.sheenRoughnessMapTransform))),_.clearcoat>0&&(y.clearcoat.value=_.clearcoat,y.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(y.clearcoatMap.value=_.clearcoatMap,e(_.clearcoatMap,y.clearcoatMapTransform)),_.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap,e(_.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),_.clearcoatNormalMap&&(y.clearcoatNormalMap.value=_.clearcoatNormalMap,e(_.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),_.side===Si&&y.clearcoatNormalScale.value.negate())),_.dispersion>0&&(y.dispersion.value=_.dispersion),_.iridescence>0&&(y.iridescence.value=_.iridescence,y.iridescenceIOR.value=_.iridescenceIOR,y.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1],_.iridescenceMap&&(y.iridescenceMap.value=_.iridescenceMap,e(_.iridescenceMap,y.iridescenceMapTransform)),_.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=_.iridescenceThicknessMap,e(_.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),_.transmission>0&&(y.transmission.value=_.transmission,y.transmissionSamplerMap.value=b.texture,y.transmissionSamplerSize.value.set(b.width,b.height),_.transmissionMap&&(y.transmissionMap.value=_.transmissionMap,e(_.transmissionMap,y.transmissionMapTransform)),y.thickness.value=_.thickness,_.thicknessMap&&(y.thicknessMap.value=_.thicknessMap,e(_.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=_.attenuationDistance,y.attenuationColor.value.copy(_.attenuationColor)),_.anisotropy>0&&(y.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation)),_.anisotropyMap&&(y.anisotropyMap.value=_.anisotropyMap,e(_.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=_.specularIntensity,y.specularColor.value.copy(_.specularColor),_.specularColorMap&&(y.specularColorMap.value=_.specularColorMap,e(_.specularColorMap,y.specularColorMapTransform)),_.specularIntensityMap&&(y.specularIntensityMap.value=_.specularIntensityMap,e(_.specularIntensityMap,y.specularIntensityMapTransform))}function g(y,_){_.matcap&&(y.matcap.value=_.matcap)}function x(y,_){const b=t.get(_).light;y.referencePosition.value.setFromMatrixPosition(b.matrixWorld),y.nearDistance.value=b.shadow.camera.near,y.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function x5(n,t,e,i){let s={},r={},a=[];const o=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,S){const w=S.program;i.uniformBlockBinding(b,w)}function c(b,S){let w=s[b.id];w===void 0&&(g(b),w=h(b),s[b.id]=w,b.addEventListener("dispose",y));const R=S.program;i.updateUBOMapping(b,R);const T=t.render.frame;r[b.id]!==T&&(p(b),r[b.id]=T)}function h(b){const S=u();b.__bindingPointIndex=S;const w=n.createBuffer(),R=b.__size,T=b.usage;return n.bindBuffer(n.UNIFORM_BUFFER,w),n.bufferData(n.UNIFORM_BUFFER,R,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,S,w),w}function u(){for(let b=0;b0&&(w+=R-T),b.__size=w,b.__cache={},this}function x(b){const S={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(S.boundary=4,S.storage=4):b.isVector2?(S.boundary=8,S.storage=8):b.isVector3||b.isColor?(S.boundary=16,S.storage=12):b.isVector4?(S.boundary=16,S.storage=16):b.isMatrix3?(S.boundary=48,S.storage=48):b.isMatrix4?(S.boundary=64,S.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),S}function y(b){const S=b.target;S.removeEventListener("dispose",y);const w=a.indexOf(S.__bindingPointIndex);a.splice(w,1),n.deleteBuffer(s[S.id]),delete s[S.id],delete r[S.id]}function _(){for(const b in s)n.deleteBuffer(s[b]);a=[],s={},r={}}return{bind:l,update:c,dispose:_}}class iR{constructor(t={}){const{canvas:e=J2(),context:i=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:p=!1}=t;this.isWebGLRenderer=!0;let m;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");m=i.getContextAttributes().alpha}else m=a;const g=new Uint32Array(4),x=new Int32Array(4);let y=null,_=null;const b=[],S=[];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=fn,this.toneMapping=wr,this.toneMappingExposure=1;const w=this;let R=!1,T=0,C=0,L=null,P=-1,E=null;const D=new Ge,z=new Ge;let G=null;const W=new kt(0);let Q=0,Y=e.width,ot=e.height,H=1,Z=null,it=null;const $=new Ge(0,0,Y,ot),lt=new Ge(0,0,Y,ot);let _t=!1;const q=new If;let rt=!1,St=!1;const dt=new ye,It=new ye,Ht=new O,Bt=new Ge,Qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ht=!1;function gt(){return L===null?H:1}let k=i;function Et(F,tt){return e.getContext(F,tt)}try{const F={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${W0}`),e.addEventListener("webglcontextlost",At,!1),e.addEventListener("webglcontextrestored",Kt,!1),e.addEventListener("webglcontextcreationerror",Wt,!1),k===null){const tt="webgl2";if(k=Et(tt,F),k===null)throw Et(tt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(F){throw console.error("THREE.WebGLRenderer: "+F.message),F}let wt,Lt,Ct,ne,Ft,U,N,st,yt,Rt,Mt,te,zt,Zt,Re,at,Tt,ae,ue,Vt,X,bt,Gt,j;function Ot(){wt=new PB(k),wt.init(),bt=new nR(k,wt),Lt=new SB(k,wt,t,bt),Ct=new h5(k,wt),Lt.reverseDepthBuffer&&p&&Ct.buffers.depth.setReversed(!0),ne=new DB(k),Ft=new K4,U=new u5(k,wt,Ct,Ft,Lt,bt,ne),N=new AB(w),st=new RB(w),yt=new BU(k),Gt=new bB(k,yt),Rt=new IB(k,yt,ne,Gt),Mt=new OB(k,Rt,yt,ne),ue=new NB(k,Lt,U),at=new EB(Ft),te=new Z4(w,N,st,wt,Lt,Gt,at),zt=new _5(w,Ft),Zt=new Q4,Re=new r5(wt),ae=new MB(w,N,st,Ct,Mt,m,l),Tt=new l5(w,Mt,Lt),j=new x5(k,ne,Lt,Ct),Vt=new wB(k,wt,ne),X=new LB(k,wt,ne),ne.programs=te.programs,w.capabilities=Lt,w.extensions=wt,w.properties=Ft,w.renderLists=Zt,w.shadowMap=Tt,w.state=Ct,w.info=ne}Ot();const pt=new g5(w,k);this.xr=pt,this.getContext=function(){return k},this.getContextAttributes=function(){return k.getContextAttributes()},this.forceContextLoss=function(){const F=wt.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=wt.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(F){F!==void 0&&(H=F,this.setSize(Y,ot,!1))},this.getSize=function(F){return F.set(Y,ot)},this.setSize=function(F,tt,ut=!0){if(pt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Y=F,ot=tt,e.width=Math.floor(F*H),e.height=Math.floor(tt*H),ut===!0&&(e.style.width=F+"px",e.style.height=tt+"px"),this.setViewport(0,0,F,tt)},this.getDrawingBufferSize=function(F){return F.set(Y*H,ot*H).floor()},this.setDrawingBufferSize=function(F,tt,ut){Y=F,ot=tt,H=ut,e.width=Math.floor(F*ut),e.height=Math.floor(tt*ut),this.setViewport(0,0,F,tt)},this.getCurrentViewport=function(F){return F.copy(D)},this.getViewport=function(F){return F.copy($)},this.setViewport=function(F,tt,ut,ft){F.isVector4?$.set(F.x,F.y,F.z,F.w):$.set(F,tt,ut,ft),Ct.viewport(D.copy($).multiplyScalar(H).round())},this.getScissor=function(F){return F.copy(lt)},this.setScissor=function(F,tt,ut,ft){F.isVector4?lt.set(F.x,F.y,F.z,F.w):lt.set(F,tt,ut,ft),Ct.scissor(z.copy(lt).multiplyScalar(H).round())},this.getScissorTest=function(){return _t},this.setScissorTest=function(F){Ct.setScissorTest(_t=F)},this.setOpaqueSort=function(F){Z=F},this.setTransparentSort=function(F){it=F},this.getClearColor=function(F){return F.copy(ae.getClearColor())},this.setClearColor=function(){ae.setClearColor.apply(ae,arguments)},this.getClearAlpha=function(){return ae.getClearAlpha()},this.setClearAlpha=function(){ae.setClearAlpha.apply(ae,arguments)},this.clear=function(F=!0,tt=!0,ut=!0){let ft=0;if(F){let nt=!1;if(L!==null){const Nt=L.texture.format;nt=Nt===Q0||Nt===J0||Nt===Af}if(nt){const Nt=L.texture.type,jt=Nt===Xs||Nt===fa||Nt===$c||Nt===ll||Nt===$0||Nt===Z0,ee=ae.getClearColor(),se=ae.getClearAlpha(),xe=ee.r,_e=ee.g,oe=ee.b;jt?(g[0]=xe,g[1]=_e,g[2]=oe,g[3]=se,k.clearBufferuiv(k.COLOR,0,g)):(x[0]=xe,x[1]=_e,x[2]=oe,x[3]=se,k.clearBufferiv(k.COLOR,0,x))}else ft|=k.COLOR_BUFFER_BIT}tt&&(ft|=k.DEPTH_BUFFER_BIT),ut&&(ft|=k.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),k.clear(ft)},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",At,!1),e.removeEventListener("webglcontextrestored",Kt,!1),e.removeEventListener("webglcontextcreationerror",Wt,!1),ae.dispose(),Zt.dispose(),Re.dispose(),Ft.dispose(),N.dispose(),st.dispose(),Mt.dispose(),Gt.dispose(),j.dispose(),te.dispose(),pt.dispose(),pt.removeEventListener("sessionstart",Kf),pt.removeEventListener("sessionend",Jf),tr.stop()};function At(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function Kt(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;const F=ne.autoReset,tt=Tt.enabled,ut=Tt.autoUpdate,ft=Tt.needsUpdate,nt=Tt.type;Ot(),ne.autoReset=F,Tt.enabled=tt,Tt.autoUpdate=ut,Tt.needsUpdate=ft,Tt.type=nt}function Wt(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function pe(F){const tt=F.target;tt.removeEventListener("dispose",pe),Be(tt)}function Be(F){nn(F),Ft.remove(F)}function nn(F){const tt=Ft.get(F).programs;tt!==void 0&&(tt.forEach(function(ut){te.releaseProgram(ut)}),F.isShaderMaterial&&te.releaseShaderCache(F))}this.renderBufferDirect=function(F,tt,ut,ft,nt,Nt){tt===null&&(tt=Qt);const jt=nt.isMesh&&nt.matrixWorld.determinant()<0,ee=Lg(F,tt,ut,ft,nt);Ct.setMaterial(ft,jt);let se=ut.index,xe=1;if(ft.wireframe===!0){if(se=Rt.getWireframeAttribute(ut),se===void 0)return;xe=2}const _e=ut.drawRange,oe=ut.attributes.position;let le=_e.start*xe,fe=(_e.start+_e.count)*xe;Nt!==null&&(le=Math.max(le,Nt.start*xe),fe=Math.min(fe,(Nt.start+Nt.count)*xe)),se!==null?(le=Math.max(le,0),fe=Math.min(fe,se.count)):oe!=null&&(le=Math.max(le,0),fe=Math.min(fe,oe.count));const Ke=fe-le;if(Ke<0||Ke===1/0)return;Gt.setup(nt,ft,ee,ut,se);let Ne,Me=Vt;if(se!==null&&(Ne=yt.get(se),Me=X,Me.setIndex(Ne)),nt.isMesh)ft.wireframe===!0?(Ct.setLineWidth(ft.wireframeLinewidth*gt()),Me.setMode(k.LINES)):Me.setMode(k.TRIANGLES);else if(nt.isLine){let ce=ft.linewidth;ce===void 0&&(ce=1),Ct.setLineWidth(ce*gt()),nt.isLineSegments?Me.setMode(k.LINES):nt.isLineLoop?Me.setMode(k.LINE_LOOP):Me.setMode(k.LINE_STRIP)}else nt.isPoints?Me.setMode(k.POINTS):nt.isSprite&&Me.setMode(k.TRIANGLES);if(nt.isBatchedMesh)if(nt._multiDrawInstances!==null)Me.renderMultiDrawInstances(nt._multiDrawStarts,nt._multiDrawCounts,nt._multiDrawCount,nt._multiDrawInstances);else if(wt.get("WEBGL_multi_draw"))Me.renderMultiDraw(nt._multiDrawStarts,nt._multiDrawCounts,nt._multiDrawCount);else{const ce=nt._multiDrawStarts,rn=nt._multiDrawCounts,be=nt._multiDrawCount,Qn=se?yt.get(se).bytesPerElement:1,Ir=Ft.get(ft).currentProgram.getUniforms();for(let ti=0;ti{function Nt(){if(ft.forEach(function(jt){Ft.get(jt).currentProgram.isReady()&&ft.delete(jt)}),ft.size===0){nt(F);return}setTimeout(Nt,10)}wt.get("KHR_parallel_shader_compile")!==null?Nt():setTimeout(Nt,10)})};let wn=null;function Jn(F){wn&&wn(F)}function Kf(){tr.stop()}function Jf(){tr.start()}const tr=new KC;tr.setAnimationLoop(Jn),typeof self<"u"&&tr.setContext(self),this.setAnimationLoop=function(F){wn=F,pt.setAnimationLoop(F),F===null?tr.stop():tr.start()},pt.addEventListener("sessionstart",Kf),pt.addEventListener("sessionend",Jf),this.render=function(F,tt){if(tt!==void 0&&tt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;if(F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),tt.parent===null&&tt.matrixWorldAutoUpdate===!0&&tt.updateMatrixWorld(),pt.enabled===!0&&pt.isPresenting===!0&&(pt.cameraAutoUpdate===!0&&pt.updateCamera(tt),tt=pt.getCamera()),F.isScene===!0&&F.onBeforeRender(w,F,tt,L),_=Re.get(F,S.length),_.init(tt),S.push(_),It.multiplyMatrices(tt.projectionMatrix,tt.matrixWorldInverse),q.setFromProjectionMatrix(It),St=this.localClippingEnabled,rt=at.init(this.clippingPlanes,St),y=Zt.get(F,b.length),y.init(),b.push(y),pt.enabled===!0&&pt.isPresenting===!0){const Nt=w.xr.getDepthSensingMesh();Nt!==null&&co(Nt,tt,-1/0,w.sortObjects)}co(F,tt,0,w.sortObjects),y.finish(),w.sortObjects===!0&&y.sort(Z,it),ht=pt.enabled===!1||pt.isPresenting===!1||pt.hasDepthSensing()===!1,ht&&ae.addToRenderList(y,F),this.info.render.frame++,rt===!0&&at.beginShadows();const ut=_.state.shadowsArray;Tt.render(ut,F,tt),rt===!0&&at.endShadows(),this.info.autoReset===!0&&this.info.reset();const ft=y.opaque,nt=y.transmissive;if(_.setupLights(),tt.isArrayCamera){const Nt=tt.cameras;if(nt.length>0)for(let jt=0,ee=Nt.length;jt0&&ma(ft,nt,F,tt),ht&&ae.render(F),Qf(y,F,tt);L!==null&&(U.updateMultisampleRenderTarget(L),U.updateRenderTargetMipmap(L)),F.isScene===!0&&F.onAfterRender(w,F,tt),Gt.resetDefaultState(),P=-1,E=null,S.pop(),S.length>0?(_=S[S.length-1],rt===!0&&at.setGlobalState(w.clippingPlanes,_.state.camera)):_=null,b.pop(),b.length>0?y=b[b.length-1]:y=null};function co(F,tt,ut,ft){if(F.visible===!1)return;if(F.layers.test(tt.layers)){if(F.isGroup)ut=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(tt);else if(F.isLight)_.pushLight(F),F.castShadow&&_.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||q.intersectsSprite(F)){ft&&Bt.setFromMatrixPosition(F.matrixWorld).applyMatrix4(It);const jt=Mt.update(F),ee=F.material;ee.visible&&y.push(F,jt,ee,ut,Bt.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||q.intersectsObject(F))){const jt=Mt.update(F),ee=F.material;if(ft&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),Bt.copy(F.boundingSphere.center)):(jt.boundingSphere===null&&jt.computeBoundingSphere(),Bt.copy(jt.boundingSphere.center)),Bt.applyMatrix4(F.matrixWorld).applyMatrix4(It)),Array.isArray(ee)){const se=jt.groups;for(let xe=0,_e=se.length;xe<_e;xe++){const oe=se[xe],le=ee[oe.materialIndex];le&&le.visible&&y.push(F,jt,le,ut,Bt.z,oe)}}else ee.visible&&y.push(F,jt,ee,ut,Bt.z,null)}}const Nt=F.children;for(let jt=0,ee=Nt.length;jt0&&Sl(nt,tt,ut),Nt.length>0&&Sl(Nt,tt,ut),jt.length>0&&Sl(jt,tt,ut),Ct.buffers.depth.setTest(!0),Ct.buffers.depth.setMask(!0),Ct.buffers.color.setMask(!0),Ct.setPolygonOffset(!1)}function ma(F,tt,ut,ft){if((ut.isScene===!0?ut.overrideMaterial:null)!==null)return;_.state.transmissionRenderTarget[ft.id]===void 0&&(_.state.transmissionRenderTarget[ft.id]=new qs(1,1,{generateMipmaps:!0,type:wt.has("EXT_color_buffer_half_float")||wt.has("EXT_color_buffer_float")?hh:Xs,minFilter:ws,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Ue.workingColorSpace}));const Nt=_.state.transmissionRenderTarget[ft.id],jt=ft.viewport||D;Nt.setSize(jt.z,jt.w);const ee=w.getRenderTarget();w.setRenderTarget(Nt),w.getClearColor(W),Q=w.getClearAlpha(),Q<1&&w.setClearColor(16777215,.5),w.clear(),ht&&ae.render(ut);const se=w.toneMapping;w.toneMapping=wr;const xe=ft.viewport;if(ft.viewport!==void 0&&(ft.viewport=void 0),_.setupLightsView(ft),rt===!0&&at.setGlobalState(w.clippingPlanes,ft),Sl(F,ut,ft),U.updateMultisampleRenderTarget(Nt),U.updateRenderTargetMipmap(Nt),wt.has("WEBGL_multisampled_render_to_texture")===!1){let _e=!1;for(let oe=0,le=tt.length;oe0),oe=!!ut.morphAttributes.position,le=!!ut.morphAttributes.normal,fe=!!ut.morphAttributes.color;let Ke=wr;ft.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(Ke=w.toneMapping);const Ne=ut.morphAttributes.position||ut.morphAttributes.normal||ut.morphAttributes.color,Me=Ne!==void 0?Ne.length:0,ce=Ft.get(ft),rn=_.state.lights;if(rt===!0&&(St===!0||F!==E)){const Vn=F===E&&ft.id===P;at.setState(ft,F,Vn)}let be=!1;ft.version===ce.__version?(ce.needsLights&&ce.lightsStateVersion!==rn.state.version||ce.outputColorSpace!==ee||nt.isBatchedMesh&&ce.batching===!1||!nt.isBatchedMesh&&ce.batching===!0||nt.isBatchedMesh&&ce.batchingColor===!0&&nt.colorTexture===null||nt.isBatchedMesh&&ce.batchingColor===!1&&nt.colorTexture!==null||nt.isInstancedMesh&&ce.instancing===!1||!nt.isInstancedMesh&&ce.instancing===!0||nt.isSkinnedMesh&&ce.skinning===!1||!nt.isSkinnedMesh&&ce.skinning===!0||nt.isInstancedMesh&&ce.instancingColor===!0&&nt.instanceColor===null||nt.isInstancedMesh&&ce.instancingColor===!1&&nt.instanceColor!==null||nt.isInstancedMesh&&ce.instancingMorph===!0&&nt.morphTexture===null||nt.isInstancedMesh&&ce.instancingMorph===!1&&nt.morphTexture!==null||ce.envMap!==se||ft.fog===!0&&ce.fog!==Nt||ce.numClippingPlanes!==void 0&&(ce.numClippingPlanes!==at.numPlanes||ce.numIntersection!==at.numIntersection)||ce.vertexAlphas!==xe||ce.vertexTangents!==_e||ce.morphTargets!==oe||ce.morphNormals!==le||ce.morphColors!==fe||ce.toneMapping!==Ke||ce.morphTargetsCount!==Me)&&(be=!0):(be=!0,ce.__version=ft.version);let Qn=ce.currentProgram;be===!0&&(Qn=El(ft,tt,nt));let Ir=!1,ti=!1,er=!1;const tn=Qn.getUniforms(),an=ce.uniforms;if(Ct.useProgram(Qn.program)&&(Ir=!0,ti=!0,er=!0),ft.id!==P&&(P=ft.id,ti=!0),Ir||E!==F){Ct.buffers.depth.getReversed()?(dt.copy(F.projectionMatrix),gO(dt),yO(dt),tn.setValue(k,"projectionMatrix",dt)):tn.setValue(k,"projectionMatrix",F.projectionMatrix),tn.setValue(k,"viewMatrix",F.matrixWorldInverse);const ei=tn.map.cameraPosition;ei!==void 0&&ei.setValue(k,Ht.setFromMatrixPosition(F.matrixWorld)),Lt.logarithmicDepthBuffer&&tn.setValue(k,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(ft.isMeshPhongMaterial||ft.isMeshToonMaterial||ft.isMeshLambertMaterial||ft.isMeshBasicMaterial||ft.isMeshStandardMaterial||ft.isShaderMaterial)&&tn.setValue(k,"isOrthographic",F.isOrthographicCamera===!0),E!==F&&(E=F,ti=!0,er=!0)}if(nt.isSkinnedMesh){tn.setOptional(k,nt,"bindMatrix"),tn.setOptional(k,nt,"bindMatrixInverse");const Vn=nt.skeleton;Vn&&(Vn.boneTexture===null&&Vn.computeBoneTexture(),tn.setValue(k,"boneTexture",Vn.boneTexture,U))}nt.isBatchedMesh&&(tn.setOptional(k,nt,"batchingTexture"),tn.setValue(k,"batchingTexture",nt._matricesTexture,U),tn.setOptional(k,nt,"batchingIdTexture"),tn.setValue(k,"batchingIdTexture",nt._indirectTexture,U),tn.setOptional(k,nt,"batchingColorTexture"),nt._colorsTexture!==null&&tn.setValue(k,"batchingColorTexture",nt._colorsTexture,U));const Ti=ut.morphAttributes;if((Ti.position!==void 0||Ti.normal!==void 0||Ti.color!==void 0)&&ue.update(nt,ut,Qn),(ti||ce.receiveShadow!==nt.receiveShadow)&&(ce.receiveShadow=nt.receiveShadow,tn.setValue(k,"receiveShadow",nt.receiveShadow)),ft.isMeshGouraudMaterial&&ft.envMap!==null&&(an.envMap.value=se,an.flipEnvMap.value=se.isCubeTexture&&se.isRenderTargetTexture===!1?-1:1),ft.isMeshStandardMaterial&&ft.envMap===null&&tt.environment!==null&&(an.envMapIntensity.value=tt.environmentIntensity),ti&&(tn.setValue(k,"toneMappingExposure",w.toneMappingExposure),ce.needsLights&&Dg(an,er),Nt&&ft.fog===!0&&zt.refreshFogUniforms(an,Nt),zt.refreshMaterialUniforms(an,ft,H,ot,_.state.transmissionRenderTarget[F.id]),Cm.upload(k,ed(ce),an,U)),ft.isShaderMaterial&&ft.uniformsNeedUpdate===!0&&(Cm.upload(k,ed(ce),an,U),ft.uniformsNeedUpdate=!1),ft.isSpriteMaterial&&tn.setValue(k,"center",nt.center),tn.setValue(k,"modelViewMatrix",nt.modelViewMatrix),tn.setValue(k,"normalMatrix",nt.normalMatrix),tn.setValue(k,"modelMatrix",nt.matrixWorld),ft.isShaderMaterial||ft.isRawShaderMaterial){const Vn=ft.uniformsGroups;for(let ei=0,ga=Vn.length;ei0&&U.useMultisampledRTT(F)===!1?nt=Ft.get(F).__webglMultisampledFramebuffer:Array.isArray(_e)?nt=_e[ut]:nt=_e,D.copy(F.viewport),z.copy(F.scissor),G=F.scissorTest}else D.copy($).multiplyScalar(H).floor(),z.copy(lt).multiplyScalar(H).floor(),G=_t;if(Ct.bindFramebuffer(k.FRAMEBUFFER,nt)&&ft&&Ct.drawBuffers(F,nt),Ct.viewport(D),Ct.scissor(z),Ct.setScissorTest(G),Nt){const se=Ft.get(F.texture);k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,k.TEXTURE_CUBE_MAP_POSITIVE_X+tt,se.__webglTexture,ut)}else if(jt){const se=Ft.get(F.texture),xe=tt||0;k.framebufferTextureLayer(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,se.__webglTexture,ut||0,xe)}P=-1},this.readRenderTargetPixels=function(F,tt,ut,ft,nt,Nt,jt){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ee=Ft.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&jt!==void 0&&(ee=ee[jt]),ee){Ct.bindFramebuffer(k.FRAMEBUFFER,ee);try{const se=F.texture,xe=se.format,_e=se.type;if(!Lt.textureFormatReadable(xe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Lt.textureTypeReadable(_e)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}tt>=0&&tt<=F.width-ft&&ut>=0&&ut<=F.height-nt&&k.readPixels(tt,ut,ft,nt,bt.convert(xe),bt.convert(_e),Nt)}finally{const se=L!==null?Ft.get(L).__webglFramebuffer:null;Ct.bindFramebuffer(k.FRAMEBUFFER,se)}}},this.readRenderTargetPixelsAsync=async function(F,tt,ut,ft,nt,Nt,jt){if(!(F&&F.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ee=Ft.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&jt!==void 0&&(ee=ee[jt]),ee){const se=F.texture,xe=se.format,_e=se.type;if(!Lt.textureFormatReadable(xe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Lt.textureTypeReadable(_e))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(tt>=0&&tt<=F.width-ft&&ut>=0&&ut<=F.height-nt){Ct.bindFramebuffer(k.FRAMEBUFFER,ee);const oe=k.createBuffer();k.bindBuffer(k.PIXEL_PACK_BUFFER,oe),k.bufferData(k.PIXEL_PACK_BUFFER,Nt.byteLength,k.STREAM_READ),k.readPixels(tt,ut,ft,nt,bt.convert(xe),bt.convert(_e),0);const le=L!==null?Ft.get(L).__webglFramebuffer:null;Ct.bindFramebuffer(k.FRAMEBUFFER,le);const fe=k.fenceSync(k.SYNC_GPU_COMMANDS_COMPLETE,0);return k.flush(),await mO(k,fe,4),k.bindBuffer(k.PIXEL_PACK_BUFFER,oe),k.getBufferSubData(k.PIXEL_PACK_BUFFER,0,Nt),k.deleteBuffer(oe),k.deleteSync(fe),Nt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(F,tt=null,ut=0){F.isTexture!==!0&&(bc("WebGLRenderer: copyFramebufferToTexture function signature has changed."),tt=arguments[0]||null,F=arguments[1]);const ft=Math.pow(2,-ut),nt=Math.floor(F.image.width*ft),Nt=Math.floor(F.image.height*ft),jt=tt!==null?tt.x:0,ee=tt!==null?tt.y:0;U.setTexture2D(F,0),k.copyTexSubImage2D(k.TEXTURE_2D,ut,0,0,jt,ee,nt,Nt),Ct.unbindTexture()};const Ng=k.createFramebuffer(),Og=k.createFramebuffer();this.copyTextureToTexture=function(F,tt,ut=null,ft=null,nt=0,Nt=null){F.isTexture!==!0&&(bc("WebGLRenderer: copyTextureToTexture function signature has changed."),ft=arguments[0]||null,F=arguments[1],tt=arguments[2],Nt=arguments[3]||0,ut=null),Nt===null&&(nt!==0?(bc("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Nt=nt,nt=0):Nt=0);let jt,ee,se,xe,_e,oe,le,fe,Ke;const Ne=F.isCompressedTexture?F.mipmaps[Nt]:F.image;if(ut!==null)jt=ut.max.x-ut.min.x,ee=ut.max.y-ut.min.y,se=ut.isBox3?ut.max.z-ut.min.z:1,xe=ut.min.x,_e=ut.min.y,oe=ut.isBox3?ut.min.z:0;else{const Ti=Math.pow(2,-nt);jt=Math.floor(Ne.width*Ti),ee=Math.floor(Ne.height*Ti),F.isDataArrayTexture?se=Ne.depth:F.isData3DTexture?se=Math.floor(Ne.depth*Ti):se=1,xe=0,_e=0,oe=0}ft!==null?(le=ft.x,fe=ft.y,Ke=ft.z):(le=0,fe=0,Ke=0);const Me=bt.convert(tt.format),ce=bt.convert(tt.type);let rn;tt.isData3DTexture?(U.setTexture3D(tt,0),rn=k.TEXTURE_3D):tt.isDataArrayTexture||tt.isCompressedArrayTexture?(U.setTexture2DArray(tt,0),rn=k.TEXTURE_2D_ARRAY):(U.setTexture2D(tt,0),rn=k.TEXTURE_2D),k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,tt.flipY),k.pixelStorei(k.UNPACK_PREMULTIPLY_ALPHA_WEBGL,tt.premultiplyAlpha),k.pixelStorei(k.UNPACK_ALIGNMENT,tt.unpackAlignment);const be=k.getParameter(k.UNPACK_ROW_LENGTH),Qn=k.getParameter(k.UNPACK_IMAGE_HEIGHT),Ir=k.getParameter(k.UNPACK_SKIP_PIXELS),ti=k.getParameter(k.UNPACK_SKIP_ROWS),er=k.getParameter(k.UNPACK_SKIP_IMAGES);k.pixelStorei(k.UNPACK_ROW_LENGTH,Ne.width),k.pixelStorei(k.UNPACK_IMAGE_HEIGHT,Ne.height),k.pixelStorei(k.UNPACK_SKIP_PIXELS,xe),k.pixelStorei(k.UNPACK_SKIP_ROWS,_e),k.pixelStorei(k.UNPACK_SKIP_IMAGES,oe);const tn=F.isDataArrayTexture||F.isData3DTexture,an=tt.isDataArrayTexture||tt.isData3DTexture;if(F.isDepthTexture){const Ti=Ft.get(F),Vn=Ft.get(tt),ei=Ft.get(Ti.__renderTarget),ga=Ft.get(Vn.__renderTarget);Ct.bindFramebuffer(k.READ_FRAMEBUFFER,ei.__webglFramebuffer),Ct.bindFramebuffer(k.DRAW_FRAMEBUFFER,ga.__webglFramebuffer);for(let ls=0;ls{const{t}=Qa(),e=3,[i,s]=J.useState(0);return J.useEffect(()=>{const r=Math.floor(Math.random()*e)+1;s(r)},[]),V.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%"},children:[V.jsx("p",{style:{margin:"20px"},children:t("loadingMessage.tip"+i.toString())}),V.jsx("div",{style:{width:"80%",maxWidth:"600px",margin:"0 auto"},children:V.jsx(JT,{value:n,width:"100%",hasStripe:!0})})]})};function w5({buttonLabel:n,onClick:t,hoverText:e,className:i}){return V.jsx(Sf,{label:e,children:V.jsx(yr,{onClick:t,className:i,children:n})})}function S5({label:n}){return V.jsx(Sf,{label:n,children:V.jsx(cI,{as:"InfoOutlineIcon",margin:"5px"})})}const E5=({sliderProps:n,label:t,hoverHelpLabel:e,sliderValue:i,setSliderValue:s})=>{const[r,a]=z0.useState(!1);return V.jsxs(V.Fragment,{children:[t,e&&V.jsx(S5,{label:e}),V.jsxs(QT,{id:"slider",defaultValue:i,min:n.min,max:n.max,colorScheme:"teal",onChange:s,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[V.jsx(e2,{children:V.jsx(n2,{})}),V.jsx(Sf,{hasArrow:!0,bg:"teal.500",color:"white",placement:"top",isOpen:r,label:`${i}`,children:V.jsx(t2,{})})]})]})};var sR={exports:{}},bl={};/** +}`;class y5{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){const s=new bn,r=t.properties.get(s);r.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,i=new $s({vertexShader:m5,fragmentShader:g5,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new Mn(new fh(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class _5 extends Zs{constructor(t,e){super();const i=this;let s=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,p=null,m=null,g=null;const x=new y5,y=e.getContextAttributes();let _=null,b=null;const S=[],w=[],R=new xt;let T=null;const C=new gn;C.viewport=new Ge;const L=new gn;L.viewport=new Ge;const P=[C,L],E=new jC;let D=null,z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let rt=S[q];return rt===void 0&&(rt=new F_,S[q]=rt),rt.getTargetRaySpace()},this.getControllerGrip=function(q){let rt=S[q];return rt===void 0&&(rt=new F_,S[q]=rt),rt.getGripSpace()},this.getHand=function(q){let rt=S[q];return rt===void 0&&(rt=new F_,S[q]=rt),rt.getHandSpace()};function G(q){const rt=w.indexOf(q.inputSource);if(rt===-1)return;const St=S[rt];St!==void 0&&(St.update(q.inputSource,q.frame,c||a),St.dispatchEvent({type:q.type,data:q.inputSource}))}function W(){s.removeEventListener("select",G),s.removeEventListener("selectstart",G),s.removeEventListener("selectend",G),s.removeEventListener("squeeze",G),s.removeEventListener("squeezestart",G),s.removeEventListener("squeezeend",G),s.removeEventListener("end",W),s.removeEventListener("inputsourceschange",Q);for(let q=0;q=0&&(w[dt]=null,S[dt].disconnect(St))}for(let rt=0;rt=w.length){w.push(St),dt=Ht;break}else if(w[Ht]===null){w[Ht]=St,dt=Ht;break}if(dt===-1)break}const It=S[dt];It&&It.connect(St)}}const Y=new O,ot=new O;function H(q,rt,St){Y.setFromMatrixPosition(rt.matrixWorld),ot.setFromMatrixPosition(St.matrixWorld);const dt=Y.distanceTo(ot),It=rt.projectionMatrix.elements,Ht=St.projectionMatrix.elements,Bt=It[14]/(It[10]-1),Qt=It[14]/(It[10]+1),ht=(It[9]+1)/It[5],gt=(It[9]-1)/It[5],k=(It[8]-1)/It[0],Et=(Ht[8]+1)/Ht[0],wt=Bt*k,Lt=Bt*Et,Ct=dt/(-k+Et),ne=Ct*-k;if(rt.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(ne),q.translateZ(Ct),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert(),It[10]===-1)q.projectionMatrix.copy(rt.projectionMatrix),q.projectionMatrixInverse.copy(rt.projectionMatrixInverse);else{const Ft=Bt+Ct,U=Qt+Ct,N=wt-ne,st=Lt+(dt-ne),yt=ht*Qt/U*Ft,Rt=gt*Qt/U*Ft;q.projectionMatrix.makePerspective(N,st,yt,Rt,Ft,U),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}}function Z(q,rt){rt===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(rt.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(s===null)return;let rt=q.near,St=q.far;x.texture!==null&&(x.depthNear>0&&(rt=x.depthNear),x.depthFar>0&&(St=x.depthFar)),E.near=L.near=C.near=rt,E.far=L.far=C.far=St,(D!==E.near||z!==E.far)&&(s.updateRenderState({depthNear:E.near,depthFar:E.far}),D=E.near,z=E.far),C.layers.mask=q.layers.mask|2,L.layers.mask=q.layers.mask|4,E.layers.mask=C.layers.mask|L.layers.mask;const dt=q.parent,It=E.cameras;Z(E,dt);for(let Ht=0;Ht0&&(y.alphaTest.value=_.alphaTest);const b=t.get(_),S=b.envMap,w=b.envMapRotation;S&&(y.envMap.value=S,Lo.copy(w),Lo.x*=-1,Lo.y*=-1,Lo.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(Lo.y*=-1,Lo.z*=-1),y.envMapRotation.value.setFromMatrix4(x5.makeRotationFromEuler(Lo)),y.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=_.reflectivity,y.ior.value=_.ior,y.refractionRatio.value=_.refractionRatio),_.lightMap&&(y.lightMap.value=_.lightMap,y.lightMapIntensity.value=_.lightMapIntensity,e(_.lightMap,y.lightMapTransform)),_.aoMap&&(y.aoMap.value=_.aoMap,y.aoMapIntensity.value=_.aoMapIntensity,e(_.aoMap,y.aoMapTransform))}function a(y,_){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity,_.map&&(y.map.value=_.map,e(_.map,y.mapTransform))}function o(y,_){y.dashSize.value=_.dashSize,y.totalSize.value=_.dashSize+_.gapSize,y.scale.value=_.scale}function l(y,_,b,S){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity,y.size.value=_.size*b,y.scale.value=S*.5,_.map&&(y.map.value=_.map,e(_.map,y.uvTransform)),_.alphaMap&&(y.alphaMap.value=_.alphaMap,e(_.alphaMap,y.alphaMapTransform)),_.alphaTest>0&&(y.alphaTest.value=_.alphaTest)}function c(y,_){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity,y.rotation.value=_.rotation,_.map&&(y.map.value=_.map,e(_.map,y.mapTransform)),_.alphaMap&&(y.alphaMap.value=_.alphaMap,e(_.alphaMap,y.alphaMapTransform)),_.alphaTest>0&&(y.alphaTest.value=_.alphaTest)}function h(y,_){y.specular.value.copy(_.specular),y.shininess.value=Math.max(_.shininess,1e-4)}function u(y,_){_.gradientMap&&(y.gradientMap.value=_.gradientMap)}function p(y,_){y.metalness.value=_.metalness,_.metalnessMap&&(y.metalnessMap.value=_.metalnessMap,e(_.metalnessMap,y.metalnessMapTransform)),y.roughness.value=_.roughness,_.roughnessMap&&(y.roughnessMap.value=_.roughnessMap,e(_.roughnessMap,y.roughnessMapTransform)),_.envMap&&(y.envMapIntensity.value=_.envMapIntensity)}function m(y,_,b){y.ior.value=_.ior,_.sheen>0&&(y.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),y.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(y.sheenColorMap.value=_.sheenColorMap,e(_.sheenColorMap,y.sheenColorMapTransform)),_.sheenRoughnessMap&&(y.sheenRoughnessMap.value=_.sheenRoughnessMap,e(_.sheenRoughnessMap,y.sheenRoughnessMapTransform))),_.clearcoat>0&&(y.clearcoat.value=_.clearcoat,y.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(y.clearcoatMap.value=_.clearcoatMap,e(_.clearcoatMap,y.clearcoatMapTransform)),_.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap,e(_.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),_.clearcoatNormalMap&&(y.clearcoatNormalMap.value=_.clearcoatNormalMap,e(_.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),_.side===Si&&y.clearcoatNormalScale.value.negate())),_.dispersion>0&&(y.dispersion.value=_.dispersion),_.iridescence>0&&(y.iridescence.value=_.iridescence,y.iridescenceIOR.value=_.iridescenceIOR,y.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1],_.iridescenceMap&&(y.iridescenceMap.value=_.iridescenceMap,e(_.iridescenceMap,y.iridescenceMapTransform)),_.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=_.iridescenceThicknessMap,e(_.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),_.transmission>0&&(y.transmission.value=_.transmission,y.transmissionSamplerMap.value=b.texture,y.transmissionSamplerSize.value.set(b.width,b.height),_.transmissionMap&&(y.transmissionMap.value=_.transmissionMap,e(_.transmissionMap,y.transmissionMapTransform)),y.thickness.value=_.thickness,_.thicknessMap&&(y.thicknessMap.value=_.thicknessMap,e(_.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=_.attenuationDistance,y.attenuationColor.value.copy(_.attenuationColor)),_.anisotropy>0&&(y.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation)),_.anisotropyMap&&(y.anisotropyMap.value=_.anisotropyMap,e(_.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=_.specularIntensity,y.specularColor.value.copy(_.specularColor),_.specularColorMap&&(y.specularColorMap.value=_.specularColorMap,e(_.specularColorMap,y.specularColorMapTransform)),_.specularIntensityMap&&(y.specularIntensityMap.value=_.specularIntensityMap,e(_.specularIntensityMap,y.specularIntensityMapTransform))}function g(y,_){_.matcap&&(y.matcap.value=_.matcap)}function x(y,_){const b=t.get(_).light;y.referencePosition.value.setFromMatrixPosition(b.matrixWorld),y.nearDistance.value=b.shadow.camera.near,y.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function M5(n,t,e,i){let s={},r={},a=[];const o=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,S){const w=S.program;i.uniformBlockBinding(b,w)}function c(b,S){let w=s[b.id];w===void 0&&(g(b),w=h(b),s[b.id]=w,b.addEventListener("dispose",y));const R=S.program;i.updateUBOMapping(b,R);const T=t.render.frame;r[b.id]!==T&&(p(b),r[b.id]=T)}function h(b){const S=u();b.__bindingPointIndex=S;const w=n.createBuffer(),R=b.__size,T=b.usage;return n.bindBuffer(n.UNIFORM_BUFFER,w),n.bufferData(n.UNIFORM_BUFFER,R,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,S,w),w}function u(){for(let b=0;b0&&(w+=R-T),b.__size=w,b.__cache={},this}function x(b){const S={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(S.boundary=4,S.storage=4):b.isVector2?(S.boundary=8,S.storage=8):b.isVector3||b.isColor?(S.boundary=16,S.storage=12):b.isVector4?(S.boundary=16,S.storage=16):b.isMatrix3?(S.boundary=48,S.storage=48):b.isMatrix4?(S.boundary=64,S.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),S}function y(b){const S=b.target;S.removeEventListener("dispose",y);const w=a.indexOf(S.__bindingPointIndex);a.splice(w,1),n.deleteBuffer(s[S.id]),delete s[S.id],delete r[S.id]}function _(){for(const b in s)n.deleteBuffer(s[b]);a=[],s={},r={}}return{bind:l,update:c,dispose:_}}class iR{constructor(t={}){const{canvas:e=J2(),context:i=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:p=!1}=t;this.isWebGLRenderer=!0;let m;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");m=i.getContextAttributes().alpha}else m=a;const g=new Uint32Array(4),x=new Int32Array(4);let y=null,_=null;const b=[],S=[];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=fn,this.toneMapping=wr,this.toneMappingExposure=1;const w=this;let R=!1,T=0,C=0,L=null,P=-1,E=null;const D=new Ge,z=new Ge;let G=null;const W=new kt(0);let Q=0,Y=e.width,ot=e.height,H=1,Z=null,it=null;const $=new Ge(0,0,Y,ot),lt=new Ge(0,0,Y,ot);let _t=!1;const q=new If;let rt=!1,St=!1;const dt=new ye,It=new ye,Ht=new O,Bt=new Ge,Qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ht=!1;function gt(){return L===null?H:1}let k=i;function Et(F,tt){return e.getContext(F,tt)}try{const F={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${W0}`),e.addEventListener("webglcontextlost",At,!1),e.addEventListener("webglcontextrestored",Kt,!1),e.addEventListener("webglcontextcreationerror",Wt,!1),k===null){const tt="webgl2";if(k=Et(tt,F),k===null)throw Et(tt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(F){throw console.error("THREE.WebGLRenderer: "+F.message),F}let wt,Lt,Ct,ne,Ft,U,N,st,yt,Rt,Mt,te,zt,Zt,Re,at,Tt,ae,ue,Vt,X,bt,Gt,j;function Ot(){wt=new LB(k),wt.init(),bt=new nR(k,wt),Lt=new AB(k,wt,t,bt),Ct=new f5(k,wt),Lt.reverseDepthBuffer&&p&&Ct.buffers.depth.setReversed(!0),ne=new OB(k),Ft=new Q4,U=new d5(k,wt,Ct,Ft,Lt,bt,ne),N=new CB(w),st=new IB(w),yt=new GU(k),Gt=new SB(k,yt),Rt=new DB(k,yt,ne,Gt),Mt=new UB(k,Rt,yt,ne),ue=new FB(k,Lt,U),at=new TB(Ft),te=new J4(w,N,st,wt,Lt,Gt,at),zt=new v5(w,Ft),Zt=new e5,Re=new o5(wt),ae=new wB(w,N,st,Ct,Mt,m,l),Tt=new h5(w,Mt,Lt),j=new M5(k,ne,Lt,Ct),Vt=new EB(k,wt,ne),X=new NB(k,wt,ne),ne.programs=te.programs,w.capabilities=Lt,w.extensions=wt,w.properties=Ft,w.renderLists=Zt,w.shadowMap=Tt,w.state=Ct,w.info=ne}Ot();const pt=new _5(w,k);this.xr=pt,this.getContext=function(){return k},this.getContextAttributes=function(){return k.getContextAttributes()},this.forceContextLoss=function(){const F=wt.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=wt.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(F){F!==void 0&&(H=F,this.setSize(Y,ot,!1))},this.getSize=function(F){return F.set(Y,ot)},this.setSize=function(F,tt,ut=!0){if(pt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Y=F,ot=tt,e.width=Math.floor(F*H),e.height=Math.floor(tt*H),ut===!0&&(e.style.width=F+"px",e.style.height=tt+"px"),this.setViewport(0,0,F,tt)},this.getDrawingBufferSize=function(F){return F.set(Y*H,ot*H).floor()},this.setDrawingBufferSize=function(F,tt,ut){Y=F,ot=tt,H=ut,e.width=Math.floor(F*ut),e.height=Math.floor(tt*ut),this.setViewport(0,0,F,tt)},this.getCurrentViewport=function(F){return F.copy(D)},this.getViewport=function(F){return F.copy($)},this.setViewport=function(F,tt,ut,ft){F.isVector4?$.set(F.x,F.y,F.z,F.w):$.set(F,tt,ut,ft),Ct.viewport(D.copy($).multiplyScalar(H).round())},this.getScissor=function(F){return F.copy(lt)},this.setScissor=function(F,tt,ut,ft){F.isVector4?lt.set(F.x,F.y,F.z,F.w):lt.set(F,tt,ut,ft),Ct.scissor(z.copy(lt).multiplyScalar(H).round())},this.getScissorTest=function(){return _t},this.setScissorTest=function(F){Ct.setScissorTest(_t=F)},this.setOpaqueSort=function(F){Z=F},this.setTransparentSort=function(F){it=F},this.getClearColor=function(F){return F.copy(ae.getClearColor())},this.setClearColor=function(){ae.setClearColor.apply(ae,arguments)},this.getClearAlpha=function(){return ae.getClearAlpha()},this.setClearAlpha=function(){ae.setClearAlpha.apply(ae,arguments)},this.clear=function(F=!0,tt=!0,ut=!0){let ft=0;if(F){let nt=!1;if(L!==null){const Nt=L.texture.format;nt=Nt===Q0||Nt===J0||Nt===Af}if(nt){const Nt=L.texture.type,jt=Nt===Xs||Nt===fa||Nt===$c||Nt===ll||Nt===$0||Nt===Z0,ee=ae.getClearColor(),se=ae.getClearAlpha(),xe=ee.r,_e=ee.g,oe=ee.b;jt?(g[0]=xe,g[1]=_e,g[2]=oe,g[3]=se,k.clearBufferuiv(k.COLOR,0,g)):(x[0]=xe,x[1]=_e,x[2]=oe,x[3]=se,k.clearBufferiv(k.COLOR,0,x))}else ft|=k.COLOR_BUFFER_BIT}tt&&(ft|=k.DEPTH_BUFFER_BIT),ut&&(ft|=k.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),k.clear(ft)},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",At,!1),e.removeEventListener("webglcontextrestored",Kt,!1),e.removeEventListener("webglcontextcreationerror",Wt,!1),ae.dispose(),Zt.dispose(),Re.dispose(),Ft.dispose(),N.dispose(),st.dispose(),Mt.dispose(),Gt.dispose(),j.dispose(),te.dispose(),pt.dispose(),pt.removeEventListener("sessionstart",Kf),pt.removeEventListener("sessionend",Jf),tr.stop()};function At(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function Kt(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;const F=ne.autoReset,tt=Tt.enabled,ut=Tt.autoUpdate,ft=Tt.needsUpdate,nt=Tt.type;Ot(),ne.autoReset=F,Tt.enabled=tt,Tt.autoUpdate=ut,Tt.needsUpdate=ft,Tt.type=nt}function Wt(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function pe(F){const tt=F.target;tt.removeEventListener("dispose",pe),Be(tt)}function Be(F){nn(F),Ft.remove(F)}function nn(F){const tt=Ft.get(F).programs;tt!==void 0&&(tt.forEach(function(ut){te.releaseProgram(ut)}),F.isShaderMaterial&&te.releaseShaderCache(F))}this.renderBufferDirect=function(F,tt,ut,ft,nt,Nt){tt===null&&(tt=Qt);const jt=nt.isMesh&&nt.matrixWorld.determinant()<0,ee=Lg(F,tt,ut,ft,nt);Ct.setMaterial(ft,jt);let se=ut.index,xe=1;if(ft.wireframe===!0){if(se=Rt.getWireframeAttribute(ut),se===void 0)return;xe=2}const _e=ut.drawRange,oe=ut.attributes.position;let le=_e.start*xe,fe=(_e.start+_e.count)*xe;Nt!==null&&(le=Math.max(le,Nt.start*xe),fe=Math.min(fe,(Nt.start+Nt.count)*xe)),se!==null?(le=Math.max(le,0),fe=Math.min(fe,se.count)):oe!=null&&(le=Math.max(le,0),fe=Math.min(fe,oe.count));const Ke=fe-le;if(Ke<0||Ke===1/0)return;Gt.setup(nt,ft,ee,ut,se);let Ne,Me=Vt;if(se!==null&&(Ne=yt.get(se),Me=X,Me.setIndex(Ne)),nt.isMesh)ft.wireframe===!0?(Ct.setLineWidth(ft.wireframeLinewidth*gt()),Me.setMode(k.LINES)):Me.setMode(k.TRIANGLES);else if(nt.isLine){let ce=ft.linewidth;ce===void 0&&(ce=1),Ct.setLineWidth(ce*gt()),nt.isLineSegments?Me.setMode(k.LINES):nt.isLineLoop?Me.setMode(k.LINE_LOOP):Me.setMode(k.LINE_STRIP)}else nt.isPoints?Me.setMode(k.POINTS):nt.isSprite&&Me.setMode(k.TRIANGLES);if(nt.isBatchedMesh)if(nt._multiDrawInstances!==null)Me.renderMultiDrawInstances(nt._multiDrawStarts,nt._multiDrawCounts,nt._multiDrawCount,nt._multiDrawInstances);else if(wt.get("WEBGL_multi_draw"))Me.renderMultiDraw(nt._multiDrawStarts,nt._multiDrawCounts,nt._multiDrawCount);else{const ce=nt._multiDrawStarts,rn=nt._multiDrawCounts,be=nt._multiDrawCount,Qn=se?yt.get(se).bytesPerElement:1,Ir=Ft.get(ft).currentProgram.getUniforms();for(let ti=0;ti{function Nt(){if(ft.forEach(function(jt){Ft.get(jt).currentProgram.isReady()&&ft.delete(jt)}),ft.size===0){nt(F);return}setTimeout(Nt,10)}wt.get("KHR_parallel_shader_compile")!==null?Nt():setTimeout(Nt,10)})};let wn=null;function Jn(F){wn&&wn(F)}function Kf(){tr.stop()}function Jf(){tr.start()}const tr=new KC;tr.setAnimationLoop(Jn),typeof self<"u"&&tr.setContext(self),this.setAnimationLoop=function(F){wn=F,pt.setAnimationLoop(F),F===null?tr.stop():tr.start()},pt.addEventListener("sessionstart",Kf),pt.addEventListener("sessionend",Jf),this.render=function(F,tt){if(tt!==void 0&&tt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;if(F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),tt.parent===null&&tt.matrixWorldAutoUpdate===!0&&tt.updateMatrixWorld(),pt.enabled===!0&&pt.isPresenting===!0&&(pt.cameraAutoUpdate===!0&&pt.updateCamera(tt),tt=pt.getCamera()),F.isScene===!0&&F.onBeforeRender(w,F,tt,L),_=Re.get(F,S.length),_.init(tt),S.push(_),It.multiplyMatrices(tt.projectionMatrix,tt.matrixWorldInverse),q.setFromProjectionMatrix(It),St=this.localClippingEnabled,rt=at.init(this.clippingPlanes,St),y=Zt.get(F,b.length),y.init(),b.push(y),pt.enabled===!0&&pt.isPresenting===!0){const Nt=w.xr.getDepthSensingMesh();Nt!==null&&co(Nt,tt,-1/0,w.sortObjects)}co(F,tt,0,w.sortObjects),y.finish(),w.sortObjects===!0&&y.sort(Z,it),ht=pt.enabled===!1||pt.isPresenting===!1||pt.hasDepthSensing()===!1,ht&&ae.addToRenderList(y,F),this.info.render.frame++,rt===!0&&at.beginShadows();const ut=_.state.shadowsArray;Tt.render(ut,F,tt),rt===!0&&at.endShadows(),this.info.autoReset===!0&&this.info.reset();const ft=y.opaque,nt=y.transmissive;if(_.setupLights(),tt.isArrayCamera){const Nt=tt.cameras;if(nt.length>0)for(let jt=0,ee=Nt.length;jt0&&ma(ft,nt,F,tt),ht&&ae.render(F),Qf(y,F,tt);L!==null&&(U.updateMultisampleRenderTarget(L),U.updateRenderTargetMipmap(L)),F.isScene===!0&&F.onAfterRender(w,F,tt),Gt.resetDefaultState(),P=-1,E=null,S.pop(),S.length>0?(_=S[S.length-1],rt===!0&&at.setGlobalState(w.clippingPlanes,_.state.camera)):_=null,b.pop(),b.length>0?y=b[b.length-1]:y=null};function co(F,tt,ut,ft){if(F.visible===!1)return;if(F.layers.test(tt.layers)){if(F.isGroup)ut=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(tt);else if(F.isLight)_.pushLight(F),F.castShadow&&_.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||q.intersectsSprite(F)){ft&&Bt.setFromMatrixPosition(F.matrixWorld).applyMatrix4(It);const jt=Mt.update(F),ee=F.material;ee.visible&&y.push(F,jt,ee,ut,Bt.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||q.intersectsObject(F))){const jt=Mt.update(F),ee=F.material;if(ft&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),Bt.copy(F.boundingSphere.center)):(jt.boundingSphere===null&&jt.computeBoundingSphere(),Bt.copy(jt.boundingSphere.center)),Bt.applyMatrix4(F.matrixWorld).applyMatrix4(It)),Array.isArray(ee)){const se=jt.groups;for(let xe=0,_e=se.length;xe<_e;xe++){const oe=se[xe],le=ee[oe.materialIndex];le&&le.visible&&y.push(F,jt,le,ut,Bt.z,oe)}}else ee.visible&&y.push(F,jt,ee,ut,Bt.z,null)}}const Nt=F.children;for(let jt=0,ee=Nt.length;jt0&&Sl(nt,tt,ut),Nt.length>0&&Sl(Nt,tt,ut),jt.length>0&&Sl(jt,tt,ut),Ct.buffers.depth.setTest(!0),Ct.buffers.depth.setMask(!0),Ct.buffers.color.setMask(!0),Ct.setPolygonOffset(!1)}function ma(F,tt,ut,ft){if((ut.isScene===!0?ut.overrideMaterial:null)!==null)return;_.state.transmissionRenderTarget[ft.id]===void 0&&(_.state.transmissionRenderTarget[ft.id]=new qs(1,1,{generateMipmaps:!0,type:wt.has("EXT_color_buffer_half_float")||wt.has("EXT_color_buffer_float")?hh:Xs,minFilter:ws,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Ue.workingColorSpace}));const Nt=_.state.transmissionRenderTarget[ft.id],jt=ft.viewport||D;Nt.setSize(jt.z,jt.w);const ee=w.getRenderTarget();w.setRenderTarget(Nt),w.getClearColor(W),Q=w.getClearAlpha(),Q<1&&w.setClearColor(16777215,.5),w.clear(),ht&&ae.render(ut);const se=w.toneMapping;w.toneMapping=wr;const xe=ft.viewport;if(ft.viewport!==void 0&&(ft.viewport=void 0),_.setupLightsView(ft),rt===!0&&at.setGlobalState(w.clippingPlanes,ft),Sl(F,ut,ft),U.updateMultisampleRenderTarget(Nt),U.updateRenderTargetMipmap(Nt),wt.has("WEBGL_multisampled_render_to_texture")===!1){let _e=!1;for(let oe=0,le=tt.length;oe0),oe=!!ut.morphAttributes.position,le=!!ut.morphAttributes.normal,fe=!!ut.morphAttributes.color;let Ke=wr;ft.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(Ke=w.toneMapping);const Ne=ut.morphAttributes.position||ut.morphAttributes.normal||ut.morphAttributes.color,Me=Ne!==void 0?Ne.length:0,ce=Ft.get(ft),rn=_.state.lights;if(rt===!0&&(St===!0||F!==E)){const Vn=F===E&&ft.id===P;at.setState(ft,F,Vn)}let be=!1;ft.version===ce.__version?(ce.needsLights&&ce.lightsStateVersion!==rn.state.version||ce.outputColorSpace!==ee||nt.isBatchedMesh&&ce.batching===!1||!nt.isBatchedMesh&&ce.batching===!0||nt.isBatchedMesh&&ce.batchingColor===!0&&nt.colorTexture===null||nt.isBatchedMesh&&ce.batchingColor===!1&&nt.colorTexture!==null||nt.isInstancedMesh&&ce.instancing===!1||!nt.isInstancedMesh&&ce.instancing===!0||nt.isSkinnedMesh&&ce.skinning===!1||!nt.isSkinnedMesh&&ce.skinning===!0||nt.isInstancedMesh&&ce.instancingColor===!0&&nt.instanceColor===null||nt.isInstancedMesh&&ce.instancingColor===!1&&nt.instanceColor!==null||nt.isInstancedMesh&&ce.instancingMorph===!0&&nt.morphTexture===null||nt.isInstancedMesh&&ce.instancingMorph===!1&&nt.morphTexture!==null||ce.envMap!==se||ft.fog===!0&&ce.fog!==Nt||ce.numClippingPlanes!==void 0&&(ce.numClippingPlanes!==at.numPlanes||ce.numIntersection!==at.numIntersection)||ce.vertexAlphas!==xe||ce.vertexTangents!==_e||ce.morphTargets!==oe||ce.morphNormals!==le||ce.morphColors!==fe||ce.toneMapping!==Ke||ce.morphTargetsCount!==Me)&&(be=!0):(be=!0,ce.__version=ft.version);let Qn=ce.currentProgram;be===!0&&(Qn=El(ft,tt,nt));let Ir=!1,ti=!1,er=!1;const tn=Qn.getUniforms(),an=ce.uniforms;if(Ct.useProgram(Qn.program)&&(Ir=!0,ti=!0,er=!0),ft.id!==P&&(P=ft.id,ti=!0),Ir||E!==F){Ct.buffers.depth.getReversed()?(dt.copy(F.projectionMatrix),_O(dt),xO(dt),tn.setValue(k,"projectionMatrix",dt)):tn.setValue(k,"projectionMatrix",F.projectionMatrix),tn.setValue(k,"viewMatrix",F.matrixWorldInverse);const ei=tn.map.cameraPosition;ei!==void 0&&ei.setValue(k,Ht.setFromMatrixPosition(F.matrixWorld)),Lt.logarithmicDepthBuffer&&tn.setValue(k,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(ft.isMeshPhongMaterial||ft.isMeshToonMaterial||ft.isMeshLambertMaterial||ft.isMeshBasicMaterial||ft.isMeshStandardMaterial||ft.isShaderMaterial)&&tn.setValue(k,"isOrthographic",F.isOrthographicCamera===!0),E!==F&&(E=F,ti=!0,er=!0)}if(nt.isSkinnedMesh){tn.setOptional(k,nt,"bindMatrix"),tn.setOptional(k,nt,"bindMatrixInverse");const Vn=nt.skeleton;Vn&&(Vn.boneTexture===null&&Vn.computeBoneTexture(),tn.setValue(k,"boneTexture",Vn.boneTexture,U))}nt.isBatchedMesh&&(tn.setOptional(k,nt,"batchingTexture"),tn.setValue(k,"batchingTexture",nt._matricesTexture,U),tn.setOptional(k,nt,"batchingIdTexture"),tn.setValue(k,"batchingIdTexture",nt._indirectTexture,U),tn.setOptional(k,nt,"batchingColorTexture"),nt._colorsTexture!==null&&tn.setValue(k,"batchingColorTexture",nt._colorsTexture,U));const Ti=ut.morphAttributes;if((Ti.position!==void 0||Ti.normal!==void 0||Ti.color!==void 0)&&ue.update(nt,ut,Qn),(ti||ce.receiveShadow!==nt.receiveShadow)&&(ce.receiveShadow=nt.receiveShadow,tn.setValue(k,"receiveShadow",nt.receiveShadow)),ft.isMeshGouraudMaterial&&ft.envMap!==null&&(an.envMap.value=se,an.flipEnvMap.value=se.isCubeTexture&&se.isRenderTargetTexture===!1?-1:1),ft.isMeshStandardMaterial&&ft.envMap===null&&tt.environment!==null&&(an.envMapIntensity.value=tt.environmentIntensity),ti&&(tn.setValue(k,"toneMappingExposure",w.toneMappingExposure),ce.needsLights&&Dg(an,er),Nt&&ft.fog===!0&&zt.refreshFogUniforms(an,Nt),zt.refreshMaterialUniforms(an,ft,H,ot,_.state.transmissionRenderTarget[F.id]),Cm.upload(k,ed(ce),an,U)),ft.isShaderMaterial&&ft.uniformsNeedUpdate===!0&&(Cm.upload(k,ed(ce),an,U),ft.uniformsNeedUpdate=!1),ft.isSpriteMaterial&&tn.setValue(k,"center",nt.center),tn.setValue(k,"modelViewMatrix",nt.modelViewMatrix),tn.setValue(k,"normalMatrix",nt.normalMatrix),tn.setValue(k,"modelMatrix",nt.matrixWorld),ft.isShaderMaterial||ft.isRawShaderMaterial){const Vn=ft.uniformsGroups;for(let ei=0,ga=Vn.length;ei0&&U.useMultisampledRTT(F)===!1?nt=Ft.get(F).__webglMultisampledFramebuffer:Array.isArray(_e)?nt=_e[ut]:nt=_e,D.copy(F.viewport),z.copy(F.scissor),G=F.scissorTest}else D.copy($).multiplyScalar(H).floor(),z.copy(lt).multiplyScalar(H).floor(),G=_t;if(Ct.bindFramebuffer(k.FRAMEBUFFER,nt)&&ft&&Ct.drawBuffers(F,nt),Ct.viewport(D),Ct.scissor(z),Ct.setScissorTest(G),Nt){const se=Ft.get(F.texture);k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,k.TEXTURE_CUBE_MAP_POSITIVE_X+tt,se.__webglTexture,ut)}else if(jt){const se=Ft.get(F.texture),xe=tt||0;k.framebufferTextureLayer(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,se.__webglTexture,ut||0,xe)}P=-1},this.readRenderTargetPixels=function(F,tt,ut,ft,nt,Nt,jt){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ee=Ft.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&jt!==void 0&&(ee=ee[jt]),ee){Ct.bindFramebuffer(k.FRAMEBUFFER,ee);try{const se=F.texture,xe=se.format,_e=se.type;if(!Lt.textureFormatReadable(xe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Lt.textureTypeReadable(_e)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}tt>=0&&tt<=F.width-ft&&ut>=0&&ut<=F.height-nt&&k.readPixels(tt,ut,ft,nt,bt.convert(xe),bt.convert(_e),Nt)}finally{const se=L!==null?Ft.get(L).__webglFramebuffer:null;Ct.bindFramebuffer(k.FRAMEBUFFER,se)}}},this.readRenderTargetPixelsAsync=async function(F,tt,ut,ft,nt,Nt,jt){if(!(F&&F.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ee=Ft.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&jt!==void 0&&(ee=ee[jt]),ee){const se=F.texture,xe=se.format,_e=se.type;if(!Lt.textureFormatReadable(xe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Lt.textureTypeReadable(_e))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(tt>=0&&tt<=F.width-ft&&ut>=0&&ut<=F.height-nt){Ct.bindFramebuffer(k.FRAMEBUFFER,ee);const oe=k.createBuffer();k.bindBuffer(k.PIXEL_PACK_BUFFER,oe),k.bufferData(k.PIXEL_PACK_BUFFER,Nt.byteLength,k.STREAM_READ),k.readPixels(tt,ut,ft,nt,bt.convert(xe),bt.convert(_e),0);const le=L!==null?Ft.get(L).__webglFramebuffer:null;Ct.bindFramebuffer(k.FRAMEBUFFER,le);const fe=k.fenceSync(k.SYNC_GPU_COMMANDS_COMPLETE,0);return k.flush(),await yO(k,fe,4),k.bindBuffer(k.PIXEL_PACK_BUFFER,oe),k.getBufferSubData(k.PIXEL_PACK_BUFFER,0,Nt),k.deleteBuffer(oe),k.deleteSync(fe),Nt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(F,tt=null,ut=0){F.isTexture!==!0&&(bc("WebGLRenderer: copyFramebufferToTexture function signature has changed."),tt=arguments[0]||null,F=arguments[1]);const ft=Math.pow(2,-ut),nt=Math.floor(F.image.width*ft),Nt=Math.floor(F.image.height*ft),jt=tt!==null?tt.x:0,ee=tt!==null?tt.y:0;U.setTexture2D(F,0),k.copyTexSubImage2D(k.TEXTURE_2D,ut,0,0,jt,ee,nt,Nt),Ct.unbindTexture()};const Ng=k.createFramebuffer(),Og=k.createFramebuffer();this.copyTextureToTexture=function(F,tt,ut=null,ft=null,nt=0,Nt=null){F.isTexture!==!0&&(bc("WebGLRenderer: copyTextureToTexture function signature has changed."),ft=arguments[0]||null,F=arguments[1],tt=arguments[2],Nt=arguments[3]||0,ut=null),Nt===null&&(nt!==0?(bc("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Nt=nt,nt=0):Nt=0);let jt,ee,se,xe,_e,oe,le,fe,Ke;const Ne=F.isCompressedTexture?F.mipmaps[Nt]:F.image;if(ut!==null)jt=ut.max.x-ut.min.x,ee=ut.max.y-ut.min.y,se=ut.isBox3?ut.max.z-ut.min.z:1,xe=ut.min.x,_e=ut.min.y,oe=ut.isBox3?ut.min.z:0;else{const Ti=Math.pow(2,-nt);jt=Math.floor(Ne.width*Ti),ee=Math.floor(Ne.height*Ti),F.isDataArrayTexture?se=Ne.depth:F.isData3DTexture?se=Math.floor(Ne.depth*Ti):se=1,xe=0,_e=0,oe=0}ft!==null?(le=ft.x,fe=ft.y,Ke=ft.z):(le=0,fe=0,Ke=0);const Me=bt.convert(tt.format),ce=bt.convert(tt.type);let rn;tt.isData3DTexture?(U.setTexture3D(tt,0),rn=k.TEXTURE_3D):tt.isDataArrayTexture||tt.isCompressedArrayTexture?(U.setTexture2DArray(tt,0),rn=k.TEXTURE_2D_ARRAY):(U.setTexture2D(tt,0),rn=k.TEXTURE_2D),k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,tt.flipY),k.pixelStorei(k.UNPACK_PREMULTIPLY_ALPHA_WEBGL,tt.premultiplyAlpha),k.pixelStorei(k.UNPACK_ALIGNMENT,tt.unpackAlignment);const be=k.getParameter(k.UNPACK_ROW_LENGTH),Qn=k.getParameter(k.UNPACK_IMAGE_HEIGHT),Ir=k.getParameter(k.UNPACK_SKIP_PIXELS),ti=k.getParameter(k.UNPACK_SKIP_ROWS),er=k.getParameter(k.UNPACK_SKIP_IMAGES);k.pixelStorei(k.UNPACK_ROW_LENGTH,Ne.width),k.pixelStorei(k.UNPACK_IMAGE_HEIGHT,Ne.height),k.pixelStorei(k.UNPACK_SKIP_PIXELS,xe),k.pixelStorei(k.UNPACK_SKIP_ROWS,_e),k.pixelStorei(k.UNPACK_SKIP_IMAGES,oe);const tn=F.isDataArrayTexture||F.isData3DTexture,an=tt.isDataArrayTexture||tt.isData3DTexture;if(F.isDepthTexture){const Ti=Ft.get(F),Vn=Ft.get(tt),ei=Ft.get(Ti.__renderTarget),ga=Ft.get(Vn.__renderTarget);Ct.bindFramebuffer(k.READ_FRAMEBUFFER,ei.__webglFramebuffer),Ct.bindFramebuffer(k.DRAW_FRAMEBUFFER,ga.__webglFramebuffer);for(let ls=0;ls{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))}},s=()=>t,r=(c,h=s,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 x=p;c(p=g,x)}}return e.add(m),()=>e.delete(m)},l={setState:i,getState:s,subscribe:(c,h,u)=>h||u?r(c,h,u):(e.add(c),()=>e.delete(c)),destroy:()=>e.clear()};return t=n(i,s,l),l}const T5=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),iE=T5?J.useEffect:J.useLayoutEffect;function C5(n){const t=typeof n=="function"?A5(n):n,e=(i=t.getState,s=Object.is)=>{const[,r]=J.useReducer(y=>y+1,0),a=t.getState(),o=J.useRef(a),l=J.useRef(i),c=J.useRef(s),h=J.useRef(!1),u=J.useRef();u.current===void 0&&(u.current=i(a));let p,m=!1;(o.current!==a||l.current!==i||c.current!==s||h.current)&&(p=i(a),m=!s(u.current,p)),iE(()=>{m&&(u.current=p),o.current=a,l.current=i,c.current=s,h.current=!1});const g=J.useRef(a);iE(()=>{const y=()=>{try{const b=t.getState(),S=l.current(b);c.current(u.current,S)||(o.current=b,u.current=S,r())}catch{h.current=!0,r()}},_=t.subscribe(y);return t.getState()!==g.current&&y(),_},[]);const x=m?p:u.current;return J.useDebugValue(x),x};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 s=i.length<=0;return{value:i.shift(),done:s}}}},e}var rR={exports:{}},aR={exports:{}},oR={};/** + */bl.ConcurrentRoot=1;bl.ContinuousEventPriority=4;bl.DefaultEventPriority=16;bl.DiscreteEventPriority=1;bl.IdleEventPriority=536870912;bl.LegacyRoot=0;sR.exports=bl;var Pc=sR.exports;function w5(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))}},s=()=>t,r=(c,h=s,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 x=p;c(p=g,x)}}return e.add(m),()=>e.delete(m)},l={setState:i,getState:s,subscribe:(c,h,u)=>h||u?r(c,h,u):(e.add(c),()=>e.delete(c)),destroy:()=>e.clear()};return t=n(i,s,l),l}const S5=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),iE=S5?J.useEffect:J.useLayoutEffect;function E5(n){const t=typeof n=="function"?w5(n):n,e=(i=t.getState,s=Object.is)=>{const[,r]=J.useReducer(y=>y+1,0),a=t.getState(),o=J.useRef(a),l=J.useRef(i),c=J.useRef(s),h=J.useRef(!1),u=J.useRef();u.current===void 0&&(u.current=i(a));let p,m=!1;(o.current!==a||l.current!==i||c.current!==s||h.current)&&(p=i(a),m=!s(u.current,p)),iE(()=>{m&&(u.current=p),o.current=a,l.current=i,c.current=s,h.current=!1});const g=J.useRef(a);iE(()=>{const y=()=>{try{const b=t.getState(),S=l.current(b);c.current(u.current,S)||(o.current=b,u.current=S,r())}catch{h.current=!0,r()}},_=t.subscribe(y);return t.getState()!==g.current&&y(),_},[]);const x=m?p:u.current;return J.useDebugValue(x),x};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 s=i.length<=0;return{value:i.shift(),done:s}}}},e}var rR={exports:{}},aR={exports:{}},oR={};/** * @license React * scheduler.production.min.js * @@ -3854,7 +3854,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var R5=function(t){var e={},i=J,s=av,r=Object.assign;function a(f){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+f,v=1;vK||A[B]!==I[K]){var vt=` @@ -3864,20 +3864,20 @@ Error generating stack: `+I.message+` `+(M.join(" > ")+` 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 Y(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:tI,findFiberByHostInstance:f.findFiberByHostInstance||eI,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{rd=d.inject(f),nr=d}catch{}f=!!d.checkDCE}}return f},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(f,d,v,M){if(!Ft)throw Error(a(363));f=Ey(f,d);var A=te(f,v,M).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=Ve;try{return Ve=f,d()}finally{Ve=v}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(f,d,v,M){var A=d.current,I=yi(),B=Ma(A);return v=ew(v),d.context===null?d.context=v:d.pendingContext=v,d=Dr(I,B),d.payload={element:f},M=M===void 0?null:M,M!==null&&(d.callback=M),_a(A,d),f=ps(A,B,I),f!==null&&hd(f,A,B),B},e};rR.exports=R5;var P5=rR.exports;const I5=xf(P5),V1={},L5=n=>void Object.assign(V1,n);function D5(n,t){function e(h,{args:u=[],attach:p,...m},g){let x=`${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 _=m.object;y=Sc(_,{type:h,root:g,attach:p,primitive:!0})}else{const _=V1[x];if(!_)throw new Error(`R3F: ${x} 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=Sc(new _(...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")),x!=="inject"&&z_(y,m),y}function i(h,u){let p=!1;if(u){var m,g;(m=u.__r3f)!=null&&m.attach?k_(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||Sc(u,{}),u.__r3f.parent=h,lv(u),Ec(u)}}function s(h,u,p){let m=!1;if(u){var g,x;if((g=u.__r3f)!=null&&g.attach)k_(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(b=>b!==u),_=y.indexOf(p);h.children=[...y.slice(0,_),u,...y.slice(_)],m=!0}m||(x=h.__r3f)==null||x.objects.push(u),u.__r3f||Sc(u,{}),u.__r3f.parent=h,lv(u),Ec(u)}}function r(h,u,p=!1){h&&[...h].forEach(m=>a(u,m,p))}function a(h,u,p){if(u){var m,g,x;if(u.__r3f&&(u.__r3f.parent=null),(m=h.__r3f)!=null&&m.objects&&(h.__r3f.objects=h.__r3f.objects.filter(w=>w!==u)),(g=u.__r3f)!=null&&g.attach)lE(h,u,u.__r3f.attach);else if(u.isObject3D&&h.isObject3D){var y;h.remove(u),(y=u.__r3f)!=null&&y.root&&H5(Rm(u),u)}const b=(x=u.__r3f)==null?void 0:x.primitive,S=!b&&(p===void 0?u.dispose!==null:p);if(!b){var _;r((_=u.__r3f)==null?void 0:_.objects,u,S),r(u.children,u,S)}if(delete u.__r3f,S&&u.dispose&&u.type!=="Scene"){const w=()=>{try{u.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?av.unstable_scheduleCallback(av.unstable_IdlePriority,w):w()}Ec(h)}}function o(h,u,p,m){var g;const x=(g=h.__r3f)==null?void 0:g.parent;if(!x)return;const y=e(u,p,h.__r3f.root);if(h.children){for(const _ of h.children)_.__r3f&&i(y,_);h.children=h.children.filter(_=>!_.__r3f)}h.__r3f.objects.forEach(_=>i(y,_)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||a(x,h),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),i(x,y),y.raycast&&y.__r3f.eventCount&&Rm(y).getState().internal.interaction.push(y),[m,m.alternate].forEach(_=>{_!==null&&(_.stateNode=y,_.ref&&(typeof _.ref=="function"?_.ref(y):_.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:I5({createInstance:e,removeChild:a,appendChild:i,appendInitialChild:i,insertBefore:s,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&&s(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:_,...b}=m,{args:S=[],children:w,...R}=p;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((C,L)=>C!==S[L]))return[!0];const T=pR(h,b,R,!0);return T.changes.length?[!1,T]:null}},commitUpdate(h,[u,p],m,g,x,y){u?o(h,m,x,y):z_(h,p)},commitMount(h,u,p,m){var g;const x=(g=h.__r3f)!=null?g:{};h.raycast&&x.handlers&&x.eventCount&&Rm(h).getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>Sc(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var u;const{attach:p,parent:m}=(u=h.__r3f)!=null?u:{};p&&m&&lE(m,h,p),h.isObject3D&&(h.visible=!1),Ec(h)},unhideInstance(h,u){var p;const{attach:m,parent:g}=(p=h.__r3f)!=null?p:{};m&&g&&k_(g,h,m),(h.isObject3D&&u.visible==null||u.visible)&&(h.visible=!0),Ec(h)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>t?t():Pc.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&sn.fun(performance.now)?performance.now:sn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:sn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:sn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:z_}}var sE,rE;const U_=n=>"colorSpace"in n||"outputColorSpace"in n,lR=()=>{var n;return(n=V1.ColorManagement)!=null?n:null},cR=n=>n&&n.isOrthographicCamera,N5=n=>n&&n.hasOwnProperty("current"),Ff=typeof window<"u"&&((sE=window.document)!=null&&sE.createElement||((rE=window.navigator)==null?void 0:rE.product)==="ReactNative")?J.useLayoutEffect:J.useEffect;function hR(n){const t=J.useRef(n);return Ff(()=>void(t.current=n),[n]),t}function O5({set:n}){return Ff(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class uR extends J.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}}uR.getDerivedStateFromError=()=>({error:!0});const fR="__default",aE=new Map,F5=n=>n&&!!n.memoized&&!!n.changes;function dR(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 eu=n=>{var t;return(t=n.__r3f)==null?void 0:t.root.getState()};function Rm(n){let t=n.__r3f.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}const sn={obj:n=>n===Object(n)&&!sn.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:s=!0}={}){if(typeof n!=typeof t||!!n!=!!t)return!1;if(sn.str(n)||sn.num(n)||sn.boo(n))return n===t;const r=sn.obj(n);if(r&&i==="reference")return n===t;const a=sn.arr(n);if(a&&e==="reference")return n===t;if((a||r)&&n===t)return!0;let o;for(o in n)if(!(o in t))return!1;if(r&&e==="shallow"&&i==="shallow"){for(o in s?t:n)if(!sn.equ(n[o],t[o],{strict:s,objects:"reference"}))return!1}else for(o in s?t:n)if(n[o]!==t[o])return!1;if(sn.und(o)){if(a&&n.length===0&&t.length===0||r&&Object.keys(n).length===0&&Object.keys(t).length===0)return!0;if(n!==t)return!1}return!0}};function U5(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const t in n)t.dispose==null||t.dispose(),delete n[t]}function Sc(n,t){const e=n;return e.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...t},n}function ov(n,t){let e=n;if(t.includes("-")){const i=t.split("-"),s=i.pop();return e=i.reduce((r,a)=>r[a],n),{target:e,key:s}}else return{target:e,key:t}}const oE=/-\d+$/;function k_(n,t,e){if(sn.str(e)){if(oE.test(e)){const r=e.replace(oE,""),{target:a,key:o}=ov(n,r);Array.isArray(a[o])||(a[o]=[])}const{target:i,key:s}=ov(n,e);t.__r3f.previousAttach=i[s],i[s]=t}else t.__r3f.previousAttach=e(n,t)}function lE(n,t,e){var i,s;if(sn.str(e)){const{target:r,key:a}=ov(n,e),o=t.__r3f.previousAttach;o===void 0?delete r[a]:r[a]=o}else(i=t.__r3f)==null||i.previousAttach==null||i.previousAttach(n,t);(s=t.__r3f)==null||delete s.previousAttach}function pR(n,{children:t,key:e,ref:i,...s},{children:r,key:a,ref:o,...l}={},c=!1){const h=n.__r3f,u=Object.entries(s),p=[];if(c){const g=Object.keys(l);for(let x=0;x{var y;if((y=n.__r3f)!=null&&y.primitive&&g==="object"||sn.equ(x,l[g]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(g))return p.push([g,x,!0,[]]);let _=[];g.includes("-")&&(_=g.split("-")),p.push([g,x,!1,_]);for(const b in s){const S=s[b];b.startsWith(`${g}-`)&&p.push([b,S,!1,b.split("-")])}});const m={...s};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 k5=typeof process<"u"&&!1;function z_(n,t){var e;const i=n.__r3f,s=i==null?void 0:i.root,r=s==null||s.getState==null?void 0:s.getState(),{memoized:a,changes:o}=F5(t)?t:pR(n,t),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=a);for(let h=0;h_[b],n),!(y&&y.set))){const[_,...b]=g.reverse();x=b.reverse().reduce((S,w)=>S[w],n),u=_}if(p===fR+"remove")if(x.constructor){let _=aE.get(x.constructor);_||(_=new x.constructor,aE.set(x.constructor,_)),p=_[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 nl)){if(Array.isArray(p))y.fromArray?y.fromArray(p):y.set(...p);else if(y.copy&&p&&p.constructor&&(k5?y.constructor.name===p.constructor.name:y.constructor===p.constructor))y.copy(p);else if(p!==void 0){const _=y instanceof kt;!_&&y.setScalar?y.setScalar(p):y instanceof nl&&p instanceof nl?y.mask=p.mask:y.set(p),!lR()&&r&&!r.linear&&_&&y.convertSRGBToLinear()}}else if(x[u]=p,x[u]instanceof bn&&x[u].format===di&&x[u].type===Xs&&r){const _=x[u];U_(_)&&U_(r.gl)?_.colorSpace=r.gl.outputColorSpace:_.encoding=r.gl.outputEncoding}Ec(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const h=Rm(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&&lv(n),n}function Ec(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 lv(n){n.onUpdate==null||n.onUpdate(n)}function z5(n,t){n.manual||(cR(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 Gp(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function B5(){var n;const t=typeof self<"u"&&self||typeof window<"u"&&window;if(!t)return Pc.DefaultEventPriority;switch((n=t.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Pc.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Pc.ContinuousEventPriority;default:return Pc.DefaultEventPriority}}function mR(n,t,e,i){const s=e.get(t);s&&(e.delete(t),e.size===0&&(n.delete(i),s.target.releasePointerCapture(i)))}function H5(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,s)=>{(i.eventObject===t||i.object===t)&&e.hovered.delete(s)}),e.capturedMap.forEach((i,s)=>{mR(e.capturedMap,t,i,s)})}function G5(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 _=0;_{const S=eu(_.object),w=eu(b.object);return!S||!w?_.distance-b.distance:w.events.priority-S.events.priority||_.distance-b.distance}).filter(_=>{const b=Gp(_);return u.has(b)?!1:(u.add(b),!0)});h.events.filter&&(x=h.events.filter(x,h));for(const _ of x){let b=_.object;for(;b;){var y;(y=b.__r3f)!=null&&y.eventCount&&p.push({..._,eventObject:b}),b=b.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let _ of h.internal.capturedMap.get(l.pointerId).values())u.has(Gp(_.intersection))||p.push(_.intersection);return p}function s(l,c,h,u){const p=n.getState();if(l.length){const m={stopped:!1};for(const g of l){const x=eu(g.object)||p,{raycaster:y,pointer:_,camera:b,internal:S}=x,w=new O(_.x,_.y,0).unproject(b),R=E=>{var D,z;return(D=(z=S.capturedMap.get(E))==null?void 0:z.has(g.eventObject))!=null?D:!1},T=E=>{const D={intersection:g,target:c.target};S.capturedMap.has(E)?S.capturedMap.get(E).set(g.eventObject,D):S.capturedMap.set(E,new Map([[g.eventObject,D]])),c.target.setPointerCapture(E)},C=E=>{const D=S.capturedMap.get(E);D&&mR(S.capturedMap,g.eventObject,D,E)};let L={};for(let E in c){let D=c[E];typeof D!="function"&&(L[E]=D)}let P={...g,...L,pointer:_,intersections:l,stopped:m.stopped,delta:h,unprojectedPoint:w,ray:y.ray,camera:b,stopPropagation(){const E="pointerId"in c&&S.capturedMap.get(c.pointerId);if((!E||E.has(g.eventObject))&&(P.stopped=m.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(D=>D.eventObject===g.eventObject))){const D=l.slice(0,l.indexOf(g));r([...D,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 r(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(Gp(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;hr([]);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),r([]))})}}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),_=g?t(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=y.map(S=>S.eventObject)),g&&!y.length&&_<=2&&(a(h,p.interaction),u&&u(h)),m&&r(y);function b(S){const w=S.eventObject,R=w.__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=Gp(S),L=p.hovered.get(C);L?L.stopped&&S.stopPropagation():(p.hovered.set(C,S),T.onPointerOver==null||T.onPointerOver(S),T.onPointerEnter==null||T.onPointerEnter(S))}T.onPointerMove==null||T.onPointerMove(S)}else{const C=T[l];C?(!g||p.initialHits.includes(w))&&(a(h,p.interaction.filter(L=>!p.initialHits.includes(L))),C(S)):g&&p.initialHits.includes(w)&&a(h,p.interaction.filter(L=>!p.initialHits.includes(L)))}}s(y,h,_,b)}}return{handlePointer:o}}const gR=n=>!!(n!=null&&n.render),yR=J.createContext(null),V5=(n,t)=>{const e=C5((o,l)=>{const c=new O,h=new O,u=new O;function p(_=l().camera,b=h,S=l().size){const{width:w,height:R,top:T,left:C}=S,L=w/R;b instanceof O?u.copy(b):u.set(...b);const P=_.getWorldPosition(c).distanceTo(u);if(cR(_))return{width:w/_.zoom,height:R/_.zoom,top:T,left:C,factor:1,distance:P,aspect:L};{const E=_.fov*Math.PI/180,D=2*Math.tan(E/2)*P,z=D*(w/R);return{width:z,height:D,top:T,left:C,factor:w/z,distance:P,aspect:L}}}let m;const g=_=>o(b=>({performance:{...b.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:(_=1)=>n(l(),_),advance:(_,b)=>t(_,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new U1,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const _=l();m&&clearTimeout(m),_.performance.current!==_.performance.min&&g(_.performance.min),m=setTimeout(()=>g(l().performance.max),_.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:_=>o(b=>({...b,events:{...b.events,..._}})),setSize:(_,b,S,w,R)=>{const T=l().camera,C={width:_,height:b,top:w||0,left:R||0,updateStyle:S};o(L=>({size:C,viewport:{...L.viewport,...p(T,h,C)}}))},setDpr:_=>o(b=>{const S=dR(_);return{viewport:{...b.viewport,dpr:S,initialDpr:b.viewport.initialDpr||S}}}),setFrameloop:(_="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,_!=="never"&&(b.start(),b.elapsedTime=0),o(()=>({frameloop:_}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:J.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(_,b,S)=>{const w=l().internal;return w.priority=w.priority+(b>0?1:0),w.subscribers.push({ref:_,priority:b,store:S}),w.subscribers=w.subscribers.sort((R,T)=>R.priority-T.priority),()=>{const R=l().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(b>0?1:0),R.subscribers=R.subscribers.filter(T=>T.ref!==_))}}}}}),i=e.getState();let s=i.size,r=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!==s.width||l.height!==s.height||c.dpr!==r){var p;s=l,r=c.dpr,z5(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 Vp,W5=new Set,j5=new Set,X5=new Set;function B_(n,t){if(n.size)for(const{callback:e}of n.values())e(t)}function nu(n,t){switch(n){case"before":return B_(W5,t);case"after":return B_(j5,t);case"tail":return B_(X5,t)}}let H_,G_;function V_(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),H_=t.internal.subscribers,Vp=0;Vp0)&&!((h=r.gl.xr)!=null&&h.isPresenting)&&(i+=V_(c,r))}if(e=!1,nu("after",c),i===0)return nu("tail",c),t=!1,cancelAnimationFrame(s)}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&&nu("before",c),u)V_(c,u,p);else for(const m of n.values())V_(c,m.store.getState());h&&nu("after",c)}return{loop:a,invalidate:o,advance:l}}function _R(){const n=J.useContext(yR);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function mr(n=e=>e,t){return _R()(n,t)}function Sg(n,t=0){const e=_R(),i=e.getState().internal.subscribe,s=hR(n);return Ff(()=>i(s,t,e),[t,i,e]),null}const eh=new Map,{invalidate:cE,advance:hE}=q5(eh),{reconciler:A0,applyProps:sc}=D5(eh,B5),rc={objects:"shallow",strict:!1},Y5=(n,t)=>{const e=typeof n=="function"?n(t):n;return gR(e)?e:new iR({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...n})};function $5(n,t){const e=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(t){const{width:i,height:s,top:r,left:a,updateStyle:o=e}=t;return{width:i,height:s,top:r,left:a,updateStyle:o}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:s,top:r,left:a}=n.parentElement.getBoundingClientRect();return{width:i,height:s,top:r,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 Z5(n){const t=eh.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 s=typeof reportError=="function"?reportError:console.error,r=i||V5(cE,hE),a=e||A0.createContainer(r,Pc.ConcurrentRoot,null,!1,null,"",s,null);t||eh.set(n,{fiber:a,store:r});let o,l=!1,c;return{configure(h={}){let{gl:u,size:p,scene:m,events:g,onCreated:x,shadows:y=!1,linear:_=!1,flat:b=!1,legacy:S=!1,orthographic:w=!1,frameloop:R="always",dpr:T=[1,2],performance:C,raycaster:L,camera:P,onPointerMissed:E}=h,D=r.getState(),z=D.gl;D.gl||D.set({gl:z=Y5(u,n)});let G=D.raycaster;G||D.set({raycaster:G=new bg});const{params:W,...Q}=L||{};if(sn.equ(Q,G,rc)||sc(G,{...Q}),sn.equ(W,G.params,rc)||sc(G,{params:{...G.params,...W}}),!D.camera||D.camera===c&&!sn.equ(c,P,rc)){c=P;const it=P instanceof Tf,$=it?P:w?new aa(0,0,0,0,.1,1e3):new gn(75,0,.1,1e3);it||($.position.z=5,P&&(sc($,P),("aspect"in P||"left"in P||"right"in P||"bottom"in P||"top"in P)&&($.manual=!0,$.updateProjectionMatrix())),!D.camera&&!(P!=null&&P.rotation)&&$.lookAt(0,0,0)),D.set({camera:$}),G.camera=$}if(!D.scene){let it;m instanceof b0?it=m:(it=new b0,m&&sc(it,m)),D.set({scene:Sc(it)})}if(!D.xr){var Y;const it=(_t,q)=>{const rt=r.getState();rt.frameloop!=="never"&&hE(_t,!0,rt,q)},$=()=>{const _t=r.getState();_t.gl.xr.enabled=_t.gl.xr.isPresenting,_t.gl.xr.setAnimationLoop(_t.gl.xr.isPresenting?it:null),_t.gl.xr.isPresenting||cE(_t)},lt={connect(){const _t=r.getState().gl;_t.xr.addEventListener("sessionstart",$),_t.xr.addEventListener("sessionend",$)},disconnect(){const _t=r.getState().gl;_t.xr.removeEventListener("sessionstart",$),_t.xr.removeEventListener("sessionend",$)}};typeof((Y=z.xr)==null?void 0:Y.addEventListener)=="function"&<.connect(),D.set({xr:lt})}if(z.shadowMap){const it=z.shadowMap.enabled,$=z.shadowMap.type;if(z.shadowMap.enabled=!!y,sn.boo(y))z.shadowMap.type=wu;else if(sn.str(y)){var ot;const lt={basic:o2,percentage:j0,soft:wu,variance:Bs};z.shadowMap.type=(ot=lt[y])!=null?ot:wu}else sn.obj(y)&&Object.assign(z.shadowMap,y);(it!==z.shadowMap.enabled||$!==z.shadowMap.type)&&(z.shadowMap.needsUpdate=!0)}const H=lR();H&&("enabled"in H?H.enabled=!S:"legacyMode"in H&&(H.legacyMode=S)),l||sc(z,{outputEncoding:_?3e3:3001,toneMapping:b?wr:Zv}),D.legacy!==S&&D.set(()=>({legacy:S})),D.linear!==_&&D.set(()=>({linear:_})),D.flat!==b&&D.set(()=>({flat:b})),u&&!sn.fun(u)&&!gR(u)&&!sn.equ(u,z,rc)&&sc(z,u),g&&!D.events.handlers&&D.set({events:g(r)});const Z=$5(n,p);return sn.equ(Z,D.size,rc)||D.setSize(Z.width,Z.height,Z.updateStyle,Z.top,Z.left),T&&D.viewport.dpr!==dR(T)&&D.setDpr(T),D.frameloop!==R&&D.setFrameloop(R),D.onPointerMissed||D.set({onPointerMissed:E}),C&&!sn.equ(C,D.performance,rc)&&D.set(it=>({performance:{...it.performance,...C}})),o=x,l=!0,this},render(h){return l||this.configure(),A0.updateContainer(V.jsx(K5,{store:r,children:h,onCreated:o,rootElement:n}),a,null,()=>{}),r},unmount(){xR(n)}}}function K5({store:n,children:t,onCreated:e,rootElement:i}){return Ff(()=>{const s=n.getState();s.set(r=>({internal:{...r.internal,active:!0}})),e&&e(s),n.getState().events.connected||s.events.connect==null||s.events.connect(i)},[]),V.jsx(yR.Provider,{value:n,children:t})}function xR(n,t){const e=eh.get(n),i=e==null?void 0:e.fiber;if(i){const s=e==null?void 0:e.store.getState();s&&(s.internal.active=!1),A0.updateContainer(null,i,null,()=>{s&&setTimeout(()=>{try{var r,a,o,l;s.events.disconnect==null||s.events.disconnect(),(r=s.gl)==null||(a=r.renderLists)==null||a.dispose==null||a.dispose(),(o=s.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=s.gl)!=null&&l.xr&&s.xr.disconnect(),U5(s),eh.delete(n)}catch{}},500)})}}A0.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:J.version});const W_={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 J5(n){const{handlePointer:t}=G5(n);return{priority:1,enabled:!0,compute(e,i,s){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(W_).reduce((e,i)=>({...e,[i]:t(i)}),{}),update:()=>{var e;const{events:i,internal:s}=n.getState();(e=s.lastEvent)!=null&&e.current&&i.handlers&&i.handlers.onPointerMove(s.lastEvent.current)},connect:e=>{var i;const{set:s,events:r}=n.getState();r.disconnect==null||r.disconnect(),s(a=>({events:{...a.events,connected:e}})),Object.entries((i=r.handlers)!=null?i:[]).forEach(([a,o])=>{const[l,c]=W_[a];e.addEventListener(l,o,{passive:c})})},disconnect:()=>{const{set:e,events:i}=n.getState();if(i.connected){var s;Object.entries((s=i.handlers)!=null?s:[]).forEach(([r,a])=>{if(i&&i.connected instanceof HTMLElement){const[o]=W_[r];i.connected.removeEventListener(o,a)}}),e(r=>({events:{...r.events,connected:void 0}}))}}}}function cv(n,t,e){var i,s,r,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(r,s),r=s=null))}var c=function(){r=this,s=arguments,a=Date.now();var h=e&&!i;return i||(i=setTimeout(l,t)),h&&(o=n.apply(r,s),r=s=null),o};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(o=n.apply(r,s),r=s=null,clearTimeout(i),i=null)},c}cv.debounce=cv;var Q5=cv;const uE=xf(Q5);var t6=Object.defineProperty,e6=Object.defineProperties,n6=Object.getOwnPropertyDescriptors,fE=Object.getOwnPropertySymbols,i6=Object.prototype.hasOwnProperty,s6=Object.prototype.propertyIsEnumerable,dE=(n,t,e)=>t in n?t6(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,pE=(n,t)=>{for(var e in t||(t={}))i6.call(t,e)&&dE(n,e,t[e]);if(fE)for(var e of fE(t))s6.call(t,e)&&dE(n,e,t[e]);return n},r6=(n,t)=>e6(n,n6(t)),mE,gE;typeof window<"u"&&((mE=window.document)!=null&&mE.createElement||((gE=window.navigator)==null?void 0:gE.product)==="ReactNative")?J.useLayoutEffect:J.useEffect;function vR(n,t,e){if(!n)return;if(e(n)===!0)return n;let i=n.child;for(;i;){const s=vR(i,t,e);if(s)return s;i=i.sibling}}function MR(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const yE=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=yE;return}return yE.apply(this,arguments)};const W1=MR(J.createContext(null));class bR extends J.Component{render(){return J.createElement(W1.Provider,{value:this._reactInternals},this.props.children)}}function a6(){const n=J.useContext(W1);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const t=J.useId();return J.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const s=vR(i,!1,r=>{let a=r.memoizedState;for(;a;){if(a.memoizedState===t)return!0;a=a.next}});if(s)return s}},[n,t])}function o6(){const n=a6(),[t]=J.useState(()=>new Map);t.clear();let e=n;for(;e;){if(e.type&&typeof e.type=="object"){const s=e.type._context===void 0&&e.type.Provider===e.type?e.type:e.type._context;s&&s!==W1&&!t.has(s)&&t.set(s,J.useContext(MR(s)))}e=e.return}return t}function l6(){const n=o6();return J.useMemo(()=>Array.from(n.keys()).reduce((t,e)=>i=>J.createElement(t,null,J.createElement(e.Provider,r6(pE({},i),{value:n.get(e)}))),t=>J.createElement(bR,pE({},t))),[n])}function c6({debounce:n,scroll:t,polyfill:e,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const s=e||typeof window<"u"&&window.ResizeObserver,[r,a]=J.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!s)return r.width=1280,r.height=800,[()=>{},r,()=>{}];const o=J.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:r}),l=n?typeof n=="number"?n:n.scroll:null,c=n?typeof n=="number"?n:n.resize:null,h=J.useRef(!1);J.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[u,p,m]=J.useMemo(()=>{const _=()=>{if(!o.current.element)return;const{left:b,top:S,width:w,height:R,bottom:T,right:C,x:L,y:P}=o.current.element.getBoundingClientRect(),E={left:b,top:S,width:w,height:R,bottom:T,right:C,x:L,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&&!d6(o.current.lastBounds,E)&&a(o.current.lastBounds=E)};return[_,c?uE(_,c):_,l?uE(_,l):_]},[a,i,l,c]);function g(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(_=>_.removeEventListener("scroll",m,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null)}function x(){o.current.element&&(o.current.resizeObserver=new s(m),o.current.resizeObserver.observe(o.current.element),t&&o.current.scrollContainers&&o.current.scrollContainers.forEach(_=>_.addEventListener("scroll",m,{capture:!0,passive:!0})))}const y=_=>{!_||_===o.current.element||(g(),o.current.element=_,o.current.scrollContainers=wR(_),x())};return u6(m,!!t),h6(p),J.useEffect(()=>{g(),x()},[t,m,p]),J.useEffect(()=>g,[]),[y,r,u]}function h6(n){J.useEffect(()=>{const t=n;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[n])}function u6(n,t){J.useEffect(()=>{if(t){const e=n;return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",e,!0)}},[n,t])}function wR(n){const t=[];if(!n||n===document.body)return t;const{overflow:e,overflowX:i,overflowY:s}=window.getComputedStyle(n);return[e,i,s].some(r=>r==="auto"||r==="scroll")&&t.push(n),[...t,...wR(n.parentElement)]}const f6=["x","y","top","bottom","left","right","width","height"],d6=(n,t)=>f6.every(e=>n[e]===t[e]),p6=J.forwardRef(function({children:t,fallback:e,resize:i,style:s,gl:r,events:a=J5,eventSource:o,eventPrefix:l,shadows:c,linear:h,flat:u,legacy:p,orthographic:m,frameloop:g,dpr:x,performance:y,raycaster:_,camera:b,scene:S,onPointerMissed:w,onCreated:R,...T},C){J.useMemo(()=>L5(v5),[]);const L=l6(),[P,E]=c6({scroll:!0,debounce:{scroll:50,resize:0},...i}),D=J.useRef(null),z=J.useRef(null);J.useImperativeHandle(C,()=>D.current);const G=hR(w),[W,Q]=J.useState(!1),[Y,ot]=J.useState(!1);if(W)throw W;if(Y)throw Y;const H=J.useRef(null);Ff(()=>{const it=D.current;E.width>0&&E.height>0&&it&&(H.current||(H.current=Z5(it)),H.current.configure({gl:r,events:a,shadows:c,linear:h,flat:u,legacy:p,orthographic:m,frameloop:g,dpr:x,performance:y,raycaster:_,camera:b,scene:S,size:E,onPointerMissed:(...$)=>G.current==null?void 0:G.current(...$),onCreated:$=>{$.events.connect==null||$.events.connect(o?N5(o)?o.current:o:z.current),l&&$.setEvents({compute:(lt,_t)=>{const q=lt[l+"X"],rt=lt[l+"Y"];_t.pointer.set(q/_t.size.width*2-1,-(rt/_t.size.height)*2+1),_t.raycaster.setFromCamera(_t.pointer,_t.camera)}}),R==null||R($)}}),H.current.render(V.jsx(L,{children:V.jsx(uR,{set:ot,children:V.jsx(J.Suspense,{fallback:V.jsx(O5,{set:Q}),children:t})})})))}),J.useEffect(()=>{const it=D.current;if(it)return()=>xR(it)},[]);const Z=o?"none":"auto";return V.jsx("div",{ref:z,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Z,...s},...T,children:V.jsx("div",{ref:P,style:{width:"100%",height:"100%"},children:V.jsx("canvas",{ref:D,style:{display:"block"},children:e})})})}),m6=J.forwardRef(function(t,e){return V.jsx(bR,{children:V.jsx(p6,{...t,ref:e})})});function SR(n,t=!1){const e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),r={},a={},o=n[0].morphTargetsRelative,l=new ve;let c=0;for(let h=0;h{const e=J.useRef();return J.useEffect(()=>{const i=document.createElement("canvas"),s=i.getContext("2d"),r=7;i.width=128*r,i.height=128,s.font="55px Arial",s.fillStyle="rgba(0, 0, 0, 0.3)",s.fillRect(0,0,i.width,i.height);const a=n.split(` -`);s.font="55px Arial",s.fillStyle="white",a.forEach((c,h)=>{s.fillText(c,10,60+h*60)});const o=new dC(i),l=new sg({map:o,depthTest:!1});e.current.material=l,e.current.position.copy(t),e.current.scale.set(r,1,1),e.current.renderOrder=999},[n,t]),V.jsx("sprite",{ref:e})},y6=({pvSystems:n})=>V.jsx(V.Fragment,{children:n.map(t=>V.jsx(x6,{geometry:t}))});function _6({setPVSystems:n,setSelectedPVSystem:t,pvPoints:e,setPVPoints:i,simulationMeshes:s}){const r=e.map(C=>C.point);if(e.length<3)return;const a=new ve,o=ER(e),l=[],c=[],h=.1;for(const{a:C,b:L,c:P}of o){const E=W=>({x:W.point.x+W.normal.x*h,y:W.point.y+W.normal.y*h,z:W.point.z+W.normal.z*h}),D=E(C),z=E(L),G=E(P);l.push({a:C.point,b:L.point,c:P.point}),c.push(D.x,D.y,D.z,z.x,z.y,z.z,G.x,G.y,G.z)}a.setAttribute("position",new re(c,3)),a.name="pvSystem";let u=[];const p=.8;l.forEach(C=>{u=u.concat(pu(C,p))});const m=[];s.forEach(C=>{const L=C.geometry.clone();L.applyMatrix4(C.matrixWorld),m.push(L)});const g=SR(m,!0),x=10,y=w6(g,r,x),_=[],b=[],S=[];u.forEach(C=>{_.push(C.a.x,C.a.y,C.a.z),_.push(C.b.x,C.b.y,C.b.z),_.push(C.c.x,C.c.y,C.c.z)});for(let C=0;C<_.length;C+=3){const L=new O(_[C],_[C+1],_[C+2]),P=b6(L,y,x);if(P){const E=S6(L,P),D=E6(E,P),z=A6(E,P);b.push(D.r,D.g,D.b),S.push(z)}else b.push(1,1,1),S.push(-1)}const w=M6(l),R=T6(_,S),T=w*R;a.annualYield=T,a.area=w,n(C=>[...C,a]),i([]),t([a])}const x6=({geometry:n})=>{const t=J.useRef(),e=v6(n.attributes.position.array);return Sg(({camera:i})=>{t.current&&t.current.quaternion.copy(i.quaternion)}),V.jsxs(V.Fragment,{children:[V.jsx("mesh",{geometry:n,material:new dh({color:"#2b2c40",transparent:!0,opacity:.5,metalness:1,side:fi})}),V.jsx(g6,{text:`Jahresertrag: ${Math.round(n.annualYield).toLocaleString("de")} kWh pro Jahr -Fläche: ${n.area.toPrecision(3)}m²`,position:e})]})},v6=n=>{const t=n.length/3,e=n.reduce((i,s,r)=>(i[r%3]+=s,i),[0,0,0]);return new O(e[0]/t,e[1]/t,e[2]/t)};function pu(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),j1(n){t+=j1(e)}),t}function j1(n){const{a:t,b:e,c:i}=n,s=new O().subVectors(e,t),r=new O().subVectors(i,t);return .5*new O().crossVectors(s,r).length()}function b6(n,t,e){let i=null,s=1/0;return t.forEach(r=>{const[a,o,l]=r.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 (${s})`),i}function w6(n,t,e){const i=[];if(!n.isBufferGeometry)return;const s=n.attributes.position.array,r=n.attributes.color?n.attributes.color.array:null,a=n.attributes.intensities?n.attributes.intensities.array:null;for(let o=0;o{const S=Math.min(b.distanceTo(l),b.distanceTo(c),b.distanceTo(h));S<_&&(_=S)}),_n[(u+n.length)%n.length],e=Ms(t(1).point,t(0).point),i=Ms(t(2).point,t(0).point),s=new O().crossVectors(e,i);let r=0,a=0;const o=(u,p,m)=>{const g=R6(Ms(p.point,u.point),Ms(p.point,m.point),s);return g>0?a+=1:r+=1,{left:u,vertex:p,right:m,det:g}},l=n.map((u,p)=>o(t(p-1),u,t(p+1)));if(au.det<0).map(u=>u.vertex);let h=!1;for(let u of l){const p=c.filter(m=>m!=u.left&&m!=u.vertex&&m!=u.right).filter(m=>P6(m.point,u.left.point,u.vertex.point,u.right.point));u.isEar=u.det>0&&p.length==0,u.isEar&&(h=!0)}h||(console.warn("No ear found in ear clipping!"),l[0].isEar=!0);for(let u of l.filter(p=>p.isEar)){const p=l.filter(m=>m!=u).map(m=>m.vertex);return[{a:u.left,b:u.vertex,c:u.right}].concat(ER(p))}}function R6(n,t,e){const i=new Te;return i.set(n.x,t.x,e.x,n.y,t.y,e.y,n.z,t.z,e.z),i.determinant()}function Ms(n,t){return new O().subVectors(n,t)}function Wp(n,t){return new O().crossVectors(n,t)}function P6(n,t,e,i){const s=Wp(Ms(t,e),Ms(e,i)),r=Wp(s,Ms(t,e)),a=Wp(s,Ms(e,i)),o=Wp(s,Ms(i,t)),l=Math.sign(r.dot(Ms(t,n))),c=Math.sign(a.dot(Ms(e,n))),h=Math.sign(o.dot(Ms(i,n)));return l==c&&c==h}/** + `)+f.join(" > ")}return null},e.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return Y(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:tI,findFiberByHostInstance:f.findFiberByHostInstance||eI,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{rd=d.inject(f),nr=d}catch{}f=!!d.checkDCE}}return f},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(f,d,v,M){if(!Ft)throw Error(a(363));f=Ey(f,d);var A=te(f,v,M).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=Ve;try{return Ve=f,d()}finally{Ve=v}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(f,d,v,M){var A=d.current,I=yi(),B=Ma(A);return v=ew(v),d.context===null?d.context=v:d.pendingContext=v,d=Dr(I,B),d.payload={element:f},M=M===void 0?null:M,M!==null&&(d.callback=M),_a(A,d),f=ps(A,B,I),f!==null&&hd(f,A,B),B},e};rR.exports=A5;var T5=rR.exports;const C5=xf(T5),V1={},R5=n=>void Object.assign(V1,n);function P5(n,t){function e(h,{args:u=[],attach:p,...m},g){let x=`${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 _=m.object;y=Sc(_,{type:h,root:g,attach:p,primitive:!0})}else{const _=V1[x];if(!_)throw new Error(`R3F: ${x} 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=Sc(new _(...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")),x!=="inject"&&z_(y,m),y}function i(h,u){let p=!1;if(u){var m,g;(m=u.__r3f)!=null&&m.attach?k_(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||Sc(u,{}),u.__r3f.parent=h,lv(u),Ec(u)}}function s(h,u,p){let m=!1;if(u){var g,x;if((g=u.__r3f)!=null&&g.attach)k_(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(b=>b!==u),_=y.indexOf(p);h.children=[...y.slice(0,_),u,...y.slice(_)],m=!0}m||(x=h.__r3f)==null||x.objects.push(u),u.__r3f||Sc(u,{}),u.__r3f.parent=h,lv(u),Ec(u)}}function r(h,u,p=!1){h&&[...h].forEach(m=>a(u,m,p))}function a(h,u,p){if(u){var m,g,x;if(u.__r3f&&(u.__r3f.parent=null),(m=h.__r3f)!=null&&m.objects&&(h.__r3f.objects=h.__r3f.objects.filter(w=>w!==u)),(g=u.__r3f)!=null&&g.attach)lE(h,u,u.__r3f.attach);else if(u.isObject3D&&h.isObject3D){var y;h.remove(u),(y=u.__r3f)!=null&&y.root&&k5(Rm(u),u)}const b=(x=u.__r3f)==null?void 0:x.primitive,S=!b&&(p===void 0?u.dispose!==null:p);if(!b){var _;r((_=u.__r3f)==null?void 0:_.objects,u,S),r(u.children,u,S)}if(delete u.__r3f,S&&u.dispose&&u.type!=="Scene"){const w=()=>{try{u.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?av.unstable_scheduleCallback(av.unstable_IdlePriority,w):w()}Ec(h)}}function o(h,u,p,m){var g;const x=(g=h.__r3f)==null?void 0:g.parent;if(!x)return;const y=e(u,p,h.__r3f.root);if(h.children){for(const _ of h.children)_.__r3f&&i(y,_);h.children=h.children.filter(_=>!_.__r3f)}h.__r3f.objects.forEach(_=>i(y,_)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||a(x,h),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),i(x,y),y.raycast&&y.__r3f.eventCount&&Rm(y).getState().internal.interaction.push(y),[m,m.alternate].forEach(_=>{_!==null&&(_.stateNode=y,_.ref&&(typeof _.ref=="function"?_.ref(y):_.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:C5({createInstance:e,removeChild:a,appendChild:i,appendInitialChild:i,insertBefore:s,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&&s(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:_,...b}=m,{args:S=[],children:w,...R}=p;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((C,L)=>C!==S[L]))return[!0];const T=pR(h,b,R,!0);return T.changes.length?[!1,T]:null}},commitUpdate(h,[u,p],m,g,x,y){u?o(h,m,x,y):z_(h,p)},commitMount(h,u,p,m){var g;const x=(g=h.__r3f)!=null?g:{};h.raycast&&x.handlers&&x.eventCount&&Rm(h).getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>Sc(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var u;const{attach:p,parent:m}=(u=h.__r3f)!=null?u:{};p&&m&&lE(m,h,p),h.isObject3D&&(h.visible=!1),Ec(h)},unhideInstance(h,u){var p;const{attach:m,parent:g}=(p=h.__r3f)!=null?p:{};m&&g&&k_(g,h,m),(h.isObject3D&&u.visible==null||u.visible)&&(h.visible=!0),Ec(h)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>t?t():Pc.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&sn.fun(performance.now)?performance.now:sn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:sn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:sn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:z_}}var sE,rE;const U_=n=>"colorSpace"in n||"outputColorSpace"in n,lR=()=>{var n;return(n=V1.ColorManagement)!=null?n:null},cR=n=>n&&n.isOrthographicCamera,I5=n=>n&&n.hasOwnProperty("current"),Ff=typeof window<"u"&&((sE=window.document)!=null&&sE.createElement||((rE=window.navigator)==null?void 0:rE.product)==="ReactNative")?J.useLayoutEffect:J.useEffect;function hR(n){const t=J.useRef(n);return Ff(()=>void(t.current=n),[n]),t}function L5({set:n}){return Ff(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class uR extends J.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}}uR.getDerivedStateFromError=()=>({error:!0});const fR="__default",aE=new Map,D5=n=>n&&!!n.memoized&&!!n.changes;function dR(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 eu=n=>{var t;return(t=n.__r3f)==null?void 0:t.root.getState()};function Rm(n){let t=n.__r3f.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}const sn={obj:n=>n===Object(n)&&!sn.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:s=!0}={}){if(typeof n!=typeof t||!!n!=!!t)return!1;if(sn.str(n)||sn.num(n)||sn.boo(n))return n===t;const r=sn.obj(n);if(r&&i==="reference")return n===t;const a=sn.arr(n);if(a&&e==="reference")return n===t;if((a||r)&&n===t)return!0;let o;for(o in n)if(!(o in t))return!1;if(r&&e==="shallow"&&i==="shallow"){for(o in s?t:n)if(!sn.equ(n[o],t[o],{strict:s,objects:"reference"}))return!1}else for(o in s?t:n)if(n[o]!==t[o])return!1;if(sn.und(o)){if(a&&n.length===0&&t.length===0||r&&Object.keys(n).length===0&&Object.keys(t).length===0)return!0;if(n!==t)return!1}return!0}};function N5(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const t in n)t.dispose==null||t.dispose(),delete n[t]}function Sc(n,t){const e=n;return e.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...t},n}function ov(n,t){let e=n;if(t.includes("-")){const i=t.split("-"),s=i.pop();return e=i.reduce((r,a)=>r[a],n),{target:e,key:s}}else return{target:e,key:t}}const oE=/-\d+$/;function k_(n,t,e){if(sn.str(e)){if(oE.test(e)){const r=e.replace(oE,""),{target:a,key:o}=ov(n,r);Array.isArray(a[o])||(a[o]=[])}const{target:i,key:s}=ov(n,e);t.__r3f.previousAttach=i[s],i[s]=t}else t.__r3f.previousAttach=e(n,t)}function lE(n,t,e){var i,s;if(sn.str(e)){const{target:r,key:a}=ov(n,e),o=t.__r3f.previousAttach;o===void 0?delete r[a]:r[a]=o}else(i=t.__r3f)==null||i.previousAttach==null||i.previousAttach(n,t);(s=t.__r3f)==null||delete s.previousAttach}function pR(n,{children:t,key:e,ref:i,...s},{children:r,key:a,ref:o,...l}={},c=!1){const h=n.__r3f,u=Object.entries(s),p=[];if(c){const g=Object.keys(l);for(let x=0;x{var y;if((y=n.__r3f)!=null&&y.primitive&&g==="object"||sn.equ(x,l[g]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(g))return p.push([g,x,!0,[]]);let _=[];g.includes("-")&&(_=g.split("-")),p.push([g,x,!1,_]);for(const b in s){const S=s[b];b.startsWith(`${g}-`)&&p.push([b,S,!1,b.split("-")])}});const m={...s};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 O5=typeof process<"u"&&!1;function z_(n,t){var e;const i=n.__r3f,s=i==null?void 0:i.root,r=s==null||s.getState==null?void 0:s.getState(),{memoized:a,changes:o}=D5(t)?t:pR(n,t),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=a);for(let h=0;h_[b],n),!(y&&y.set))){const[_,...b]=g.reverse();x=b.reverse().reduce((S,w)=>S[w],n),u=_}if(p===fR+"remove")if(x.constructor){let _=aE.get(x.constructor);_||(_=new x.constructor,aE.set(x.constructor,_)),p=_[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 nl)){if(Array.isArray(p))y.fromArray?y.fromArray(p):y.set(...p);else if(y.copy&&p&&p.constructor&&(O5?y.constructor.name===p.constructor.name:y.constructor===p.constructor))y.copy(p);else if(p!==void 0){const _=y instanceof kt;!_&&y.setScalar?y.setScalar(p):y instanceof nl&&p instanceof nl?y.mask=p.mask:y.set(p),!lR()&&r&&!r.linear&&_&&y.convertSRGBToLinear()}}else if(x[u]=p,x[u]instanceof bn&&x[u].format===di&&x[u].type===Xs&&r){const _=x[u];U_(_)&&U_(r.gl)?_.colorSpace=r.gl.outputColorSpace:_.encoding=r.gl.outputEncoding}Ec(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const h=Rm(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&&lv(n),n}function Ec(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 lv(n){n.onUpdate==null||n.onUpdate(n)}function F5(n,t){n.manual||(cR(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 Gp(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function U5(){var n;const t=typeof self<"u"&&self||typeof window<"u"&&window;if(!t)return Pc.DefaultEventPriority;switch((n=t.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Pc.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Pc.ContinuousEventPriority;default:return Pc.DefaultEventPriority}}function mR(n,t,e,i){const s=e.get(t);s&&(e.delete(t),e.size===0&&(n.delete(i),s.target.releasePointerCapture(i)))}function k5(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,s)=>{(i.eventObject===t||i.object===t)&&e.hovered.delete(s)}),e.capturedMap.forEach((i,s)=>{mR(e.capturedMap,t,i,s)})}function z5(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 _=0;_{const S=eu(_.object),w=eu(b.object);return!S||!w?_.distance-b.distance:w.events.priority-S.events.priority||_.distance-b.distance}).filter(_=>{const b=Gp(_);return u.has(b)?!1:(u.add(b),!0)});h.events.filter&&(x=h.events.filter(x,h));for(const _ of x){let b=_.object;for(;b;){var y;(y=b.__r3f)!=null&&y.eventCount&&p.push({..._,eventObject:b}),b=b.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let _ of h.internal.capturedMap.get(l.pointerId).values())u.has(Gp(_.intersection))||p.push(_.intersection);return p}function s(l,c,h,u){const p=n.getState();if(l.length){const m={stopped:!1};for(const g of l){const x=eu(g.object)||p,{raycaster:y,pointer:_,camera:b,internal:S}=x,w=new O(_.x,_.y,0).unproject(b),R=E=>{var D,z;return(D=(z=S.capturedMap.get(E))==null?void 0:z.has(g.eventObject))!=null?D:!1},T=E=>{const D={intersection:g,target:c.target};S.capturedMap.has(E)?S.capturedMap.get(E).set(g.eventObject,D):S.capturedMap.set(E,new Map([[g.eventObject,D]])),c.target.setPointerCapture(E)},C=E=>{const D=S.capturedMap.get(E);D&&mR(S.capturedMap,g.eventObject,D,E)};let L={};for(let E in c){let D=c[E];typeof D!="function"&&(L[E]=D)}let P={...g,...L,pointer:_,intersections:l,stopped:m.stopped,delta:h,unprojectedPoint:w,ray:y.ray,camera:b,stopPropagation(){const E="pointerId"in c&&S.capturedMap.get(c.pointerId);if((!E||E.has(g.eventObject))&&(P.stopped=m.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(D=>D.eventObject===g.eventObject))){const D=l.slice(0,l.indexOf(g));r([...D,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 r(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(Gp(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;hr([]);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),r([]))})}}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),_=g?t(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=y.map(S=>S.eventObject)),g&&!y.length&&_<=2&&(a(h,p.interaction),u&&u(h)),m&&r(y);function b(S){const w=S.eventObject,R=w.__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=Gp(S),L=p.hovered.get(C);L?L.stopped&&S.stopPropagation():(p.hovered.set(C,S),T.onPointerOver==null||T.onPointerOver(S),T.onPointerEnter==null||T.onPointerEnter(S))}T.onPointerMove==null||T.onPointerMove(S)}else{const C=T[l];C?(!g||p.initialHits.includes(w))&&(a(h,p.interaction.filter(L=>!p.initialHits.includes(L))),C(S)):g&&p.initialHits.includes(w)&&a(h,p.interaction.filter(L=>!p.initialHits.includes(L)))}}s(y,h,_,b)}}return{handlePointer:o}}const gR=n=>!!(n!=null&&n.render),yR=J.createContext(null),B5=(n,t)=>{const e=E5((o,l)=>{const c=new O,h=new O,u=new O;function p(_=l().camera,b=h,S=l().size){const{width:w,height:R,top:T,left:C}=S,L=w/R;b instanceof O?u.copy(b):u.set(...b);const P=_.getWorldPosition(c).distanceTo(u);if(cR(_))return{width:w/_.zoom,height:R/_.zoom,top:T,left:C,factor:1,distance:P,aspect:L};{const E=_.fov*Math.PI/180,D=2*Math.tan(E/2)*P,z=D*(w/R);return{width:z,height:D,top:T,left:C,factor:w/z,distance:P,aspect:L}}}let m;const g=_=>o(b=>({performance:{...b.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:(_=1)=>n(l(),_),advance:(_,b)=>t(_,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new U1,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const _=l();m&&clearTimeout(m),_.performance.current!==_.performance.min&&g(_.performance.min),m=setTimeout(()=>g(l().performance.max),_.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:_=>o(b=>({...b,events:{...b.events,..._}})),setSize:(_,b,S,w,R)=>{const T=l().camera,C={width:_,height:b,top:w||0,left:R||0,updateStyle:S};o(L=>({size:C,viewport:{...L.viewport,...p(T,h,C)}}))},setDpr:_=>o(b=>{const S=dR(_);return{viewport:{...b.viewport,dpr:S,initialDpr:b.viewport.initialDpr||S}}}),setFrameloop:(_="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,_!=="never"&&(b.start(),b.elapsedTime=0),o(()=>({frameloop:_}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:J.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(_,b,S)=>{const w=l().internal;return w.priority=w.priority+(b>0?1:0),w.subscribers.push({ref:_,priority:b,store:S}),w.subscribers=w.subscribers.sort((R,T)=>R.priority-T.priority),()=>{const R=l().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(b>0?1:0),R.subscribers=R.subscribers.filter(T=>T.ref!==_))}}}}}),i=e.getState();let s=i.size,r=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!==s.width||l.height!==s.height||c.dpr!==r){var p;s=l,r=c.dpr,F5(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 Vp,H5=new Set,G5=new Set,V5=new Set;function B_(n,t){if(n.size)for(const{callback:e}of n.values())e(t)}function nu(n,t){switch(n){case"before":return B_(H5,t);case"after":return B_(G5,t);case"tail":return B_(V5,t)}}let H_,G_;function V_(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),H_=t.internal.subscribers,Vp=0;Vp0)&&!((h=r.gl.xr)!=null&&h.isPresenting)&&(i+=V_(c,r))}if(e=!1,nu("after",c),i===0)return nu("tail",c),t=!1,cancelAnimationFrame(s)}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&&nu("before",c),u)V_(c,u,p);else for(const m of n.values())V_(c,m.store.getState());h&&nu("after",c)}return{loop:a,invalidate:o,advance:l}}function _R(){const n=J.useContext(yR);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function mr(n=e=>e,t){return _R()(n,t)}function Sg(n,t=0){const e=_R(),i=e.getState().internal.subscribe,s=hR(n);return Ff(()=>i(s,t,e),[t,i,e]),null}const eh=new Map,{invalidate:cE,advance:hE}=W5(eh),{reconciler:A0,applyProps:sc}=P5(eh,U5),rc={objects:"shallow",strict:!1},j5=(n,t)=>{const e=typeof n=="function"?n(t):n;return gR(e)?e:new iR({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...n})};function X5(n,t){const e=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(t){const{width:i,height:s,top:r,left:a,updateStyle:o=e}=t;return{width:i,height:s,top:r,left:a,updateStyle:o}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:s,top:r,left:a}=n.parentElement.getBoundingClientRect();return{width:i,height:s,top:r,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 q5(n){const t=eh.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 s=typeof reportError=="function"?reportError:console.error,r=i||B5(cE,hE),a=e||A0.createContainer(r,Pc.ConcurrentRoot,null,!1,null,"",s,null);t||eh.set(n,{fiber:a,store:r});let o,l=!1,c;return{configure(h={}){let{gl:u,size:p,scene:m,events:g,onCreated:x,shadows:y=!1,linear:_=!1,flat:b=!1,legacy:S=!1,orthographic:w=!1,frameloop:R="always",dpr:T=[1,2],performance:C,raycaster:L,camera:P,onPointerMissed:E}=h,D=r.getState(),z=D.gl;D.gl||D.set({gl:z=j5(u,n)});let G=D.raycaster;G||D.set({raycaster:G=new bg});const{params:W,...Q}=L||{};if(sn.equ(Q,G,rc)||sc(G,{...Q}),sn.equ(W,G.params,rc)||sc(G,{params:{...G.params,...W}}),!D.camera||D.camera===c&&!sn.equ(c,P,rc)){c=P;const it=P instanceof Tf,$=it?P:w?new aa(0,0,0,0,.1,1e3):new gn(75,0,.1,1e3);it||($.position.z=5,P&&(sc($,P),("aspect"in P||"left"in P||"right"in P||"bottom"in P||"top"in P)&&($.manual=!0,$.updateProjectionMatrix())),!D.camera&&!(P!=null&&P.rotation)&&$.lookAt(0,0,0)),D.set({camera:$}),G.camera=$}if(!D.scene){let it;m instanceof b0?it=m:(it=new b0,m&&sc(it,m)),D.set({scene:Sc(it)})}if(!D.xr){var Y;const it=(_t,q)=>{const rt=r.getState();rt.frameloop!=="never"&&hE(_t,!0,rt,q)},$=()=>{const _t=r.getState();_t.gl.xr.enabled=_t.gl.xr.isPresenting,_t.gl.xr.setAnimationLoop(_t.gl.xr.isPresenting?it:null),_t.gl.xr.isPresenting||cE(_t)},lt={connect(){const _t=r.getState().gl;_t.xr.addEventListener("sessionstart",$),_t.xr.addEventListener("sessionend",$)},disconnect(){const _t=r.getState().gl;_t.xr.removeEventListener("sessionstart",$),_t.xr.removeEventListener("sessionend",$)}};typeof((Y=z.xr)==null?void 0:Y.addEventListener)=="function"&<.connect(),D.set({xr:lt})}if(z.shadowMap){const it=z.shadowMap.enabled,$=z.shadowMap.type;if(z.shadowMap.enabled=!!y,sn.boo(y))z.shadowMap.type=wu;else if(sn.str(y)){var ot;const lt={basic:o2,percentage:j0,soft:wu,variance:Bs};z.shadowMap.type=(ot=lt[y])!=null?ot:wu}else sn.obj(y)&&Object.assign(z.shadowMap,y);(it!==z.shadowMap.enabled||$!==z.shadowMap.type)&&(z.shadowMap.needsUpdate=!0)}const H=lR();H&&("enabled"in H?H.enabled=!S:"legacyMode"in H&&(H.legacyMode=S)),l||sc(z,{outputEncoding:_?3e3:3001,toneMapping:b?wr:Zv}),D.legacy!==S&&D.set(()=>({legacy:S})),D.linear!==_&&D.set(()=>({linear:_})),D.flat!==b&&D.set(()=>({flat:b})),u&&!sn.fun(u)&&!gR(u)&&!sn.equ(u,z,rc)&&sc(z,u),g&&!D.events.handlers&&D.set({events:g(r)});const Z=X5(n,p);return sn.equ(Z,D.size,rc)||D.setSize(Z.width,Z.height,Z.updateStyle,Z.top,Z.left),T&&D.viewport.dpr!==dR(T)&&D.setDpr(T),D.frameloop!==R&&D.setFrameloop(R),D.onPointerMissed||D.set({onPointerMissed:E}),C&&!sn.equ(C,D.performance,rc)&&D.set(it=>({performance:{...it.performance,...C}})),o=x,l=!0,this},render(h){return l||this.configure(),A0.updateContainer(V.jsx(Y5,{store:r,children:h,onCreated:o,rootElement:n}),a,null,()=>{}),r},unmount(){xR(n)}}}function Y5({store:n,children:t,onCreated:e,rootElement:i}){return Ff(()=>{const s=n.getState();s.set(r=>({internal:{...r.internal,active:!0}})),e&&e(s),n.getState().events.connected||s.events.connect==null||s.events.connect(i)},[]),V.jsx(yR.Provider,{value:n,children:t})}function xR(n,t){const e=eh.get(n),i=e==null?void 0:e.fiber;if(i){const s=e==null?void 0:e.store.getState();s&&(s.internal.active=!1),A0.updateContainer(null,i,null,()=>{s&&setTimeout(()=>{try{var r,a,o,l;s.events.disconnect==null||s.events.disconnect(),(r=s.gl)==null||(a=r.renderLists)==null||a.dispose==null||a.dispose(),(o=s.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=s.gl)!=null&&l.xr&&s.xr.disconnect(),N5(s),eh.delete(n)}catch{}},500)})}}A0.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:J.version});const W_={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 $5(n){const{handlePointer:t}=z5(n);return{priority:1,enabled:!0,compute(e,i,s){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(W_).reduce((e,i)=>({...e,[i]:t(i)}),{}),update:()=>{var e;const{events:i,internal:s}=n.getState();(e=s.lastEvent)!=null&&e.current&&i.handlers&&i.handlers.onPointerMove(s.lastEvent.current)},connect:e=>{var i;const{set:s,events:r}=n.getState();r.disconnect==null||r.disconnect(),s(a=>({events:{...a.events,connected:e}})),Object.entries((i=r.handlers)!=null?i:[]).forEach(([a,o])=>{const[l,c]=W_[a];e.addEventListener(l,o,{passive:c})})},disconnect:()=>{const{set:e,events:i}=n.getState();if(i.connected){var s;Object.entries((s=i.handlers)!=null?s:[]).forEach(([r,a])=>{if(i&&i.connected instanceof HTMLElement){const[o]=W_[r];i.connected.removeEventListener(o,a)}}),e(r=>({events:{...r.events,connected:void 0}}))}}}}function cv(n,t,e){var i,s,r,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(r,s),r=s=null))}var c=function(){r=this,s=arguments,a=Date.now();var h=e&&!i;return i||(i=setTimeout(l,t)),h&&(o=n.apply(r,s),r=s=null),o};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(o=n.apply(r,s),r=s=null,clearTimeout(i),i=null)},c}cv.debounce=cv;var Z5=cv;const uE=xf(Z5);var K5=Object.defineProperty,J5=Object.defineProperties,Q5=Object.getOwnPropertyDescriptors,fE=Object.getOwnPropertySymbols,t6=Object.prototype.hasOwnProperty,e6=Object.prototype.propertyIsEnumerable,dE=(n,t,e)=>t in n?K5(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,pE=(n,t)=>{for(var e in t||(t={}))t6.call(t,e)&&dE(n,e,t[e]);if(fE)for(var e of fE(t))e6.call(t,e)&&dE(n,e,t[e]);return n},n6=(n,t)=>J5(n,Q5(t)),mE,gE;typeof window<"u"&&((mE=window.document)!=null&&mE.createElement||((gE=window.navigator)==null?void 0:gE.product)==="ReactNative")?J.useLayoutEffect:J.useEffect;function vR(n,t,e){if(!n)return;if(e(n)===!0)return n;let i=n.child;for(;i;){const s=vR(i,t,e);if(s)return s;i=i.sibling}}function MR(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const yE=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=yE;return}return yE.apply(this,arguments)};const W1=MR(J.createContext(null));class bR extends J.Component{render(){return J.createElement(W1.Provider,{value:this._reactInternals},this.props.children)}}function i6(){const n=J.useContext(W1);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const t=J.useId();return J.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const s=vR(i,!1,r=>{let a=r.memoizedState;for(;a;){if(a.memoizedState===t)return!0;a=a.next}});if(s)return s}},[n,t])}function s6(){const n=i6(),[t]=J.useState(()=>new Map);t.clear();let e=n;for(;e;){if(e.type&&typeof e.type=="object"){const s=e.type._context===void 0&&e.type.Provider===e.type?e.type:e.type._context;s&&s!==W1&&!t.has(s)&&t.set(s,J.useContext(MR(s)))}e=e.return}return t}function r6(){const n=s6();return J.useMemo(()=>Array.from(n.keys()).reduce((t,e)=>i=>J.createElement(t,null,J.createElement(e.Provider,n6(pE({},i),{value:n.get(e)}))),t=>J.createElement(bR,pE({},t))),[n])}function a6({debounce:n,scroll:t,polyfill:e,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const s=e||typeof window<"u"&&window.ResizeObserver,[r,a]=J.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!s)return r.width=1280,r.height=800,[()=>{},r,()=>{}];const o=J.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:r}),l=n?typeof n=="number"?n:n.scroll:null,c=n?typeof n=="number"?n:n.resize:null,h=J.useRef(!1);J.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[u,p,m]=J.useMemo(()=>{const _=()=>{if(!o.current.element)return;const{left:b,top:S,width:w,height:R,bottom:T,right:C,x:L,y:P}=o.current.element.getBoundingClientRect(),E={left:b,top:S,width:w,height:R,bottom:T,right:C,x:L,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&&!h6(o.current.lastBounds,E)&&a(o.current.lastBounds=E)};return[_,c?uE(_,c):_,l?uE(_,l):_]},[a,i,l,c]);function g(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(_=>_.removeEventListener("scroll",m,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null)}function x(){o.current.element&&(o.current.resizeObserver=new s(m),o.current.resizeObserver.observe(o.current.element),t&&o.current.scrollContainers&&o.current.scrollContainers.forEach(_=>_.addEventListener("scroll",m,{capture:!0,passive:!0})))}const y=_=>{!_||_===o.current.element||(g(),o.current.element=_,o.current.scrollContainers=wR(_),x())};return l6(m,!!t),o6(p),J.useEffect(()=>{g(),x()},[t,m,p]),J.useEffect(()=>g,[]),[y,r,u]}function o6(n){J.useEffect(()=>{const t=n;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[n])}function l6(n,t){J.useEffect(()=>{if(t){const e=n;return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",e,!0)}},[n,t])}function wR(n){const t=[];if(!n||n===document.body)return t;const{overflow:e,overflowX:i,overflowY:s}=window.getComputedStyle(n);return[e,i,s].some(r=>r==="auto"||r==="scroll")&&t.push(n),[...t,...wR(n.parentElement)]}const c6=["x","y","top","bottom","left","right","width","height"],h6=(n,t)=>c6.every(e=>n[e]===t[e]),u6=J.forwardRef(function({children:t,fallback:e,resize:i,style:s,gl:r,events:a=$5,eventSource:o,eventPrefix:l,shadows:c,linear:h,flat:u,legacy:p,orthographic:m,frameloop:g,dpr:x,performance:y,raycaster:_,camera:b,scene:S,onPointerMissed:w,onCreated:R,...T},C){J.useMemo(()=>R5(b5),[]);const L=r6(),[P,E]=a6({scroll:!0,debounce:{scroll:50,resize:0},...i}),D=J.useRef(null),z=J.useRef(null);J.useImperativeHandle(C,()=>D.current);const G=hR(w),[W,Q]=J.useState(!1),[Y,ot]=J.useState(!1);if(W)throw W;if(Y)throw Y;const H=J.useRef(null);Ff(()=>{const it=D.current;E.width>0&&E.height>0&&it&&(H.current||(H.current=q5(it)),H.current.configure({gl:r,events:a,shadows:c,linear:h,flat:u,legacy:p,orthographic:m,frameloop:g,dpr:x,performance:y,raycaster:_,camera:b,scene:S,size:E,onPointerMissed:(...$)=>G.current==null?void 0:G.current(...$),onCreated:$=>{$.events.connect==null||$.events.connect(o?I5(o)?o.current:o:z.current),l&&$.setEvents({compute:(lt,_t)=>{const q=lt[l+"X"],rt=lt[l+"Y"];_t.pointer.set(q/_t.size.width*2-1,-(rt/_t.size.height)*2+1),_t.raycaster.setFromCamera(_t.pointer,_t.camera)}}),R==null||R($)}}),H.current.render(V.jsx(L,{children:V.jsx(uR,{set:ot,children:V.jsx(J.Suspense,{fallback:V.jsx(L5,{set:Q}),children:t})})})))}),J.useEffect(()=>{const it=D.current;if(it)return()=>xR(it)},[]);const Z=o?"none":"auto";return V.jsx("div",{ref:z,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Z,...s},...T,children:V.jsx("div",{ref:P,style:{width:"100%",height:"100%"},children:V.jsx("canvas",{ref:D,style:{display:"block"},children:e})})})}),f6=J.forwardRef(function(t,e){return V.jsx(bR,{children:V.jsx(u6,{...t,ref:e})})});var d6=Object.defineProperty,p6=(n,t,e)=>t in n?d6(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ge=(n,t,e)=>(p6(n,typeof t!="symbol"?t+"":t,e),e);const Wp=new no,_E=new gr,m6=Math.cos(70*(Math.PI/180)),xE=(n,t)=>(n%t+t)%t;let g6=class extends Zs{constructor(t,e){super(),ge(this,"object"),ge(this,"domElement"),ge(this,"enabled",!0),ge(this,"target",new O),ge(this,"minDistance",0),ge(this,"maxDistance",1/0),ge(this,"minZoom",0),ge(this,"maxZoom",1/0),ge(this,"minPolarAngle",0),ge(this,"maxPolarAngle",Math.PI),ge(this,"minAzimuthAngle",-1/0),ge(this,"maxAzimuthAngle",1/0),ge(this,"enableDamping",!1),ge(this,"dampingFactor",.05),ge(this,"enableZoom",!0),ge(this,"zoomSpeed",1),ge(this,"enableRotate",!0),ge(this,"rotateSpeed",1),ge(this,"enablePan",!0),ge(this,"panSpeed",1),ge(this,"screenSpacePanning",!0),ge(this,"keyPanSpeed",7),ge(this,"zoomToCursor",!1),ge(this,"autoRotate",!1),ge(this,"autoRotateSpeed",2),ge(this,"reverseOrbit",!1),ge(this,"reverseHorizontalOrbit",!1),ge(this,"reverseVerticalOrbit",!1),ge(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ge(this,"mouseButtons",{LEFT:Gn.ROTATE,MIDDLE:Gn.DOLLY,RIGHT:Gn.PAN}),ge(this,"touches",{ONE:ts.ROTATE,TWO:ts.DOLLY_PAN}),ge(this,"target0"),ge(this,"position0"),ge(this,"zoom0"),ge(this,"_domElementKeyEvents",null),ge(this,"getPolarAngle"),ge(this,"getAzimuthalAngle"),ge(this,"setPolarAngle"),ge(this,"setAzimuthalAngle"),ge(this,"getDistance"),ge(this,"getZoomScale"),ge(this,"listenToKeyEvents"),ge(this,"stopListenToKeyEvents"),ge(this,"saveState"),ge(this,"reset"),ge(this,"update"),ge(this,"connect"),ge(this,"dispose"),ge(this,"dollyIn"),ge(this,"dollyOut"),ge(this,"getScale"),ge(this,"setScale"),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=X=>{let bt=xE(X,2*Math.PI),Gt=h.phi;Gt<0&&(Gt+=2*Math.PI),bt<0&&(bt+=2*Math.PI);let j=Math.abs(bt-Gt);2*Math.PI-j{let bt=xE(X,2*Math.PI),Gt=h.theta;Gt<0&&(Gt+=2*Math.PI),bt<0&&(bt+=2*Math.PI);let j=Math.abs(bt-Gt);2*Math.PI-ji.object.position.distanceTo(i.target),this.listenToKeyEvents=X=>{X.addEventListener("keydown",zt),this._domElementKeyEvents=X},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",zt),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(s),i.update(),l=o.NONE},this.update=(()=>{const X=new O,bt=new O(0,1,0),Gt=new Cn().setFromUnitVectors(t.up,bt),j=Gt.clone().invert(),Ot=new O,pt=new Cn,At=2*Math.PI;return function(){const Wt=i.object.position;Gt.setFromUnitVectors(t.up,bt),j.copy(Gt).invert(),X.copy(Wt).sub(i.target),X.applyQuaternion(Gt),h.setFromVector3(X),i.autoRotate&&l===o.NONE&&W(z()),i.enableDamping?(h.theta+=u.theta*i.dampingFactor,h.phi+=u.phi*i.dampingFactor):(h.theta+=u.theta,h.phi+=u.phi);let pe=i.minAzimuthAngle,Be=i.maxAzimuthAngle;isFinite(pe)&&isFinite(Be)&&(pe<-Math.PI?pe+=At:pe>Math.PI&&(pe-=At),Be<-Math.PI?Be+=At:Be>Math.PI&&(Be-=At),pe<=Be?h.theta=Math.max(pe,Math.min(Be,h.theta)):h.theta=h.theta>(pe+Be)/2?Math.max(pe,h.theta):Math.min(Be,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=_t(h.radius):h.radius=_t(h.radius*p),X.setFromSpherical(h),X.applyQuaternion(j),Wt.copy(i.target).add(X),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 nn=!1;if(i.zoomToCursor&&P){let Fe=null;if(i.object instanceof gn&&i.object.isPerspectiveCamera){const wn=X.length();Fe=_t(wn*p);const Jn=wn-Fe;i.object.position.addScaledVector(C,Jn),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const wn=new O(L.x,L.y,0);wn.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),nn=!0;const Jn=new O(L.x,L.y,0);Jn.unproject(i.object),i.object.position.sub(Jn).add(wn),i.object.updateMatrixWorld(),Fe=X.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Fe!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Fe).add(i.object.position):(Wp.origin.copy(i.object.position),Wp.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(Wp.direction))c||8*(1-pt.dot(i.object.quaternion))>c?(i.dispatchEvent(s),Ot.copy(i.object.position),pt.copy(i.object.quaternion),nn=!1,!0):!1}})(),this.connect=X=>{i.domElement=X,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",at),i.domElement.addEventListener("pointerdown",N),i.domElement.addEventListener("pointercancel",yt),i.domElement.addEventListener("wheel",te)},this.dispose=()=>{var X,bt,Gt,j,Ot,pt;i.domElement&&(i.domElement.style.touchAction="auto"),(X=i.domElement)==null||X.removeEventListener("contextmenu",at),(bt=i.domElement)==null||bt.removeEventListener("pointerdown",N),(Gt=i.domElement)==null||Gt.removeEventListener("pointercancel",yt),(j=i.domElement)==null||j.removeEventListener("wheel",te),(Ot=i.domElement)==null||Ot.ownerDocument.removeEventListener("pointermove",st),(pt=i.domElement)==null||pt.ownerDocument.removeEventListener("pointerup",yt),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",zt)};const i=this,s={type:"change"},r={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 O,g=new xt,x=new xt,y=new xt,_=new xt,b=new xt,S=new xt,w=new xt,R=new xt,T=new xt,C=new O,L=new xt;let P=!1;const E=[],D={};function z(){return 2*Math.PI/60/60*i.autoRotateSpeed}function G(){return Math.pow(.95,i.zoomSpeed)}function W(X){i.reverseOrbit||i.reverseHorizontalOrbit?u.theta+=X:u.theta-=X}function Q(X){i.reverseOrbit||i.reverseVerticalOrbit?u.phi+=X:u.phi-=X}const Y=(()=>{const X=new O;return function(Gt,j){X.setFromMatrixColumn(j,0),X.multiplyScalar(-Gt),m.add(X)}})(),ot=(()=>{const X=new O;return function(Gt,j){i.screenSpacePanning===!0?X.setFromMatrixColumn(j,1):(X.setFromMatrixColumn(j,0),X.crossVectors(i.object.up,X)),X.multiplyScalar(Gt),m.add(X)}})(),H=(()=>{const X=new O;return function(Gt,j){const Ot=i.domElement;if(Ot&&i.object instanceof gn&&i.object.isPerspectiveCamera){const pt=i.object.position;X.copy(pt).sub(i.target);let At=X.length();At*=Math.tan(i.object.fov/2*Math.PI/180),Y(2*Gt*At/Ot.clientHeight,i.object.matrix),ot(2*j*At/Ot.clientHeight,i.object.matrix)}else Ot&&i.object instanceof aa&&i.object.isOrthographicCamera?(Y(Gt*(i.object.right-i.object.left)/i.object.zoom/Ot.clientWidth,i.object.matrix),ot(j*(i.object.top-i.object.bottom)/i.object.zoom/Ot.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function Z(X){i.object instanceof gn&&i.object.isPerspectiveCamera||i.object instanceof aa&&i.object.isOrthographicCamera?p=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function it(X){Z(p/X)}function $(X){Z(p*X)}function lt(X){if(!i.zoomToCursor||!i.domElement)return;P=!0;const bt=i.domElement.getBoundingClientRect(),Gt=X.clientX-bt.left,j=X.clientY-bt.top,Ot=bt.width,pt=bt.height;L.x=Gt/Ot*2-1,L.y=-(j/pt)*2+1,C.set(L.x,L.y,1).unproject(i.object).sub(i.object.position).normalize()}function _t(X){return Math.max(i.minDistance,Math.min(i.maxDistance,X))}function q(X){g.set(X.clientX,X.clientY)}function rt(X){lt(X),w.set(X.clientX,X.clientY)}function St(X){_.set(X.clientX,X.clientY)}function dt(X){x.set(X.clientX,X.clientY),y.subVectors(x,g).multiplyScalar(i.rotateSpeed);const bt=i.domElement;bt&&(W(2*Math.PI*y.x/bt.clientHeight),Q(2*Math.PI*y.y/bt.clientHeight)),g.copy(x),i.update()}function It(X){R.set(X.clientX,X.clientY),T.subVectors(R,w),T.y>0?it(G()):T.y<0&&$(G()),w.copy(R),i.update()}function Ht(X){b.set(X.clientX,X.clientY),S.subVectors(b,_).multiplyScalar(i.panSpeed),H(S.x,S.y),_.copy(b),i.update()}function Bt(X){lt(X),X.deltaY<0?$(G()):X.deltaY>0&&it(G()),i.update()}function Qt(X){let bt=!1;switch(X.code){case i.keys.UP:H(0,i.keyPanSpeed),bt=!0;break;case i.keys.BOTTOM:H(0,-i.keyPanSpeed),bt=!0;break;case i.keys.LEFT:H(i.keyPanSpeed,0),bt=!0;break;case i.keys.RIGHT:H(-i.keyPanSpeed,0),bt=!0;break}bt&&(X.preventDefault(),i.update())}function ht(){if(E.length==1)g.set(E[0].pageX,E[0].pageY);else{const X=.5*(E[0].pageX+E[1].pageX),bt=.5*(E[0].pageY+E[1].pageY);g.set(X,bt)}}function gt(){if(E.length==1)_.set(E[0].pageX,E[0].pageY);else{const X=.5*(E[0].pageX+E[1].pageX),bt=.5*(E[0].pageY+E[1].pageY);_.set(X,bt)}}function k(){const X=E[0].pageX-E[1].pageX,bt=E[0].pageY-E[1].pageY,Gt=Math.sqrt(X*X+bt*bt);w.set(0,Gt)}function Et(){i.enableZoom&&k(),i.enablePan&>()}function wt(){i.enableZoom&&k(),i.enableRotate&&ht()}function Lt(X){if(E.length==1)x.set(X.pageX,X.pageY);else{const Gt=Vt(X),j=.5*(X.pageX+Gt.x),Ot=.5*(X.pageY+Gt.y);x.set(j,Ot)}y.subVectors(x,g).multiplyScalar(i.rotateSpeed);const bt=i.domElement;bt&&(W(2*Math.PI*y.x/bt.clientHeight),Q(2*Math.PI*y.y/bt.clientHeight)),g.copy(x)}function Ct(X){if(E.length==1)b.set(X.pageX,X.pageY);else{const bt=Vt(X),Gt=.5*(X.pageX+bt.x),j=.5*(X.pageY+bt.y);b.set(Gt,j)}S.subVectors(b,_).multiplyScalar(i.panSpeed),H(S.x,S.y),_.copy(b)}function ne(X){const bt=Vt(X),Gt=X.pageX-bt.x,j=X.pageY-bt.y,Ot=Math.sqrt(Gt*Gt+j*j);R.set(0,Ot),T.set(0,Math.pow(R.y/w.y,i.zoomSpeed)),it(T.y),w.copy(R)}function Ft(X){i.enableZoom&&ne(X),i.enablePan&&Ct(X)}function U(X){i.enableZoom&&ne(X),i.enableRotate&&Lt(X)}function N(X){var bt,Gt;i.enabled!==!1&&(E.length===0&&((bt=i.domElement)==null||bt.ownerDocument.addEventListener("pointermove",st),(Gt=i.domElement)==null||Gt.ownerDocument.addEventListener("pointerup",yt)),Tt(X),X.pointerType==="touch"?Zt(X):Rt(X))}function st(X){i.enabled!==!1&&(X.pointerType==="touch"?Re(X):Mt(X))}function yt(X){var bt,Gt,j;ae(X),E.length===0&&((bt=i.domElement)==null||bt.releasePointerCapture(X.pointerId),(Gt=i.domElement)==null||Gt.ownerDocument.removeEventListener("pointermove",st),(j=i.domElement)==null||j.ownerDocument.removeEventListener("pointerup",yt)),i.dispatchEvent(a),l=o.NONE}function Rt(X){let bt;switch(X.button){case 0:bt=i.mouseButtons.LEFT;break;case 1:bt=i.mouseButtons.MIDDLE;break;case 2:bt=i.mouseButtons.RIGHT;break;default:bt=-1}switch(bt){case Gn.DOLLY:if(i.enableZoom===!1)return;rt(X),l=o.DOLLY;break;case Gn.ROTATE:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enablePan===!1)return;St(X),l=o.PAN}else{if(i.enableRotate===!1)return;q(X),l=o.ROTATE}break;case Gn.PAN:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enableRotate===!1)return;q(X),l=o.ROTATE}else{if(i.enablePan===!1)return;St(X),l=o.PAN}break;default:l=o.NONE}l!==o.NONE&&i.dispatchEvent(r)}function Mt(X){if(i.enabled!==!1)switch(l){case o.ROTATE:if(i.enableRotate===!1)return;dt(X);break;case o.DOLLY:if(i.enableZoom===!1)return;It(X);break;case o.PAN:if(i.enablePan===!1)return;Ht(X);break}}function te(X){i.enabled===!1||i.enableZoom===!1||l!==o.NONE&&l!==o.ROTATE||(X.preventDefault(),i.dispatchEvent(r),Bt(X),i.dispatchEvent(a))}function zt(X){i.enabled===!1||i.enablePan===!1||Qt(X)}function Zt(X){switch(ue(X),E.length){case 1:switch(i.touches.ONE){case ts.ROTATE:if(i.enableRotate===!1)return;ht(),l=o.TOUCH_ROTATE;break;case ts.PAN:if(i.enablePan===!1)return;gt(),l=o.TOUCH_PAN;break;default:l=o.NONE}break;case 2:switch(i.touches.TWO){case ts.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;Et(),l=o.TOUCH_DOLLY_PAN;break;case ts.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;wt(),l=o.TOUCH_DOLLY_ROTATE;break;default:l=o.NONE}break;default:l=o.NONE}l!==o.NONE&&i.dispatchEvent(r)}function Re(X){switch(ue(X),l){case o.TOUCH_ROTATE:if(i.enableRotate===!1)return;Lt(X),i.update();break;case o.TOUCH_PAN:if(i.enablePan===!1)return;Ct(X),i.update();break;case o.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;Ft(X),i.update();break;case o.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;U(X),i.update();break;default:l=o.NONE}}function at(X){i.enabled!==!1&&X.preventDefault()}function Tt(X){E.push(X)}function ae(X){delete D[X.pointerId];for(let bt=0;bt{$(X),i.update()},this.dollyOut=(X=G())=>{it(X),i.update()},this.getScale=()=>p,this.setScale=X=>{Z(X),i.update()},this.getZoomScale=()=>G(),e!==void 0&&this.connect(e),this.update()}};const y6=J.forwardRef(({makeDefault:n,camera:t,regress:e,domElement:i,enableDamping:s=!0,keyEvents:r=!1,onChange:a,onStart:o,onEnd:l,...c},h)=>{const u=mr(T=>T.invalidate),p=mr(T=>T.camera),m=mr(T=>T.gl),g=mr(T=>T.events),x=mr(T=>T.setEvents),y=mr(T=>T.set),_=mr(T=>T.get),b=mr(T=>T.performance),S=t||p,w=i||g.connected||m.domElement,R=J.useMemo(()=>new g6(S),[S]);return Sg(()=>{R.enabled&&R.update()},-1),J.useEffect(()=>(r&&R.connect(r===!0?w:r),R.connect(w),()=>void R.dispose()),[r,w,e,R,u]),J.useEffect(()=>{const T=P=>{u(),e&&b.regress(),a&&a(P)},C=P=>{o&&o(P)},L=P=>{l&&l(P)};return R.addEventListener("change",T),R.addEventListener("start",C),R.addEventListener("end",L),()=>{R.removeEventListener("start",C),R.removeEventListener("end",L),R.removeEventListener("change",T)}},[a,o,l,R,u,x]),J.useEffect(()=>{if(n){const T=_().controls;return y({controls:R}),()=>y({controls:T})}},[n,R]),J.createElement("primitive",cI({ref:h,object:R,enableDamping:s},c))});function _6(n){const t=J.useRef(),e=J.useRef(new bg),i=J.useRef(new xt),{gl:s,camera:r,scene:a}=mr();let o=0;const l=u=>{u.preventDefault();const m=(()=>{const y=window.isTouchDevice,_=y?u.touches[0].clientX:u.clientX,b=y?u.touches[0].clientY:u.clientY,S=u.target.getBoundingClientRect();return i.current.x=(_-S.left)/S.width*2-1,i.current.y=-(b-S.top)/S.height*2+1,e.current.setFromCamera(i.current,r),e.current.intersectObjects(a.children,!0)})();if(m.length===0){console.log("No children in the intersected mesh.");return}let g=0;for(;g{l(u)},h=u=>{const p=new Date().getTime(),m=p-o;m<300&&m>0&&l(u),o=p};return J.useEffect(()=>{const u=s.domElement;return u.addEventListener("dblclick",c),u.addEventListener("touchstart",h),()=>{u.removeEventListener("dblclick",c),u.removeEventListener("touchstart",h)}},[r,a]),Sg(()=>{t.current&&t.current.update()}),V.jsx(y6,{ref:t,args:[r,s.domElement],target:n.middle,mouseButtons:{LEFT:Gn.PAN,MIDDLE:Gn.DOLLY,RIGHT:Gn.ROTATE},screenSpacePanning:!1,dampingFactor:1,maxPolarAngle:Math.PI/2})}const vE={type:"change"},j1={type:"start"},SR={type:"end"},jp=new no,ME=new gr,x6=Math.cos(70*h1.DEG2RAD),In=new O,Li=2*Math.PI,Qe={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},j_=1e-6;class v6 extends ZC{constructor(t,e=null){super(t,e),this.state=Qe.NONE,this.enabled=!0,this.target=new O,this.cursor=new O,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:Gn.ROTATE,MIDDLE:Gn.DOLLY,RIGHT:Gn.PAN},this.touches={ONE:ts.ROTATE,TWO:ts.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new O,this._lastQuaternion=new Cn,this._lastTargetPosition=new O,this._quat=new Cn().setFromUnitVectors(t.up,new O(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new sf,this._sphericalDelta=new sf,this._scale=1,this._panOffset=new O,this._rotateStart=new xt,this._rotateEnd=new xt,this._rotateDelta=new xt,this._panStart=new xt,this._panEnd=new xt,this._panDelta=new xt,this._dollyStart=new xt,this._dollyEnd=new xt,this._dollyDelta=new xt,this._dollyDirection=new O,this._mouse=new xt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=b6.bind(this),this._onPointerDown=M6.bind(this),this._onPointerUp=w6.bind(this),this._onContextMenu=P6.bind(this),this._onMouseWheel=A6.bind(this),this._onKeyDown=T6.bind(this),this._onTouchStart=C6.bind(this),this._onTouchMove=R6.bind(this),this._onMouseDown=S6.bind(this),this._onMouseMove=E6.bind(this),this._interceptControlDown=I6.bind(this),this._interceptControlUp=L6.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(vE),this.update(),this.state=Qe.NONE}update(t=null){const e=this.object.position;In.copy(e).sub(this.target),In.applyQuaternion(this._quat),this._spherical.setFromVector3(In),this.autoRotate&&this.state===Qe.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let i=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(i)&&isFinite(s)&&(i<-Math.PI?i+=Li:i>Math.PI&&(i-=Li),s<-Math.PI?s+=Li:s>Math.PI&&(s-=Li),i<=s?this._spherical.theta=Math.max(i,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+s)/2?Math.max(i,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(In.setFromSpherical(this._spherical),In.applyQuaternion(this._quatInverse),e.copy(this.target).add(In),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=In.length();a=this._clampDistance(o*this._scale);const l=o-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),r=!!l}else if(this.object.isOrthographicCamera){const o=new O(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=l!==this.object.zoom;const c=new O(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(o),this.object.updateMatrixWorld(),a=In.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(jp.origin.copy(this.object.position),jp.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(jp.direction))j_||8*(1-this._lastQuaternion.dot(this.object.quaternion))>j_||this._lastTargetPosition.distanceToSquared(this.target)>j_?(this.dispatchEvent(vE),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Li/60*this.autoRotateSpeed*t:Li/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){In.setFromMatrixColumn(e,0),In.multiplyScalar(-t),this._panOffset.add(In)}_panUp(t,e){this.screenSpacePanning===!0?In.setFromMatrixColumn(e,1):(In.setFromMatrixColumn(e,0),In.crossVectors(this.object.up,In)),In.multiplyScalar(t),this._panOffset.add(In)}_pan(t,e){const i=this.domElement;if(this.object.isPerspectiveCamera){const s=this.object.position;In.copy(s).sub(this.target);let r=In.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/i.clientHeight,this.object.matrix),this._panUp(2*e*r/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),s=t-i.left,r=e-i.top,a=i.width,o=i.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Li*this._rotateDelta.x/e.clientHeight),this._rotateUp(Li*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Li*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Li*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Li*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Li*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(i,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(i,s)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(i*i+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),r=.5*(t.pageY+i.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Li*this._rotateDelta.x/e.clientHeight),this._rotateUp(Li*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(i,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(i*i+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e{const{camera:e,gl:i,scene:s}=mr(),r=J.useRef(new bg),a=J.useRef(new xt),o=J.useRef();J.useEffect(()=>(o.current=new v6(e,i.domElement),o.current.target=n,o.current.mouseButtons={MIDDLE:Gn.DOLLY,RIGHT:Gn.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,r.current.setFromCamera(a.current,e);const u=r.current.intersectObjects(s.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(x=>[...x,{point:m,normal:g}])}};return J.useEffect(()=>(i.domElement.addEventListener("pointerdown",l),()=>{i.domElement.removeEventListener("pointerdown",l)}),[i]),Sg(()=>{o.current&&o.current.update()}),null};function N6({geometries:n}){return V.jsx(V.Fragment,{children:n.map((t,e)=>V.jsx("mesh",{geometry:t,material:new ph({color:"red",transparent:!1})},e))})}function O6({meshes:n}){return V.jsx(V.Fragment,{children:n.map((t,e)=>V.jsx("mesh",{geometry:t.geometry,material:new ph({color:"#2b2c40",transparent:!1})},e))})}function ER(n,t=!1){const e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),r={},a={},o=n[0].morphTargetsRelative,l=new ve;let c=0;for(let h=0;h{const e=J.useRef();return J.useEffect(()=>{const i=document.createElement("canvas"),s=i.getContext("2d"),r=7;i.width=128*r,i.height=128,s.font="55px Arial",s.fillStyle="rgba(0, 0, 0, 0.3)",s.fillRect(0,0,i.width,i.height);const a=n.split(` +`);s.font="55px Arial",s.fillStyle="white",a.forEach((c,h)=>{s.fillText(c,10,60+h*60)});const o=new dC(i),l=new sg({map:o,depthTest:!1});e.current.material=l,e.current.position.copy(t),e.current.scale.set(r,1,1),e.current.renderOrder=999},[n,t]),V.jsx("sprite",{ref:e})},U6=({pvSystems:n})=>V.jsx(V.Fragment,{children:n.map(t=>V.jsx(z6,{geometry:t}))});function k6({setPVSystems:n,setSelectedPVSystem:t,pvPoints:e,setPVPoints:i,simulationMeshes:s}){const r=e.map(C=>C.point);if(e.length<3)return;const a=new ve,o=AR(e),l=[],c=[],h=.1;for(const{a:C,b:L,c:P}of o){const E=W=>({x:W.point.x+W.normal.x*h,y:W.point.y+W.normal.y*h,z:W.point.z+W.normal.z*h}),D=E(C),z=E(L),G=E(P);l.push({a:C.point,b:L.point,c:P.point}),c.push(D.x,D.y,D.z,z.x,z.y,z.z,G.x,G.y,G.z)}a.setAttribute("position",new re(c,3)),a.name="pvSystem";let u=[];const p=.8;l.forEach(C=>{u=u.concat(pu(C,p))});const m=[];s.forEach(C=>{const L=C.geometry.clone();L.applyMatrix4(C.matrixWorld),m.push(L)});const g=ER(m,!0),x=10,y=V6(g,r,x),_=[],b=[],S=[];u.forEach(C=>{_.push(C.a.x,C.a.y,C.a.z),_.push(C.b.x,C.b.y,C.b.z),_.push(C.c.x,C.c.y,C.c.z)});for(let C=0;C<_.length;C+=3){const L=new O(_[C],_[C+1],_[C+2]),P=G6(L,y,x);if(P){const E=W6(L,P),D=j6(E,P),z=X6(E,P);b.push(D.r,D.g,D.b),S.push(z)}else b.push(1,1,1),S.push(-1)}const w=H6(l),R=q6(_,S),T=w*R;a.annualYield=T,a.area=w,n(C=>[...C,a]),i([]),t([a])}const z6=({geometry:n})=>{const t=J.useRef(),e=B6(n.attributes.position.array);return Sg(({camera:i})=>{t.current&&t.current.quaternion.copy(i.quaternion)}),V.jsxs(V.Fragment,{children:[V.jsx("mesh",{geometry:n,material:new dh({color:"#2b2c40",transparent:!0,opacity:.5,metalness:1,side:fi})}),V.jsx(F6,{text:`Jahresertrag: ${Math.round(n.annualYield).toLocaleString("de")} kWh pro Jahr +Fläche: ${n.area.toPrecision(3)}m²`,position:e})]})},B6=n=>{const t=n.length/3,e=n.reduce((i,s,r)=>(i[r%3]+=s,i),[0,0,0]);return new O(e[0]/t,e[1]/t,e[2]/t)};function pu(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),X1(n){t+=X1(e)}),t}function X1(n){const{a:t,b:e,c:i}=n,s=new O().subVectors(e,t),r=new O().subVectors(i,t);return .5*new O().crossVectors(s,r).length()}function G6(n,t,e){let i=null,s=1/0;return t.forEach(r=>{const[a,o,l]=r.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 (${s})`),i}function V6(n,t,e){const i=[];if(!n.isBufferGeometry)return;const s=n.attributes.position.array,r=n.attributes.color?n.attributes.color.array:null,a=n.attributes.intensities?n.attributes.intensities.array:null;for(let o=0;o{const S=Math.min(b.distanceTo(l),b.distanceTo(c),b.distanceTo(h));S<_&&(_=S)}),_n[(u+n.length)%n.length],e=Ms(t(1).point,t(0).point),i=Ms(t(2).point,t(0).point),s=new O().crossVectors(e,i);let r=0,a=0;const o=(u,p,m)=>{const g=$6(Ms(p.point,u.point),Ms(p.point,m.point),s);return g>0?a+=1:r+=1,{left:u,vertex:p,right:m,det:g}},l=n.map((u,p)=>o(t(p-1),u,t(p+1)));if(au.det<0).map(u=>u.vertex);let h=!1;for(let u of l){const p=c.filter(m=>m!=u.left&&m!=u.vertex&&m!=u.right).filter(m=>Z6(m.point,u.left.point,u.vertex.point,u.right.point));u.isEar=u.det>0&&p.length==0,u.isEar&&(h=!0)}h||(console.warn("No ear found in ear clipping!"),l[0].isEar=!0);for(let u of l.filter(p=>p.isEar)){const p=l.filter(m=>m!=u).map(m=>m.vertex);return[{a:u.left,b:u.vertex,c:u.right}].concat(AR(p))}}function $6(n,t,e){const i=new Te;return i.set(n.x,t.x,e.x,n.y,t.y,e.y,n.z,t.z,e.z),i.determinant()}function Ms(n,t){return new O().subVectors(n,t)}function Xp(n,t){return new O().crossVectors(n,t)}function Z6(n,t,e,i){const s=Xp(Ms(t,e),Ms(e,i)),r=Xp(s,Ms(t,e)),a=Xp(s,Ms(e,i)),o=Xp(s,Ms(i,t)),l=Math.sign(r.dot(Ms(t,n))),c=Math.sign(a.dot(Ms(e,n))),h=Math.sign(o.dot(Ms(i,n)));return l==c&&c==h}const K6=({meshes:n})=>V.jsx(V.Fragment,{children:n.map((t,e)=>V.jsx("mesh",{geometry:t.geometry,children:V.jsx("meshLambertMaterial",{vertexColors:!0,side:fi})},e))}),SE=({geometries:n})=>V.jsx(V.Fragment,{children:n.map((t,e)=>V.jsx("mesh",{geometry:t,children:V.jsx("meshLambertMaterial",{vertexColors:!1,color:11245952,side:fi})},e))}),EE=["#27AD6B","#2DBE76","#33CC80"],AE=({geometries:n})=>{const t=J.useMemo(()=>n.map(()=>EE[Math.floor(Math.random()*EE.length)]),[n]);return V.jsx(V.Fragment,{children:n.map((e,i)=>V.jsx("mesh",{geometry:e,children:V.jsx("meshLambertMaterial",{vertexColors:!1,color:t[i],side:fi})},i))})};function J6({buttonLabel:n,onClick:t,hoverText:e,className:i}){return V.jsx(Sf,{label:e,children:V.jsx(yr,{onClick:t,className:i,children:n})})}function Q6({label:n}){return V.jsx(Sf,{label:n,children:V.jsx(hI,{as:"InfoOutlineIcon",margin:"5px"})})}const t8=({sliderProps:n,label:t,hoverHelpLabel:e,sliderValue:i,setSliderValue:s})=>{const[r,a]=z0.useState(!1);return V.jsxs(V.Fragment,{children:[t,e&&V.jsx(Q6,{label:e}),V.jsxs(QT,{id:"slider",defaultValue:i,min:n.min,max:n.max,colorScheme:"teal",onChange:s,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[V.jsx(e2,{children:V.jsx(n2,{})}),V.jsx(Sf,{hasArrow:!0,bg:"teal.500",color:"white",placement:"top",isOpen:r,label:`${i}`,children:V.jsx(t2,{})})]})]})};/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const AR="161",hv=0,I6=1,L6=2,vE=1,ME=100,bE=204,wE=205,SE=3,D6=0,TR=300,EE=1e3,jp=1001,AE=1002,TE=1003,N6=1006,O6=1008,F6=1009,U6=1014,k6=1015,z6=1020,B6=1023,j_=1026,CE=1027,H6=3e3,X_=3001,G6=0,Pm="",Hs="srgb",X1="srgb-linear",V6="display-p3",CR="display-p3-linear",uv="linear",RE="srgb",PE="rec709",IE="p3",ac=7680,LE=519,W6=515,DE=35044,Xp=2e3,NE=2001;class Eg{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 s=this._listeners[t];if(s!==void 0){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const i=this._listeners[t.type];if(i!==void 0){t.target=this;const s=i.slice(0);for(let r=0,a=s.length;r>8&255]+ci[n>>16&255]+ci[n>>24&255]+"-"+ci[t&255]+ci[t>>8&255]+"-"+ci[t>>16&15|64]+ci[t>>24&255]+"-"+ci[e&63|128]+ci[e>>8&255]+"-"+ci[e>>16&255]+ci[e>>24&255]+ci[i&255]+ci[i>>8&255]+ci[i>>16&255]+ci[i>>24&255]).toLowerCase()}function Fi(n,t,e){return Math.max(t,Math.min(e,n))}function j6(n,t){return(n%t+t)%t}function q_(n,t,e){return(1-e)*n+e*t}function iu(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 Li(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 Ei{constructor(t=0,e=0){Ei.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,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=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(Fi(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),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*s+t.x,this.y=r*s+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 ao{constructor(t,e,i,s,r,a,o,l,c){ao.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,a,o,l,c)}set(t,e,i,s,r,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,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,s=e.elements,r=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],x=s[0],y=s[3],_=s[6],b=s[1],S=s[4],w=s[7],R=s[2],T=s[5],C=s[8];return r[0]=a*x+o*b+l*R,r[3]=a*y+o*S+l*T,r[6]=a*_+o*w+l*C,r[1]=c*x+h*b+u*R,r[4]=c*y+h*S+u*T,r[7]=c*_+h*w+u*C,r[2]=p*x+m*b+g*R,r[5]=p*y+m*S+g*T,r[8]=p*_+m*w+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],s=t[2],r=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*r*h+i*o*l+s*r*c-s*a*l}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=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*r,m=c*r-a*l,g=e*u+i*p+s*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/g;return t[0]=u*x,t[1]=(s*c-h*i)*x,t[2]=(o*i-s*a)*x,t[3]=p*x,t[4]=(h*e-s*l)*x,t[5]=(s*r-o*e)*x,t[6]=m*x,t[7]=(i*l-c*e)*x,t[8]=(a*e-i*r)*x,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,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*a+c*o)+a+t,-s*c,s*l,-s*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Y_.makeScale(t,e)),this}rotate(t){return this.premultiply(Y_.makeRotation(-t)),this}translate(t,e){return this.premultiply(Y_.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 s=0;s<9;s++)if(e[s]!==i[s])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 Y_=new ao;function X6(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function OE(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const FE={};function Im(n){n in FE||(FE[n]=!0,console.warn(n))}const UE=new ao().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),kE=new ao().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),qp={[X1]:{transfer:uv,primaries:PE,toReference:n=>n,fromReference:n=>n},[Hs]:{transfer:RE,primaries:PE,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[CR]:{transfer:uv,primaries:IE,toReference:n=>n.applyMatrix3(kE),fromReference:n=>n.applyMatrix3(UE)},[V6]:{transfer:RE,primaries:IE,toReference:n=>n.convertSRGBToLinear().applyMatrix3(kE),fromReference:n=>n.applyMatrix3(UE).convertLinearToSRGB()}},q6=new Set([X1,CR]),Fs={enabled:!0,_workingColorSpace:X1,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!q6.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,s=qp[e].fromReference;return s(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===Pm?uv:qp[n].transfer}};function kc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function $_(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let oc;class Y6{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{oc===void 0&&(oc=OE("canvas")),oc.width=t.width,oc.height=t.height;const i=oc.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=oc}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=OE("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const s=i.getImageData(0,0,t.width,t.height),r=s.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!==TR)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 AE: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 AE: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 Im("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Hs?X_:H6}set encoding(t){Im("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===X_?Hs:Pm}}Va.DEFAULT_IMAGE=null;Va.DEFAULT_MAPPING=TR;Va.DEFAULT_ANISOTROPY=1;class kf{constructor(t=0,e=0,i=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=s}static slerpFlat(t,e,i,s,r,a,o){let l=i[s+0],c=i[s+1],h=i[s+2],u=i[s+3];const p=r[a+0],m=r[a+1],g=r[a+2],x=r[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]=x;return}if(u!==x||l!==p||c!==m||h!==g){let y=1-o;const _=l*p+c*m+h*g+u*x,b=_>=0?1:-1,S=1-_*_;if(S>Number.EPSILON){const R=Math.sqrt(S),T=Math.atan2(R,_*b);y=Math.sin(y*T)/R,o=Math.sin(o*T)/R}const w=o*b;if(l=l*y+p*w,c=c*y+m*w,h=h*y+g*w,u=u*y+x*w,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,s,r,a){const o=i[s],l=i[s+1],c=i[s+2],h=i[s+3],u=r[a],p=r[a+1],m=r[a+2],g=r[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,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(s/2),u=o(r/2),p=l(i/2),m=l(s/2),g=l(r/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,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],s=e[4],r=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=(r-c)*m,this._z=(a-s)*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=(s+a)/m,this._z=(r+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-i-u);this._w=(r-c)/m,this._x=(s+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+u-i-o);this._w=(a-s)/m,this._x=(r+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(Fi(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const s=Math.min(1,e/i);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 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,s=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+s*c-r*l,this._y=s*h+a*l+r*o-i*c,this._z=r*h+a*c+i*l-s*o,this._w=a*h-i*o-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,s=this._y,r=this._z,a=this._w;let o=a*t._w+i*t._x+s*t._y+r*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=s,this._z=r,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*s+e*this._y,this._z=m*r+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=s*u+this._y*p,this._z=r*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),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(s),i*Math.sin(r),i*Math.cos(r),e*Math.sin(s))}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(zE.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(zE.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,s=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*s-o*i),h=2*(o*e-r*s),u=2*(r*i-a*e);return this.x=e+l*c+a*u-o*h,this.y=i+l*h+o*c-r*u,this.z=s+l*u+r*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,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=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,s=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=s*l-r*o,this.y=r*a-i*l,this.z=i*o-s*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 K_.copy(this).projectOnVector(t),this.sub(K_)}reflect(t){return this.sub(K_.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(Fi(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){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(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,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 K_=new Pt,zE=new kf;class zf{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,Us),Us.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(su),$p.subVectors(this.max,su),lc.subVectors(t.a,su),cc.subVectors(t.b,su),hc.subVectors(t.c,su),La.subVectors(cc,lc),Da.subVectors(hc,cc),Do.subVectors(lc,hc);let e=[0,-La.z,La.y,0,-Da.z,Da.y,0,-Do.z,Do.y,La.z,0,-La.x,Da.z,0,-Da.x,Do.z,0,-Do.x,-La.y,La.x,0,-Da.y,Da.x,0,-Do.y,Do.x,0];return!J_(e,lc,cc,hc,$p)||(e=[1,0,0,0,1,0,0,0,1],!J_(e,lc,cc,hc,$p))?!1:(Zp.crossVectors(La,Da),e=[Zp.x,Zp.y,Zp.z],J_(e,lc,cc,hc,$p))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Us).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Us).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:(Wr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Wr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Wr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Wr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Wr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Wr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Wr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Wr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Wr),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 Wr=[new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt],Us=new Pt,Yp=new zf,lc=new Pt,cc=new Pt,hc=new Pt,La=new Pt,Da=new Pt,Do=new Pt,su=new Pt,$p=new Pt,Zp=new Pt,No=new Pt;function J_(n,t,e,i,s){for(let r=0,a=n.length-3;r<=a;r+=3){No.fromArray(n,r);const o=s.x*Math.abs(No.x)+s.y*Math.abs(No.y)+s.z*Math.abs(No.z),l=t.dot(No),c=e.dot(No),h=i.dot(No);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const J6=new zf,ru=new Pt,Q_=new Pt;class RR{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):J6.setFromPoints(t).getCenter(i);let s=0;for(let r=0,a=t.length;rthis.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;ru.subVectors(t,this.center);const e=ru.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),s=(i-this.radius)*.5;this.center.addScaledVector(ru,s/i),this.radius+=s}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):(Q_.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(ru.copy(t.center).add(Q_)),this.expandByPoint(ru.copy(t.center).sub(Q_))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const jr=new Pt,tx=new Pt,Kp=new Pt,Na=new Pt,ex=new Pt,Jp=new Pt,nx=new Pt;class Q6{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,jr)),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=jr.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(jr.copy(this.origin).addScaledVector(this.direction,e),jr.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){tx.copy(t).add(e).multiplyScalar(.5),Kp.copy(e).sub(t).normalize(),Na.copy(this.origin).sub(tx);const r=t.distanceTo(e)*.5,a=-this.direction.dot(Kp),o=Na.dot(this.direction),l=-Na.dot(Kp),c=Na.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=r*h,u>=0)if(p>=-g)if(p<=g){const x=1/h;u*=x,p*=x,m=u*(u+a*p+2*o)+p*(a*u+p+2*l)+c}else p=r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p=-r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p<=-g?(u=Math.max(0,-(-a*r+o)),p=u>0?-r:Math.min(Math.max(-r,-l),r),m=-u*u+p*(p+2*l)+c):p<=g?(u=0,p=Math.min(Math.max(-r,-l),r),m=p*(p+2*l)+c):(u=Math.max(0,-(a*r+o)),p=u>0?r:Math.min(Math.max(-r,-l),r),m=-u*u+p*(p+2*l)+c);else p=a>0?-r:r,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),s&&s.copy(tx).addScaledVector(Kp,p),m}intersectSphere(t,e){jr.subVectors(t.center,this.origin);const i=jr.dot(this.direction),s=jr.dot(jr)-i*i,r=t.radius*t.radius;if(s>r)return null;const a=Math.sqrt(r-s),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,s,r,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,s=(t.max.x-p.x)*c):(i=(t.max.x-p.x)*c,s=(t.min.x-p.x)*c),h>=0?(r=(t.min.y-p.y)*h,a=(t.max.y-p.y)*h):(r=(t.max.y-p.y)*h,a=(t.min.y-p.y)*h),i>a||r>s||((r>i||isNaN(i))&&(i=r),(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>s)||((o>i||i!==i)&&(i=o),(l=0?i:s,e)}intersectsBox(t){return this.intersectBox(t,jr)!==null}intersectTriangle(t,e,i,s,r){ex.subVectors(e,t),Jp.subVectors(i,t),nx.crossVectors(ex,Jp);let a=this.direction.dot(nx),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Na.subVectors(this.origin,t);const l=o*this.direction.dot(Jp.crossVectors(Na,Jp));if(l<0)return null;const c=o*this.direction.dot(ex.cross(Na));if(c<0||l+c>a)return null;const h=-o*Na.dot(nx);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Vs{constructor(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y){Vs.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,s,r,a,o,l,c,h,u,p,m,g,x,y)}set(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y){const _=this.elements;return _[0]=t,_[4]=e,_[8]=i,_[12]=s,_[1]=r,_[5]=a,_[9]=o,_[13]=l,_[2]=c,_[6]=h,_[10]=u,_[14]=p,_[3]=m,_[7]=g,_[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 Vs().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,s=1/uc.setFromMatrixColumn(t,0).length(),r=1/uc.setFromMatrixColumn(t,1).length(),a=1/uc.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*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,s=t.y,r=t.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(s),c=Math.sin(s),h=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const p=a*h,m=a*u,g=o*h,x=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=m+g*c,e[5]=p-x*c,e[9]=-o*l,e[2]=x-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,x=c*u;e[0]=p+x*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]=x+p*o,e[10]=a*l}else if(t.order==="ZXY"){const p=l*h,m=l*u,g=c*h,x=c*u;e[0]=p-x*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=x-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,x=o*u;e[0]=l*h,e[4]=g*c-m,e[8]=p*c+x,e[1]=l*u,e[5]=x*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,x=o*c;e[0]=l*h,e[4]=x-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-x*u}else if(t.order==="XZY"){const p=a*l,m=a*c,g=o*l,x=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=p*u+x,e[5]=a*h,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*h,e[10]=x*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(t8,t,e8)}lookAt(t,e,i){const s=this.elements;return Zi.subVectors(t,e),Zi.lengthSq()===0&&(Zi.z=1),Zi.normalize(),Oa.crossVectors(i,Zi),Oa.lengthSq()===0&&(Math.abs(i.z)===1?Zi.x+=1e-4:Zi.z+=1e-4,Zi.normalize(),Oa.crossVectors(i,Zi)),Oa.normalize(),Qp.crossVectors(Zi,Oa),s[0]=Oa.x,s[4]=Qp.x,s[8]=Zi.x,s[1]=Oa.y,s[5]=Qp.y,s[9]=Zi.y,s[2]=Oa.z,s[6]=Qp.z,s[10]=Zi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=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],x=i[6],y=i[10],_=i[14],b=i[3],S=i[7],w=i[11],R=i[15],T=s[0],C=s[4],L=s[8],P=s[12],E=s[1],D=s[5],z=s[9],G=s[13],W=s[2],Q=s[6],Y=s[10],ot=s[14],H=s[3],Z=s[7],it=s[11],$=s[15];return r[0]=a*T+o*E+l*W+c*H,r[4]=a*C+o*D+l*Q+c*Z,r[8]=a*L+o*z+l*Y+c*it,r[12]=a*P+o*G+l*ot+c*$,r[1]=h*T+u*E+p*W+m*H,r[5]=h*C+u*D+p*Q+m*Z,r[9]=h*L+u*z+p*Y+m*it,r[13]=h*P+u*G+p*ot+m*$,r[2]=g*T+x*E+y*W+_*H,r[6]=g*C+x*D+y*Q+_*Z,r[10]=g*L+x*z+y*Y+_*it,r[14]=g*P+x*G+y*ot+_*$,r[3]=b*T+S*E+w*W+R*H,r[7]=b*C+S*D+w*Q+R*Z,r[11]=b*L+S*z+w*Y+R*it,r[15]=b*P+S*G+w*ot+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],s=t[8],r=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],x=t[7],y=t[11],_=t[15];return g*(+r*l*u-s*c*u-r*o*p+i*c*p+s*o*m-i*l*m)+x*(+e*l*m-e*c*p+r*a*p-s*a*m+s*c*h-r*l*h)+y*(+e*c*u-e*o*m-r*a*u+i*a*m+r*o*h-i*c*h)+_*(-s*o*h-e*l*u+e*o*p+s*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 s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=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],x=t[13],y=t[14],_=t[15],b=u*y*c-x*p*c+x*l*m-o*y*m-u*l*_+o*p*_,S=g*p*c-h*y*c-g*l*m+a*y*m+h*l*_-a*p*_,w=h*x*c-g*u*c+g*o*m-a*x*m-h*o*_+a*u*_,R=g*u*l-h*x*l-g*o*p+a*x*p+h*o*y-a*u*y,T=e*b+i*S+s*w+r*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]=b*C,t[1]=(x*p*r-u*y*r-x*s*m+i*y*m+u*s*_-i*p*_)*C,t[2]=(o*y*r-x*l*r+x*s*c-i*y*c-o*s*_+i*l*_)*C,t[3]=(u*l*r-o*p*r-u*s*c+i*p*c+o*s*m-i*l*m)*C,t[4]=S*C,t[5]=(h*y*r-g*p*r+g*s*m-e*y*m-h*s*_+e*p*_)*C,t[6]=(g*l*r-a*y*r-g*s*c+e*y*c+a*s*_-e*l*_)*C,t[7]=(a*p*r-h*l*r+h*s*c-e*p*c-a*s*m+e*l*m)*C,t[8]=w*C,t[9]=(g*u*r-h*x*r-g*i*m+e*x*m+h*i*_-e*u*_)*C,t[10]=(a*x*r-g*o*r+g*i*c-e*x*c-a*i*_+e*o*_)*C,t[11]=(h*o*r-a*u*r-h*i*c+e*u*c+a*i*m-e*o*m)*C,t[12]=R*C,t[13]=(h*x*s-g*u*s+g*i*p-e*x*p-h*i*y+e*u*y)*C,t[14]=(g*o*s-a*x*s-g*i*l+e*x*l+a*i*y-e*o*y)*C,t[15]=(a*u*s-h*o*s+h*i*l-e*u*l-a*i*p+e*o*p)*C,this}scale(t){const e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){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],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}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),s=Math.sin(e),r=1-i,a=t.x,o=t.y,l=t.z,c=r*a,h=r*o;return this.set(c*a+i,c*o-s*l,c*l+s*o,0,c*o+s*l,h*o+i,h*l-s*a,0,c*l-s*o,h*l+s*a,r*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,s,r,a){return this.set(1,i,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){const s=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,h=a+a,u=o+o,p=r*c,m=r*h,g=r*u,x=a*h,y=a*u,_=o*u,b=l*c,S=l*h,w=l*u,R=i.x,T=i.y,C=i.z;return s[0]=(1-(x+_))*R,s[1]=(m+w)*R,s[2]=(g-S)*R,s[3]=0,s[4]=(m-w)*T,s[5]=(1-(p+_))*T,s[6]=(y+b)*T,s[7]=0,s[8]=(g+S)*C,s[9]=(y-b)*C,s[10]=(1-(p+x))*C,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){const s=this.elements;let r=uc.set(s[0],s[1],s[2]).length();const a=uc.set(s[4],s[5],s[6]).length(),o=uc.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],ks.copy(this);const c=1/r,h=1/a,u=1/o;return ks.elements[0]*=c,ks.elements[1]*=c,ks.elements[2]*=c,ks.elements[4]*=h,ks.elements[5]*=h,ks.elements[6]*=h,ks.elements[8]*=u,ks.elements[9]*=u,ks.elements[10]*=u,e.setFromRotationMatrix(ks),i.x=r,i.y=a,i.z=o,this}makePerspective(t,e,i,s,r,a,o=Xp){const l=this.elements,c=2*r/(e-t),h=2*r/(i-s),u=(e+t)/(e-t),p=(i+s)/(i-s);let m,g;if(o===Xp)m=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===NE)m=-a/(a-r),g=-a*r/(a-r);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,s,r,a,o=Xp){const l=this.elements,c=1/(e-t),h=1/(i-s),u=1/(a-r),p=(e+t)*c,m=(i+s)*h;let g,x;if(o===Xp)g=(a+r)*u,x=-2*u;else if(o===NE)g=r*u,x=-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]=x,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 s=0;s<16;s++)if(e[s]!==i[s])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 uc=new Pt,ks=new Vs,t8=new Pt(0,0,0),e8=new Pt(1,1,1),Oa=new Pt,Qp=new Pt,Zi=new Pt,BE=new Vs,HE=new kf;class Ag{constructor(t=0,e=0,i=0,s=Ag.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const s=t.elements,r=s[0],a=s[4],o=s[8],l=s[1],c=s[5],h=s[9],u=s[2],p=s[6],m=s[10];switch(e){case"XYZ":this._y=Math.asin(Fi(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Fi(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Fi(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,r));break;case"ZYX":this._y=Math.asin(-Fi(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Fi(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-Fi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,r)):(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 BE.makeRotationFromQuaternion(t),this.setFromRotationMatrix(BE,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return HE.setFromEuler(this),this.setFromQuaternion(HE,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}}Ag.DEFAULT_ORDER="XYZ";class n8{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&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.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()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(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){s.children=[];for(let o=0;o0){s.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=s,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?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){zs.subVectors(s,e),qr.subVectors(i,e),ix.subVectors(t,e);const a=zs.dot(zs),o=zs.dot(qr),l=zs.dot(ix),c=qr.dot(qr),h=qr.dot(ix),u=a*c-o*o;if(u===0)return r.set(0,0,0),null;const p=1/u,m=(c*l-o*h)*p,g=(a*h-o*l)*p;return r.set(1-m-g,g,m)}static containsPoint(t,e,i,s){return this.getBarycoord(t,e,i,s,Yr)===null?!1:Yr.x>=0&&Yr.y>=0&&Yr.x+Yr.y<=1}static getInterpolation(t,e,i,s,r,a,o,l){return this.getBarycoord(t,e,i,s,Yr)===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(r,Yr.x),l.addScaledVector(a,Yr.y),l.addScaledVector(o,Yr.z),l)}static isFrontFacing(t,e,i,s){return zs.subVectors(i,e),qr.subVectors(t,e),zs.cross(qr).dot(s)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return zs.subVectors(this.c,this.b),qr.subVectors(this.a,this.b),zs.cross(qr).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return _r.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return _r.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return _r.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return _r.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return _r.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,s=this.b,r=this.c;let a,o;dc.subVectors(s,i),pc.subVectors(r,i),sx.subVectors(t,i);const l=dc.dot(sx),c=pc.dot(sx);if(l<=0&&c<=0)return e.copy(i);rx.subVectors(t,s);const h=dc.dot(rx),u=pc.dot(rx);if(h>=0&&u<=h)return e.copy(s);const p=l*u-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(i).addScaledVector(dc,a);ax.subVectors(t,r);const m=dc.dot(ax),g=pc.dot(ax);if(g>=0&&m<=g)return e.copy(r);const x=m*c-l*g;if(x<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(i).addScaledVector(pc,o);const y=h*g-m*u;if(y<=0&&u-h>=0&&m-g>=0)return XE.subVectors(r,s),o=(u-h)/(u-h+(m-g)),e.copy(s).addScaledVector(XE,o);const _=1/(y+x+p);return a=x*_,o=p*_,e.copy(i).addScaledVector(dc,a).addScaledVector(pc,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const PR={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},Fa={h:0,s:0,l:0},em={h:0,s:0,l:0};function ox(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 nh{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 s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Hs){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Fs.toWorkingColorSpace(this,e),this}setRGB(t,e,i,s=Fs.workingColorSpace){return this.r=t,this.g=e,this.b=i,Fs.toWorkingColorSpace(this,s),this}setHSL(t,e,i,s=Fs.workingColorSpace){if(t=j6(t,1),e=Fi(e,0,1),i=Fi(i,0,1),e===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,a=2*i-r;this.r=ox(a,r,t+1/3),this.g=ox(a,r,t),this.b=ox(a,r,t-1/3)}return Fs.toWorkingColorSpace(this,s),this}setStyle(t,e=Hs){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,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=Hs){const i=PR[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=kc(t.r),this.g=kc(t.g),this.b=kc(t.b),this}copyLinearToSRGB(t){return this.r=$_(t.r),this.g=$_(t.g),this.b=$_(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Hs){return Fs.fromWorkingColorSpace(hi.copy(this),t),Math.round(Fi(hi.r*255,0,255))*65536+Math.round(Fi(hi.g*255,0,255))*256+Math.round(Fi(hi.b*255,0,255))}getHexString(t=Hs){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Fs.workingColorSpace){Fs.fromWorkingColorSpace(hi.copy(this),e);const i=hi.r,s=hi.g,r=hi.b,a=Math.max(i,s,r),o=Math.min(i,s,r);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=(s-r)/u+(s0!=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 s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){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!==vE&&(i.blending=this.blending),this.side!==hv&&(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!==bE&&(i.blendSrc=this.blendSrc),this.blendDst!==wE&&(i.blendDst=this.blendDst),this.blendEquation!==ME&&(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!==SE&&(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!==ac&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ac&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ac&&(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 s(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=s(t.textures),a=s(t.images);r.length>0&&(i.textures=r),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 s=e.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=e[r].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 c8 extends IR{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new nh(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=D6,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 Tn=new Pt,nm=new Ei;class la{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=DE,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=k6,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Im("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 s=0,r=this.itemSize;s0&&(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 s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,p=c.length;u0&&(s[l]=h,r=!0)}r&&(t.data.morphAttributes=s,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 s=t.attributes;for(const c in s){const h=s[c];this.setAttribute(c,h.clone(e))}const r=t.morphAttributes;for(const c in r){const h=[],u=r[c];for(let p=0,m=u.length;p0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(qE.copy(r).invert(),Oo.copy(t.ray).applyMatrix4(qE),!(i.boundingBox!==null&&Oo.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,Oo)))}_computeIntersections(t,e,i){let s;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,p=r.groups,m=r.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,x=p.length;ge.far?null:{distance:c,point:cm.clone(),object:n}}function hm(n,t,e,i,s,r,a,o,l,c){n.getVertexPosition(o,gc),n.getVertexPosition(l,yc),n.getVertexPosition(c,_c);const h=p8(n,t,e,i,gc,yc,_c,lm);if(h){s&&(rm.fromBufferAttribute(s,o),am.fromBufferAttribute(s,l),om.fromBufferAttribute(s,c),h.uv=_r.getInterpolation(lm,gc,yc,_c,rm,am,om,new Ei)),r&&(rm.fromBufferAttribute(r,o),am.fromBufferAttribute(r,l),om.fromBufferAttribute(r,c),h.uv1=_r.getInterpolation(lm,gc,yc,_c,rm,am,om,new Ei),h.uv2=h.uv1),a&&($E.fromBufferAttribute(a,o),ZE.fromBufferAttribute(a,l),KE.fromBufferAttribute(a,c),h.normal=_r.getInterpolation(lm,gc,yc,_c,$E,ZE,KE,new Pt),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new Pt,materialIndex:0};_r.getNormal(gc,yc,_c,u.normal),h.face=u}return h}class m8 extends Va{constructor(t,e,i,s,r,a,o,l,c,h){if(h=h!==void 0?h:j_,h!==j_&&h!==CE)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===j_&&(i=U6),i===void 0&&h===CE&&(i=z6),super(null,s,r,a,o,l,h,i,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:TE,this.minFilter=l!==void 0?l:TE,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 g8=new m8(1,1);g8.compareFunction=W6;class y8 extends IR{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new nh(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 nh(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=G6,this.normalScale=new Ei(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:AR}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=AR);function JE(n,t=!1){const e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),r={},a={},o=n[0].morphTargetsRelative,l=new Bf;let c=0;for(let h=0;h_8(n,t,e)}function yh(n,t){return Kn(LR(n,t).get)}const{apply:_8,construct:O$,defineProperty:F$,get:U$,getOwnPropertyDescriptor:LR,getPrototypeOf:q1,has:k$,ownKeys:x8,set:z$,setPrototypeOf:B$}=Reflect,{iterator:Hf,species:H$,toStringTag:v8,for:G$}=Symbol,M8=Object,{create:Y1,defineProperty:b8,freeze:V$,is:W$}=M8,w8=Array,S8=w8.prototype,DR=S8[Hf],E8=Kn(DR),NR=ArrayBuffer,A8=NR.prototype;yh(A8,"byteLength");const tA=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;tA&&yh(tA.prototype,"byteLength");const OR=q1(Uint8Array);OR.from;const Ai=OR.prototype;Ai[Hf];Kn(Ai.keys);Kn(Ai.values);Kn(Ai.entries);Kn(Ai.set);Kn(Ai.reverse);Kn(Ai.fill);Kn(Ai.copyWithin);Kn(Ai.sort);Kn(Ai.slice);Kn(Ai.subarray);yh(Ai,"buffer");yh(Ai,"byteOffset");yh(Ai,"length");yh(Ai,v8);const T8=Uint8Array,FR=Uint16Array,$1=Uint32Array,C8=Float32Array,rf=q1([][Hf]()),UR=Kn(rf.next),R8=Kn(function*(){}().next),P8=q1(rf),I8=DataView.prototype,L8=Kn(I8.getUint16),Z1=WeakMap,kR=Z1.prototype,zR=Kn(kR.get),D8=Kn(kR.set),BR=new Z1,N8=Y1(null,{next:{value:function(){const t=zR(BR,this);return UR(t)}},[Hf]:{value:function(){return this}}});function O8(n){if(n[Hf]===DR&&rf.next===UR)return n;const t=Y1(N8);return D8(BR,t,E8(n)),t}const F8=new Z1,U8=Y1(P8,{next:{value:function(){const t=zR(F8,this);return R8(t)},writable:!0,configurable:!0}});for(const n of x8(rf))n!=="next"&&b8(U8,n,LR(rf,n));const HR=new NR(4),k8=new C8(HR),z8=new $1(HR),hr=new FR(512),ur=new T8(512);for(let n=0;n<256;++n){const t=n-127;t<-24?(hr[n]=0,hr[n|256]=32768,ur[n]=24,ur[n|256]=24):t<-14?(hr[n]=1024>>-t-14,hr[n|256]=1024>>-t-14|32768,ur[n]=-t-1,ur[n|256]=-t-1):t<=15?(hr[n]=t+15<<10,hr[n|256]=t+15<<10|32768,ur[n]=13,ur[n|256]=13):t<128?(hr[n]=31744,hr[n|256]=64512,ur[n]=24,ur[n|256]=24):(hr[n]=31744,hr[n|256]=64512,ur[n]=13,ur[n|256]=13)}const K1=new $1(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,K1[n]=t|e}for(let n=1024;n<2048;++n)K1[n]=939524096+(n-1024<<13);const _h=new $1(64);for(let n=1;n<31;++n)_h[n]=n<<23;_h[31]=1199570944;_h[32]=2147483648;for(let n=33;n<63;++n)_h[n]=2147483648+(n-32<<23);_h[63]=3347054592;const GR=new FR(64);for(let n=1;n<64;++n)n!==32&&(GR[n]=1024);function B8(n){const t=n>>10;return z8[0]=K1[GR[t]+(n&1023)]+_h[t],k8[0]}function VR(n,t,...e){return B8(L8(n,t,...O8(e)))}var J1={exports:{}};function WR(n,t,e){const i=e&&e.debug||!1;i&&console.log("[xml-utils] getting "+t+" in "+n);const s=typeof n=="object"?n.outer:n,r=s.slice(0,s.indexOf(">")+1),a=['"',"'"];for(let o=0;o/]`,r);if(i&&console.log("[xml-utils] start:",a),a===-1)return;const o=n.slice(a+t.length);let l=ux(o,"^[^<]*[ /]>",0);const c=l!==-1&&o[l-1]==="/";if(i&&console.log("[xml-utils] selfClosing:",c),c===!1)if(s){let m=0,g=1,x=0;for(;(l=ux(o,"[ /]"+t+">",m))!==-1;){const y=o.substring(m,l+1);if(g+=eA(y,"<"+t+`[ - >]`),x+=eA(y,""),x>=g)break;m=l}}else l=ux(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}}tM.exports=YR;tM.exports.default=YR;var X8=tM.exports;const q8=X8;function $R(n,t,e){const i=[],s=e&&e.debug||!1,r=e&&typeof e.nested=="boolean"?e.nested:!0;let a=e&&e.startIndex||0,o;for(;o=q8(n,t,{debug:s,startIndex:a});)r?a=o.start+1+t.length:a=o.end,i.push(o);return s&&console.log("findTagsByName found",i.length,"tags"),i}Q1.exports=$R;Q1.exports.default=$R;var Y8=Q1.exports;const $8=xf(Y8),Lu={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"},pr={};for(const n in Lu)Lu.hasOwnProperty(n)&&(pr[Lu[n]]=parseInt(n,10));const Z8=[pr.BitsPerSample,pr.ExtraSamples,pr.SampleFormat,pr.StripByteCounts,pr.StripOffsets,pr.StripRowCounts,pr.TileByteCounts,pr.TileOffsets,pr.SubIFDs],fx={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"},Ie={};for(const n in fx)fx.hasOwnProperty(n)&&(Ie[fx[n]]=parseInt(n,10));const Ji={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},K8={Unspecified:0,Assocalpha:1,Unassalpha:2},j$={Version:0,AddCompression:1},X$={None:0,Deflate:1,Zstandard:2},J8={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 Q8(n,t){const{width:e,height:i}=n,s=new Uint8Array(e*i*3);let r;for(let a=0,o=0;a>24,l=n[s+2]<<24>>24;let c=(a+16)/116,h=o/500+c,u=c-l/200,p,m,g;h=sH*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),c=rH*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),u=aH*(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[r]=Math.max(0,Math.min(1,p))*255,i[r+1]=Math.max(0,Math.min(1,m))*255,i[r+2]=Math.max(0,Math.min(1,g))*255}return i}const ZR=new Map;function oo(n,t){Array.isArray(n)||(n=[n]),n.forEach(e=>ZR.set(e,t))}async function lH(n){const t=ZR.get(n.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${n.Compression}`);const e=await t();return new e(n)}oo([void 0,1],()=>xl(()=>import("./raw-Dt1HMqYc.js"),__vite__mapDeps([0,1])).then(n=>n.default));oo(5,()=>xl(()=>import("./lzw-DpvbRwG5.js"),__vite__mapDeps([2,1])).then(n=>n.default));oo(6,()=>{throw new Error("old style JPEG compression is not supported.")});oo(7,()=>xl(()=>import("./jpeg-CdeCw_eT.js"),__vite__mapDeps([3,1])).then(n=>n.default));oo([8,32946],()=>xl(()=>import("./deflate-BY1gll4A.js"),__vite__mapDeps([4,1,5,6,7,8,9,10])).then(n=>n.default));oo(32773,()=>xl(()=>import("./packbits-DQnG8s9w.js"),__vite__mapDeps([11,1])).then(n=>n.default));oo(34887,()=>xl(()=>import("./lerc-DtKC9ro-.js"),__vite__mapDeps([12,5,6,1,7,8,9,10])).then(async n=>(await n.zstd.init(),n)).then(n=>n.default));oo(50001,()=>xl(()=>import("./webimage-BcnuJlio.js"),__vite__mapDeps([13,1])).then(n=>n.default));function Tg(n,t,e,i=1){return new(Object.getPrototypeOf(n)).constructor(t*e*i)}function cH(n,t,e,i,s){const r=t/i,a=e/s;return n.map(o=>{const l=Tg(o,i,s);for(let c=0;c{const l=Tg(o,i,s);for(let c=0;c>8-s-T&u;else if(T+s<=16)h[w]=o.getUint16(R)>>16-s-T&u;else if(T+s<=24){const C=o.getUint16(R)<<8|o.getUint8(R+2);h[w]=C>>24-s-T&u}else h[w]=o.getUint32(R)>>32-s-T&u}}}}return h.buffer}class _H{constructor(t,e,i,s,r,a){this.fileDirectory=t,this.geoKeys=e,this.dataView=i,this.littleEndian=s,this.tiles=r?{}: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(s,r){return VR(this,s,r)};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),s=this.getBitsPerSample(t);return dv(i,s,e)}async getTileOrStrip(t,e,i,s,r){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}],r))[0];let m;return c===null||!c[l]?(m=(async()=>{let g=await s.decode(this.fileDirectory,p);const x=this.getSampleFormat(),y=this.getBitsPerSample();return gH(x,y)&&(g=yH(g,x,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,s,r,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),x=Math.min(Math.ceil(t[2]/h),Math.ceil(p/h)),y=Math.max(Math.floor(t[1]/u),0),_=Math.min(Math.ceil(t[3]/u),Math.ceil(m/u)),b=t[2]-t[0];let S=this.getBytesPerPixel();const w=[],R=[];for(let L=0;L{const Y=Q.data,ot=new DataView(Y),H=this.getBlockHeight(Q.y),Z=Q.y*u,it=Q.x*h,$=Z+H,lt=(Q.x+1)*h,_t=R[z],q=Math.min(H,H-($-t[3]),m-Z),rt=Math.min(h,h-(lt-t[2]),p-it);for(let St=Math.max(0,t[1]-Z);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 b=0;b=g)return Promise.reject(new RangeError(`Invalid sample index '${e[b]}'.`));let x;if(i){const b=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,S=Math.max.apply(null,this.fileDirectory.BitsPerSample);x=dv(b,S,m*e.length),l&&x.fill(l)}else{x=[];for(let b=0;bc[2]||c[1]>c[3])throw new Error("Invalid subsets");const h=this.fileDirectory.PhotometricInterpretation;if(h===Ji.RGB){let _=[0,1,2];if(this.fileDirectory.ExtraSamples!==K8.Unspecified&&o){_=[];for(let b=0;bhx(r,"sample")===void 0):s=s.filter(r=>Number(hx(r,"sample"))===t);for(let r=0;r[o+s*y+r*_,u+l*y+c*_]),g=m.map(y=>y[0]),x=m.map(y=>y[1]);return[Math.min(...g),Math.min(...x),Math.max(...g),Math.max(...x)]}else{const s=this.getOrigin(),r=this.getResolution(),a=s[0],o=s[1],l=a+r[0]*i,c=o+r[1]*e;return[Math.min(a,l),Math.min(o,c),Math.max(a,l),Math.max(o,c)]}}}class xH{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,e){const i=this.getUint32(t,e),s=this.getUint32(t+4,e);let r;if(e){if(r=i+2**32*s,!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*i+s,!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}getInt64(t,e){let i=0;const s=(this._dataView.getUint8(t+(e?7:0))&128)>0;let r=!0;for(let a=0;a<8;a++){let o=this._dataView.getUint8(t+(e?a:7-a));s&&(r?o!==0&&(o=~(o-1)&255,r=!1):o=~o&255),i+=o*256**a}return s&&(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 VR(this._dataView,t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class vH{constructor(t,e,i,s){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=i,this._bigTiff=s}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 s;if(this._littleEndian){if(s=e+2**32*i,!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*e+i,!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}readInt64(t){let e=0;const i=(this._dataView.getUint8(t+(this._littleEndian?7:0))&128)>0;let s=!0;for(let r=0;r<8;r++){let a=this._dataView.getUint8(t+(this._littleEndian?r:7-r));i&&(s?a!==0&&(a=~(a-1)&255,s=!1):a=~a&255),e+=a*256**r}return i&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const nA=`\r + */const TR="161",hv=0,e8=1,n8=2,TE=1,CE=100,RE=204,PE=205,IE=3,i8=0,CR=300,LE=1e3,qp=1001,DE=1002,NE=1003,s8=1006,r8=1008,a8=1009,o8=1014,l8=1015,c8=1020,h8=1023,X_=1026,OE=1027,u8=3e3,q_=3001,f8=0,Pm="",Hs="srgb",q1="srgb-linear",d8="display-p3",RR="display-p3-linear",uv="linear",FE="srgb",UE="rec709",kE="p3",ac=7680,zE=519,p8=515,BE=35044,Yp=2e3,HE=2001;class Eg{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 s=this._listeners[t];if(s!==void 0){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const i=this._listeners[t.type];if(i!==void 0){t.target=this;const s=i.slice(0);for(let r=0,a=s.length;r>8&255]+ci[n>>16&255]+ci[n>>24&255]+"-"+ci[t&255]+ci[t>>8&255]+"-"+ci[t>>16&15|64]+ci[t>>24&255]+"-"+ci[e&63|128]+ci[e>>8&255]+"-"+ci[e>>16&255]+ci[e>>24&255]+ci[i&255]+ci[i>>8&255]+ci[i>>16&255]+ci[i>>24&255]).toLowerCase()}function Fi(n,t,e){return Math.max(t,Math.min(e,n))}function m8(n,t){return(n%t+t)%t}function Y_(n,t,e){return(1-e)*n+e*t}function iu(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 Di(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 Ei{constructor(t=0,e=0){Ei.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,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=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(Fi(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),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*s+t.x,this.y=r*s+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 ao{constructor(t,e,i,s,r,a,o,l,c){ao.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,s,r,a,o,l,c)}set(t,e,i,s,r,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,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,s=e.elements,r=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],x=s[0],y=s[3],_=s[6],b=s[1],S=s[4],w=s[7],R=s[2],T=s[5],C=s[8];return r[0]=a*x+o*b+l*R,r[3]=a*y+o*S+l*T,r[6]=a*_+o*w+l*C,r[1]=c*x+h*b+u*R,r[4]=c*y+h*S+u*T,r[7]=c*_+h*w+u*C,r[2]=p*x+m*b+g*R,r[5]=p*y+m*S+g*T,r[8]=p*_+m*w+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],s=t[2],r=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*r*h+i*o*l+s*r*c-s*a*l}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=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*r,m=c*r-a*l,g=e*u+i*p+s*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/g;return t[0]=u*x,t[1]=(s*c-h*i)*x,t[2]=(o*i-s*a)*x,t[3]=p*x,t[4]=(h*e-s*l)*x,t[5]=(s*r-o*e)*x,t[6]=m*x,t[7]=(i*l-c*e)*x,t[8]=(a*e-i*r)*x,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,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*a+c*o)+a+t,-s*c,s*l,-s*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply($_.makeScale(t,e)),this}rotate(t){return this.premultiply($_.makeRotation(-t)),this}translate(t,e){return this.premultiply($_.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 s=0;s<9;s++)if(e[s]!==i[s])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 $_=new ao;function g8(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function GE(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const VE={};function Im(n){n in VE||(VE[n]=!0,console.warn(n))}const WE=new ao().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),jE=new ao().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),$p={[q1]:{transfer:uv,primaries:UE,toReference:n=>n,fromReference:n=>n},[Hs]:{transfer:FE,primaries:UE,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[RR]:{transfer:uv,primaries:kE,toReference:n=>n.applyMatrix3(jE),fromReference:n=>n.applyMatrix3(WE)},[d8]:{transfer:FE,primaries:kE,toReference:n=>n.convertSRGBToLinear().applyMatrix3(jE),fromReference:n=>n.applyMatrix3(WE).convertLinearToSRGB()}},y8=new Set([q1,RR]),Fs={enabled:!0,_workingColorSpace:q1,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!y8.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=$p[t].toReference,s=$p[e].fromReference;return s(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 $p[n].primaries},getTransfer:function(n){return n===Pm?uv:$p[n].transfer}};function kc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Z_(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let oc;class _8{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{oc===void 0&&(oc=GE("canvas")),oc.width=t.width,oc.height=t.height;const i=oc.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=oc}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=GE("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const s=i.getImageData(0,0,t.width,t.height),r=s.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!==CR)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case LE:t.x=t.x-Math.floor(t.x);break;case qp:t.x=t.x<0?0:1;break;case DE: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 LE:t.y=t.y-Math.floor(t.y);break;case qp:t.y=t.y<0?0:1;break;case DE: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 Im("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Hs?q_:u8}set encoding(t){Im("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===q_?Hs:Pm}}Va.DEFAULT_IMAGE=null;Va.DEFAULT_MAPPING=CR;Va.DEFAULT_ANISOTROPY=1;class kf{constructor(t=0,e=0,i=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=s}static slerpFlat(t,e,i,s,r,a,o){let l=i[s+0],c=i[s+1],h=i[s+2],u=i[s+3];const p=r[a+0],m=r[a+1],g=r[a+2],x=r[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]=x;return}if(u!==x||l!==p||c!==m||h!==g){let y=1-o;const _=l*p+c*m+h*g+u*x,b=_>=0?1:-1,S=1-_*_;if(S>Number.EPSILON){const R=Math.sqrt(S),T=Math.atan2(R,_*b);y=Math.sin(y*T)/R,o=Math.sin(o*T)/R}const w=o*b;if(l=l*y+p*w,c=c*y+m*w,h=h*y+g*w,u=u*y+x*w,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,s,r,a){const o=i[s],l=i[s+1],c=i[s+2],h=i[s+3],u=r[a],p=r[a+1],m=r[a+2],g=r[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,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(s/2),u=o(r/2),p=l(i/2),m=l(s/2),g=l(r/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,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],s=e[4],r=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=(r-c)*m,this._z=(a-s)*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=(s+a)/m,this._z=(r+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-i-u);this._w=(r-c)/m,this._x=(s+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+u-i-o);this._w=(a-s)/m,this._x=(r+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(Fi(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const s=Math.min(1,e/i);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 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,s=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+s*c-r*l,this._y=s*h+a*l+r*o-i*c,this._z=r*h+a*c+i*l-s*o,this._w=a*h-i*o-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,s=this._y,r=this._z,a=this._w;let o=a*t._w+i*t._x+s*t._y+r*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=s,this._z=r,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*s+e*this._y,this._z=m*r+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=s*u+this._y*p,this._z=r*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),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(s),i*Math.sin(r),i*Math.cos(r),e*Math.sin(s))}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(XE.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(XE.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,s=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*s-o*i),h=2*(o*e-r*s),u=2*(r*i-a*e);return this.x=e+l*c+a*u-o*h,this.y=i+l*h+o*c-r*u,this.z=s+l*u+r*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,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=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,s=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=s*l-r*o,this.y=r*a-i*l,this.z=i*o-s*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 J_.copy(this).projectOnVector(t),this.sub(J_)}reflect(t){return this.sub(J_.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(Fi(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){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(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,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 J_=new Pt,XE=new kf;class zf{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,Us),Us.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(su),Kp.subVectors(this.max,su),lc.subVectors(t.a,su),cc.subVectors(t.b,su),hc.subVectors(t.c,su),La.subVectors(cc,lc),Da.subVectors(hc,cc),Do.subVectors(lc,hc);let e=[0,-La.z,La.y,0,-Da.z,Da.y,0,-Do.z,Do.y,La.z,0,-La.x,Da.z,0,-Da.x,Do.z,0,-Do.x,-La.y,La.x,0,-Da.y,Da.x,0,-Do.y,Do.x,0];return!Q_(e,lc,cc,hc,Kp)||(e=[1,0,0,0,1,0,0,0,1],!Q_(e,lc,cc,hc,Kp))?!1:(Jp.crossVectors(La,Da),e=[Jp.x,Jp.y,Jp.z],Q_(e,lc,cc,hc,Kp))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Us).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Us).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:(Wr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Wr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Wr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Wr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Wr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Wr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Wr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Wr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Wr),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 Wr=[new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt],Us=new Pt,Zp=new zf,lc=new Pt,cc=new Pt,hc=new Pt,La=new Pt,Da=new Pt,Do=new Pt,su=new Pt,Kp=new Pt,Jp=new Pt,No=new Pt;function Q_(n,t,e,i,s){for(let r=0,a=n.length-3;r<=a;r+=3){No.fromArray(n,r);const o=s.x*Math.abs(No.x)+s.y*Math.abs(No.y)+s.z*Math.abs(No.z),l=t.dot(No),c=e.dot(No),h=i.dot(No);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const b8=new zf,ru=new Pt,tx=new Pt;class PR{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):b8.setFromPoints(t).getCenter(i);let s=0;for(let r=0,a=t.length;rthis.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;ru.subVectors(t,this.center);const e=ru.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),s=(i-this.radius)*.5;this.center.addScaledVector(ru,s/i),this.radius+=s}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):(tx.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(ru.copy(t.center).add(tx)),this.expandByPoint(ru.copy(t.center).sub(tx))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const jr=new Pt,ex=new Pt,Qp=new Pt,Na=new Pt,nx=new Pt,tm=new Pt,ix=new Pt;class w8{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,jr)),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=jr.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(jr.copy(this.origin).addScaledVector(this.direction,e),jr.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){ex.copy(t).add(e).multiplyScalar(.5),Qp.copy(e).sub(t).normalize(),Na.copy(this.origin).sub(ex);const r=t.distanceTo(e)*.5,a=-this.direction.dot(Qp),o=Na.dot(this.direction),l=-Na.dot(Qp),c=Na.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=r*h,u>=0)if(p>=-g)if(p<=g){const x=1/h;u*=x,p*=x,m=u*(u+a*p+2*o)+p*(a*u+p+2*l)+c}else p=r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p=-r,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p<=-g?(u=Math.max(0,-(-a*r+o)),p=u>0?-r:Math.min(Math.max(-r,-l),r),m=-u*u+p*(p+2*l)+c):p<=g?(u=0,p=Math.min(Math.max(-r,-l),r),m=p*(p+2*l)+c):(u=Math.max(0,-(a*r+o)),p=u>0?r:Math.min(Math.max(-r,-l),r),m=-u*u+p*(p+2*l)+c);else p=a>0?-r:r,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),s&&s.copy(ex).addScaledVector(Qp,p),m}intersectSphere(t,e){jr.subVectors(t.center,this.origin);const i=jr.dot(this.direction),s=jr.dot(jr)-i*i,r=t.radius*t.radius;if(s>r)return null;const a=Math.sqrt(r-s),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,s,r,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,s=(t.max.x-p.x)*c):(i=(t.max.x-p.x)*c,s=(t.min.x-p.x)*c),h>=0?(r=(t.min.y-p.y)*h,a=(t.max.y-p.y)*h):(r=(t.max.y-p.y)*h,a=(t.min.y-p.y)*h),i>a||r>s||((r>i||isNaN(i))&&(i=r),(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>s)||((o>i||i!==i)&&(i=o),(l=0?i:s,e)}intersectsBox(t){return this.intersectBox(t,jr)!==null}intersectTriangle(t,e,i,s,r){nx.subVectors(e,t),tm.subVectors(i,t),ix.crossVectors(nx,tm);let a=this.direction.dot(ix),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Na.subVectors(this.origin,t);const l=o*this.direction.dot(tm.crossVectors(Na,tm));if(l<0)return null;const c=o*this.direction.dot(nx.cross(Na));if(c<0||l+c>a)return null;const h=-o*Na.dot(ix);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Vs{constructor(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y){Vs.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,s,r,a,o,l,c,h,u,p,m,g,x,y)}set(t,e,i,s,r,a,o,l,c,h,u,p,m,g,x,y){const _=this.elements;return _[0]=t,_[4]=e,_[8]=i,_[12]=s,_[1]=r,_[5]=a,_[9]=o,_[13]=l,_[2]=c,_[6]=h,_[10]=u,_[14]=p,_[3]=m,_[7]=g,_[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 Vs().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,s=1/uc.setFromMatrixColumn(t,0).length(),r=1/uc.setFromMatrixColumn(t,1).length(),a=1/uc.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*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,s=t.y,r=t.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(s),c=Math.sin(s),h=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const p=a*h,m=a*u,g=o*h,x=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=m+g*c,e[5]=p-x*c,e[9]=-o*l,e[2]=x-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,x=c*u;e[0]=p+x*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]=x+p*o,e[10]=a*l}else if(t.order==="ZXY"){const p=l*h,m=l*u,g=c*h,x=c*u;e[0]=p-x*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=x-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,x=o*u;e[0]=l*h,e[4]=g*c-m,e[8]=p*c+x,e[1]=l*u,e[5]=x*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,x=o*c;e[0]=l*h,e[4]=x-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-x*u}else if(t.order==="XZY"){const p=a*l,m=a*c,g=o*l,x=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=p*u+x,e[5]=a*h,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*h,e[10]=x*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(S8,t,E8)}lookAt(t,e,i){const s=this.elements;return Zi.subVectors(t,e),Zi.lengthSq()===0&&(Zi.z=1),Zi.normalize(),Oa.crossVectors(i,Zi),Oa.lengthSq()===0&&(Math.abs(i.z)===1?Zi.x+=1e-4:Zi.z+=1e-4,Zi.normalize(),Oa.crossVectors(i,Zi)),Oa.normalize(),em.crossVectors(Zi,Oa),s[0]=Oa.x,s[4]=em.x,s[8]=Zi.x,s[1]=Oa.y,s[5]=em.y,s[9]=Zi.y,s[2]=Oa.z,s[6]=em.z,s[10]=Zi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,r=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],x=i[6],y=i[10],_=i[14],b=i[3],S=i[7],w=i[11],R=i[15],T=s[0],C=s[4],L=s[8],P=s[12],E=s[1],D=s[5],z=s[9],G=s[13],W=s[2],Q=s[6],Y=s[10],ot=s[14],H=s[3],Z=s[7],it=s[11],$=s[15];return r[0]=a*T+o*E+l*W+c*H,r[4]=a*C+o*D+l*Q+c*Z,r[8]=a*L+o*z+l*Y+c*it,r[12]=a*P+o*G+l*ot+c*$,r[1]=h*T+u*E+p*W+m*H,r[5]=h*C+u*D+p*Q+m*Z,r[9]=h*L+u*z+p*Y+m*it,r[13]=h*P+u*G+p*ot+m*$,r[2]=g*T+x*E+y*W+_*H,r[6]=g*C+x*D+y*Q+_*Z,r[10]=g*L+x*z+y*Y+_*it,r[14]=g*P+x*G+y*ot+_*$,r[3]=b*T+S*E+w*W+R*H,r[7]=b*C+S*D+w*Q+R*Z,r[11]=b*L+S*z+w*Y+R*it,r[15]=b*P+S*G+w*ot+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],s=t[8],r=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],x=t[7],y=t[11],_=t[15];return g*(+r*l*u-s*c*u-r*o*p+i*c*p+s*o*m-i*l*m)+x*(+e*l*m-e*c*p+r*a*p-s*a*m+s*c*h-r*l*h)+y*(+e*c*u-e*o*m-r*a*u+i*a*m+r*o*h-i*c*h)+_*(-s*o*h-e*l*u+e*o*p+s*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 s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],r=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],x=t[13],y=t[14],_=t[15],b=u*y*c-x*p*c+x*l*m-o*y*m-u*l*_+o*p*_,S=g*p*c-h*y*c-g*l*m+a*y*m+h*l*_-a*p*_,w=h*x*c-g*u*c+g*o*m-a*x*m-h*o*_+a*u*_,R=g*u*l-h*x*l-g*o*p+a*x*p+h*o*y-a*u*y,T=e*b+i*S+s*w+r*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]=b*C,t[1]=(x*p*r-u*y*r-x*s*m+i*y*m+u*s*_-i*p*_)*C,t[2]=(o*y*r-x*l*r+x*s*c-i*y*c-o*s*_+i*l*_)*C,t[3]=(u*l*r-o*p*r-u*s*c+i*p*c+o*s*m-i*l*m)*C,t[4]=S*C,t[5]=(h*y*r-g*p*r+g*s*m-e*y*m-h*s*_+e*p*_)*C,t[6]=(g*l*r-a*y*r-g*s*c+e*y*c+a*s*_-e*l*_)*C,t[7]=(a*p*r-h*l*r+h*s*c-e*p*c-a*s*m+e*l*m)*C,t[8]=w*C,t[9]=(g*u*r-h*x*r-g*i*m+e*x*m+h*i*_-e*u*_)*C,t[10]=(a*x*r-g*o*r+g*i*c-e*x*c-a*i*_+e*o*_)*C,t[11]=(h*o*r-a*u*r-h*i*c+e*u*c+a*i*m-e*o*m)*C,t[12]=R*C,t[13]=(h*x*s-g*u*s+g*i*p-e*x*p-h*i*y+e*u*y)*C,t[14]=(g*o*s-a*x*s-g*i*l+e*x*l+a*i*y-e*o*y)*C,t[15]=(a*u*s-h*o*s+h*i*l-e*u*l-a*i*p+e*o*p)*C,this}scale(t){const e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){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],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}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),s=Math.sin(e),r=1-i,a=t.x,o=t.y,l=t.z,c=r*a,h=r*o;return this.set(c*a+i,c*o-s*l,c*l+s*o,0,c*o+s*l,h*o+i,h*l-s*a,0,c*l-s*o,h*l+s*a,r*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,s,r,a){return this.set(1,i,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){const s=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,h=a+a,u=o+o,p=r*c,m=r*h,g=r*u,x=a*h,y=a*u,_=o*u,b=l*c,S=l*h,w=l*u,R=i.x,T=i.y,C=i.z;return s[0]=(1-(x+_))*R,s[1]=(m+w)*R,s[2]=(g-S)*R,s[3]=0,s[4]=(m-w)*T,s[5]=(1-(p+_))*T,s[6]=(y+b)*T,s[7]=0,s[8]=(g+S)*C,s[9]=(y-b)*C,s[10]=(1-(p+x))*C,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){const s=this.elements;let r=uc.set(s[0],s[1],s[2]).length();const a=uc.set(s[4],s[5],s[6]).length(),o=uc.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],ks.copy(this);const c=1/r,h=1/a,u=1/o;return ks.elements[0]*=c,ks.elements[1]*=c,ks.elements[2]*=c,ks.elements[4]*=h,ks.elements[5]*=h,ks.elements[6]*=h,ks.elements[8]*=u,ks.elements[9]*=u,ks.elements[10]*=u,e.setFromRotationMatrix(ks),i.x=r,i.y=a,i.z=o,this}makePerspective(t,e,i,s,r,a,o=Yp){const l=this.elements,c=2*r/(e-t),h=2*r/(i-s),u=(e+t)/(e-t),p=(i+s)/(i-s);let m,g;if(o===Yp)m=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===HE)m=-a/(a-r),g=-a*r/(a-r);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,s,r,a,o=Yp){const l=this.elements,c=1/(e-t),h=1/(i-s),u=1/(a-r),p=(e+t)*c,m=(i+s)*h;let g,x;if(o===Yp)g=(a+r)*u,x=-2*u;else if(o===HE)g=r*u,x=-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]=x,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 s=0;s<16;s++)if(e[s]!==i[s])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 uc=new Pt,ks=new Vs,S8=new Pt(0,0,0),E8=new Pt(1,1,1),Oa=new Pt,em=new Pt,Zi=new Pt,qE=new Vs,YE=new kf;class Ag{constructor(t=0,e=0,i=0,s=Ag.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const s=t.elements,r=s[0],a=s[4],o=s[8],l=s[1],c=s[5],h=s[9],u=s[2],p=s[6],m=s[10];switch(e){case"XYZ":this._y=Math.asin(Fi(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Fi(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Fi(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,r));break;case"ZYX":this._y=Math.asin(-Fi(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Fi(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-Fi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,r)):(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 qE.makeRotationFromQuaternion(t),this.setFromRotationMatrix(qE,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}}Ag.DEFAULT_ORDER="XYZ";class A8{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&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.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()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(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){s.children=[];for(let o=0;o0){s.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=s,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?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){zs.subVectors(s,e),qr.subVectors(i,e),sx.subVectors(t,e);const a=zs.dot(zs),o=zs.dot(qr),l=zs.dot(sx),c=qr.dot(qr),h=qr.dot(sx),u=a*c-o*o;if(u===0)return r.set(0,0,0),null;const p=1/u,m=(c*l-o*h)*p,g=(a*h-o*l)*p;return r.set(1-m-g,g,m)}static containsPoint(t,e,i,s){return this.getBarycoord(t,e,i,s,Yr)===null?!1:Yr.x>=0&&Yr.y>=0&&Yr.x+Yr.y<=1}static getInterpolation(t,e,i,s,r,a,o,l){return this.getBarycoord(t,e,i,s,Yr)===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(r,Yr.x),l.addScaledVector(a,Yr.y),l.addScaledVector(o,Yr.z),l)}static isFrontFacing(t,e,i,s){return zs.subVectors(i,e),qr.subVectors(t,e),zs.cross(qr).dot(s)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return zs.subVectors(this.c,this.b),qr.subVectors(this.a,this.b),zs.cross(qr).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return _r.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return _r.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return _r.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return _r.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return _r.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,s=this.b,r=this.c;let a,o;dc.subVectors(s,i),pc.subVectors(r,i),rx.subVectors(t,i);const l=dc.dot(rx),c=pc.dot(rx);if(l<=0&&c<=0)return e.copy(i);ax.subVectors(t,s);const h=dc.dot(ax),u=pc.dot(ax);if(h>=0&&u<=h)return e.copy(s);const p=l*u-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(i).addScaledVector(dc,a);ox.subVectors(t,r);const m=dc.dot(ox),g=pc.dot(ox);if(g>=0&&m<=g)return e.copy(r);const x=m*c-l*g;if(x<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(i).addScaledVector(pc,o);const y=h*g-m*u;if(y<=0&&u-h>=0&&m-g>=0)return QE.subVectors(r,s),o=(u-h)/(u-h+(m-g)),e.copy(s).addScaledVector(QE,o);const _=1/(y+x+p);return a=x*_,o=p*_,e.copy(i).addScaledVector(dc,a).addScaledVector(pc,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const IR={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},Fa={h:0,s:0,l:0},im={h:0,s:0,l:0};function lx(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 nh{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 s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Hs){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Fs.toWorkingColorSpace(this,e),this}setRGB(t,e,i,s=Fs.workingColorSpace){return this.r=t,this.g=e,this.b=i,Fs.toWorkingColorSpace(this,s),this}setHSL(t,e,i,s=Fs.workingColorSpace){if(t=m8(t,1),e=Fi(e,0,1),i=Fi(i,0,1),e===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,a=2*i-r;this.r=lx(a,r,t+1/3),this.g=lx(a,r,t),this.b=lx(a,r,t-1/3)}return Fs.toWorkingColorSpace(this,s),this}setStyle(t,e=Hs){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,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=Hs){const i=IR[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=kc(t.r),this.g=kc(t.g),this.b=kc(t.b),this}copyLinearToSRGB(t){return this.r=Z_(t.r),this.g=Z_(t.g),this.b=Z_(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Hs){return Fs.fromWorkingColorSpace(hi.copy(this),t),Math.round(Fi(hi.r*255,0,255))*65536+Math.round(Fi(hi.g*255,0,255))*256+Math.round(Fi(hi.b*255,0,255))}getHexString(t=Hs){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Fs.workingColorSpace){Fs.fromWorkingColorSpace(hi.copy(this),e);const i=hi.r,s=hi.g,r=hi.b,a=Math.max(i,s,r),o=Math.min(i,s,r);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=(s-r)/u+(s0!=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 s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){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!==TE&&(i.blending=this.blending),this.side!==hv&&(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!==RE&&(i.blendSrc=this.blendSrc),this.blendDst!==PE&&(i.blendDst=this.blendDst),this.blendEquation!==CE&&(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!==IE&&(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!==zE&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ac&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ac&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ac&&(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 s(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=s(t.textures),a=s(t.images);r.length>0&&(i.textures=r),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 s=e.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=e[r].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 D8 extends LR{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new nh(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=i8,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 Tn=new Pt,sm=new Ei;class la{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=BE,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=l8,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Im("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 s=0,r=this.itemSize;s0&&(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 s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,p=c.length;u0&&(s[l]=h,r=!0)}r&&(t.data.morphAttributes=s,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 s=t.attributes;for(const c in s){const h=s[c];this.setAttribute(c,h.clone(e))}const r=t.morphAttributes;for(const c in r){const h=[],u=r[c];for(let p=0,m=u.length;p0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(tA.copy(r).invert(),Oo.copy(t.ray).applyMatrix4(tA),!(i.boundingBox!==null&&Oo.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,Oo)))}_computeIntersections(t,e,i){let s;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,p=r.groups,m=r.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,x=p.length;ge.far?null:{distance:c,point:um.clone(),object:n}}function fm(n,t,e,i,s,r,a,o,l,c){n.getVertexPosition(o,gc),n.getVertexPosition(l,yc),n.getVertexPosition(c,_c);const h=k8(n,t,e,i,gc,yc,_c,hm);if(h){s&&(om.fromBufferAttribute(s,o),lm.fromBufferAttribute(s,l),cm.fromBufferAttribute(s,c),h.uv=_r.getInterpolation(hm,gc,yc,_c,om,lm,cm,new Ei)),r&&(om.fromBufferAttribute(r,o),lm.fromBufferAttribute(r,l),cm.fromBufferAttribute(r,c),h.uv1=_r.getInterpolation(hm,gc,yc,_c,om,lm,cm,new Ei),h.uv2=h.uv1),a&&(nA.fromBufferAttribute(a,o),iA.fromBufferAttribute(a,l),sA.fromBufferAttribute(a,c),h.normal=_r.getInterpolation(hm,gc,yc,_c,nA,iA,sA,new Pt),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new Pt,materialIndex:0};_r.getNormal(gc,yc,_c,u.normal),h.face=u}return h}class z8 extends Va{constructor(t,e,i,s,r,a,o,l,c,h){if(h=h!==void 0?h:X_,h!==X_&&h!==OE)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===X_&&(i=o8),i===void 0&&h===OE&&(i=c8),super(null,s,r,a,o,l,h,i,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:NE,this.minFilter=l!==void 0?l:NE,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 B8=new z8(1,1);B8.compareFunction=p8;class H8 extends LR{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new nh(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 nh(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=f8,this.normalScale=new Ei(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 rA(n,t=!1){const e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),r={},a={},o=n[0].morphTargetsRelative,l=new Bf;let c=0;for(let h=0;hG8(n,t,e)}function yh(n,t){return Kn(DR(n,t).get)}const{apply:G8,construct:F$,defineProperty:U$,get:k$,getOwnPropertyDescriptor:DR,getPrototypeOf:Y1,has:z$,ownKeys:V8,set:B$,setPrototypeOf:H$}=Reflect,{iterator:Hf,species:G$,toStringTag:W8,for:V$}=Symbol,j8=Object,{create:$1,defineProperty:X8,freeze:W$,is:j$}=j8,q8=Array,Y8=q8.prototype,NR=Y8[Hf],$8=Kn(NR),OR=ArrayBuffer,Z8=OR.prototype;yh(Z8,"byteLength");const oA=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;oA&&yh(oA.prototype,"byteLength");const FR=Y1(Uint8Array);FR.from;const Ai=FR.prototype;Ai[Hf];Kn(Ai.keys);Kn(Ai.values);Kn(Ai.entries);Kn(Ai.set);Kn(Ai.reverse);Kn(Ai.fill);Kn(Ai.copyWithin);Kn(Ai.sort);Kn(Ai.slice);Kn(Ai.subarray);yh(Ai,"buffer");yh(Ai,"byteOffset");yh(Ai,"length");yh(Ai,W8);const K8=Uint8Array,UR=Uint16Array,Z1=Uint32Array,J8=Float32Array,rf=Y1([][Hf]()),kR=Kn(rf.next),Q8=Kn(function*(){}().next),tH=Y1(rf),eH=DataView.prototype,nH=Kn(eH.getUint16),K1=WeakMap,zR=K1.prototype,BR=Kn(zR.get),iH=Kn(zR.set),HR=new K1,sH=$1(null,{next:{value:function(){const t=BR(HR,this);return kR(t)}},[Hf]:{value:function(){return this}}});function rH(n){if(n[Hf]===NR&&rf.next===kR)return n;const t=$1(sH);return iH(HR,t,$8(n)),t}const aH=new K1,oH=$1(tH,{next:{value:function(){const t=BR(aH,this);return Q8(t)},writable:!0,configurable:!0}});for(const n of V8(rf))n!=="next"&&X8(oH,n,DR(rf,n));const GR=new OR(4),lH=new J8(GR),cH=new Z1(GR),hr=new UR(512),ur=new K8(512);for(let n=0;n<256;++n){const t=n-127;t<-24?(hr[n]=0,hr[n|256]=32768,ur[n]=24,ur[n|256]=24):t<-14?(hr[n]=1024>>-t-14,hr[n|256]=1024>>-t-14|32768,ur[n]=-t-1,ur[n|256]=-t-1):t<=15?(hr[n]=t+15<<10,hr[n|256]=t+15<<10|32768,ur[n]=13,ur[n|256]=13):t<128?(hr[n]=31744,hr[n|256]=64512,ur[n]=24,ur[n|256]=24):(hr[n]=31744,hr[n|256]=64512,ur[n]=13,ur[n|256]=13)}const J1=new Z1(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,J1[n]=t|e}for(let n=1024;n<2048;++n)J1[n]=939524096+(n-1024<<13);const _h=new Z1(64);for(let n=1;n<31;++n)_h[n]=n<<23;_h[31]=1199570944;_h[32]=2147483648;for(let n=33;n<63;++n)_h[n]=2147483648+(n-32<<23);_h[63]=3347054592;const VR=new UR(64);for(let n=1;n<64;++n)n!==32&&(VR[n]=1024);function hH(n){const t=n>>10;return cH[0]=J1[VR[t]+(n&1023)]+_h[t],lH[0]}function WR(n,t,...e){return hH(nH(n,t,...rH(e)))}var Q1={exports:{}};function jR(n,t,e){const i=e&&e.debug||!1;i&&console.log("[xml-utils] getting "+t+" in "+n);const s=typeof n=="object"?n.outer:n,r=s.slice(0,s.indexOf(">")+1),a=['"',"'"];for(let o=0;o/]`,r);if(i&&console.log("[xml-utils] start:",a),a===-1)return;const o=n.slice(a+t.length);let l=fx(o,"^[^<]*[ /]>",0);const c=l!==-1&&o[l-1]==="/";if(i&&console.log("[xml-utils] selfClosing:",c),c===!1)if(s){let m=0,g=1,x=0;for(;(l=fx(o,"[ /]"+t+">",m))!==-1;){const y=o.substring(m,l+1);if(g+=lA(y,"<"+t+`[ + >]`),x+=lA(y,""),x>=g)break;m=l}}else l=fx(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}}eM.exports=$R;eM.exports.default=$R;var gH=eM.exports;const yH=gH;function ZR(n,t,e){const i=[],s=e&&e.debug||!1,r=e&&typeof e.nested=="boolean"?e.nested:!0;let a=e&&e.startIndex||0,o;for(;o=yH(n,t,{debug:s,startIndex:a});)r?a=o.start+1+t.length:a=o.end,i.push(o);return s&&console.log("findTagsByName found",i.length,"tags"),i}tM.exports=ZR;tM.exports.default=ZR;var _H=tM.exports;const xH=xf(_H),Lu={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"},pr={};for(const n in Lu)Lu.hasOwnProperty(n)&&(pr[Lu[n]]=parseInt(n,10));const vH=[pr.BitsPerSample,pr.ExtraSamples,pr.SampleFormat,pr.StripByteCounts,pr.StripOffsets,pr.StripRowCounts,pr.TileByteCounts,pr.TileOffsets,pr.SubIFDs],dx={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"},Ie={};for(const n in dx)dx.hasOwnProperty(n)&&(Ie[dx[n]]=parseInt(n,10));const Ji={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},MH={Unspecified:0,Assocalpha:1,Unassalpha:2},X$={Version:0,AddCompression:1},q$={None:0,Deflate:1,Zstandard:2},bH={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 wH(n,t){const{width:e,height:i}=n,s=new Uint8Array(e*i*3);let r;for(let a=0,o=0;a>24,l=n[s+2]<<24>>24;let c=(a+16)/116,h=o/500+c,u=c-l/200,p,m,g;h=CH*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),c=RH*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),u=PH*(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[r]=Math.max(0,Math.min(1,p))*255,i[r+1]=Math.max(0,Math.min(1,m))*255,i[r+2]=Math.max(0,Math.min(1,g))*255}return i}const KR=new Map;function oo(n,t){Array.isArray(n)||(n=[n]),n.forEach(e=>KR.set(e,t))}async function LH(n){const t=KR.get(n.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${n.Compression}`);const e=await t();return new e(n)}oo([void 0,1],()=>xl(()=>import("./raw-Dt1HMqYc.js"),__vite__mapDeps([0,1])).then(n=>n.default));oo(5,()=>xl(()=>import("./lzw-DpvbRwG5.js"),__vite__mapDeps([2,1])).then(n=>n.default));oo(6,()=>{throw new Error("old style JPEG compression is not supported.")});oo(7,()=>xl(()=>import("./jpeg-CdeCw_eT.js"),__vite__mapDeps([3,1])).then(n=>n.default));oo([8,32946],()=>xl(()=>import("./deflate-DVinku8x.js"),__vite__mapDeps([4,1,5,6,7,8,9,10])).then(n=>n.default));oo(32773,()=>xl(()=>import("./packbits-DQnG8s9w.js"),__vite__mapDeps([11,1])).then(n=>n.default));oo(34887,()=>xl(()=>import("./lerc-BoocAjbe.js"),__vite__mapDeps([12,5,6,1,7,8,9,10])).then(async n=>(await n.zstd.init(),n)).then(n=>n.default));oo(50001,()=>xl(()=>import("./webimage-BcnuJlio.js"),__vite__mapDeps([13,1])).then(n=>n.default));function Tg(n,t,e,i=1){return new(Object.getPrototypeOf(n)).constructor(t*e*i)}function DH(n,t,e,i,s){const r=t/i,a=e/s;return n.map(o=>{const l=Tg(o,i,s);for(let c=0;c{const l=Tg(o,i,s);for(let c=0;c>8-s-T&u;else if(T+s<=16)h[w]=o.getUint16(R)>>16-s-T&u;else if(T+s<=24){const C=o.getUint16(R)<<8|o.getUint8(R+2);h[w]=C>>24-s-T&u}else h[w]=o.getUint32(R)>>32-s-T&u}}}}return h.buffer}class GH{constructor(t,e,i,s,r,a){this.fileDirectory=t,this.geoKeys=e,this.dataView=i,this.littleEndian=s,this.tiles=r?{}: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(s,r){return WR(this,s,r)};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),s=this.getBitsPerSample(t);return dv(i,s,e)}async getTileOrStrip(t,e,i,s,r){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}],r))[0];let m;return c===null||!c[l]?(m=(async()=>{let g=await s.decode(this.fileDirectory,p);const x=this.getSampleFormat(),y=this.getBitsPerSample();return BH(x,y)&&(g=HH(g,x,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,s,r,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),x=Math.min(Math.ceil(t[2]/h),Math.ceil(p/h)),y=Math.max(Math.floor(t[1]/u),0),_=Math.min(Math.ceil(t[3]/u),Math.ceil(m/u)),b=t[2]-t[0];let S=this.getBytesPerPixel();const w=[],R=[];for(let L=0;L{const Y=Q.data,ot=new DataView(Y),H=this.getBlockHeight(Q.y),Z=Q.y*u,it=Q.x*h,$=Z+H,lt=(Q.x+1)*h,_t=R[z],q=Math.min(H,H-($-t[3]),m-Z),rt=Math.min(h,h-(lt-t[2]),p-it);for(let St=Math.max(0,t[1]-Z);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 b=0;b=g)return Promise.reject(new RangeError(`Invalid sample index '${e[b]}'.`));let x;if(i){const b=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,S=Math.max.apply(null,this.fileDirectory.BitsPerSample);x=dv(b,S,m*e.length),l&&x.fill(l)}else{x=[];for(let b=0;bc[2]||c[1]>c[3])throw new Error("Invalid subsets");const h=this.fileDirectory.PhotometricInterpretation;if(h===Ji.RGB){let _=[0,1,2];if(this.fileDirectory.ExtraSamples!==MH.Unspecified&&o){_=[];for(let b=0;bux(r,"sample")===void 0):s=s.filter(r=>Number(ux(r,"sample"))===t);for(let r=0;r[o+s*y+r*_,u+l*y+c*_]),g=m.map(y=>y[0]),x=m.map(y=>y[1]);return[Math.min(...g),Math.min(...x),Math.max(...g),Math.max(...x)]}else{const s=this.getOrigin(),r=this.getResolution(),a=s[0],o=s[1],l=a+r[0]*i,c=o+r[1]*e;return[Math.min(a,l),Math.min(o,c),Math.max(a,l),Math.max(o,c)]}}}class VH{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,e){const i=this.getUint32(t,e),s=this.getUint32(t+4,e);let r;if(e){if(r=i+2**32*s,!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*i+s,!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}getInt64(t,e){let i=0;const s=(this._dataView.getUint8(t+(e?7:0))&128)>0;let r=!0;for(let a=0;a<8;a++){let o=this._dataView.getUint8(t+(e?a:7-a));s&&(r?o!==0&&(o=~(o-1)&255,r=!1):o=~o&255),i+=o*256**a}return s&&(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 WR(this._dataView,t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class WH{constructor(t,e,i,s){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=i,this._bigTiff=s}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 s;if(this._littleEndian){if(s=e+2**32*i,!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*e+i,!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}readInt64(t){let e=0;const i=(this._dataView.getUint8(t+(this._littleEndian?7:0))&128)>0;let s=!0;for(let r=0;r<8;r++){let a=this._dataView.getUint8(t+(this._littleEndian?r:7-r));i&&(s?a!==0&&(a=~(a-1)&255,s=!1):a=~a&255),e+=a*256**r}return i&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const cA=`\r \r -`;function KR(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 MH(n){const t=n.split(`\r -`).map(e=>{const i=e.split(":").map(s=>s.trim());return i[0]=i[0].toLowerCase(),i});return KR(t)}function bH(n){const[t,...e]=n.split(";").map(s=>s.trim()),i=e.map(s=>s.split("="));return{type:t,params:KR(i)}}function pv(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 wH(n,t){let e=null;const i=new TextDecoder("ascii"),s=[],r=`--${t}`,a=`${r}--`;for(let o=0;o<10;++o)i.decode(new Uint8Array(n,o,r.length))===r&&(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 SH 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 s=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.cache.has(t)?this.cache.set(t,{value:e,expiry:s}):this._set(t,{value:e,expiry:s}),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],[s,r]=i;this._deleteIfExpired(s,r)===!1&&(yield[s,r.value])}t=[...this.oldCache];for(let e=t.length-1;e>=0;--e){const i=t[e],[s,r]=i;this.cache.has(s)||this._deleteIfExpired(s,r)===!1&&(yield[s,r.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,s]of this.entriesAscending())t.call(e,s,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}async function EH(n){return new Promise(t=>setTimeout(t,n))}function AH(n,t){const e=Array.isArray(n)?n:Array.from(n),i=Array.isArray(t)?t:Array.from(t);return e.map((s,r)=>[s,i[r]])}class ih extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,ih),this.name="AbortError"}}class TH extends Error{constructor(t,e){super(e),this.errors=t,this.message=e,this.name="AggregateError"}}const CH=TH;class RH{constructor(t,e,i=null){this.offset=t,this.length=e,this.data=i}get top(){return this.offset+this.length}}class iA{constructor(t,e,i){this.offset=t,this.length=e,this.blockIds=i}}class PH extends JR{constructor(t,{blockSize:e=65536,cacheSize:i=100}={}){super(),this.source=t,this.blockSize=e,this.blockCache=new SH({maxSize:i,onEviction:(s,r)=>{this.evictedBlocks.set(s,r)}}),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=[],s=[],r=[];this.evictedBlocks.clear();for(const{offset:p,length:m}of t){let g=p+m;const{fileSize:x}=this;x!==null&&(g=Math.min(g,x));const y=Math.floor(p/this.blockSize)*this.blockSize;for(let _=y;_this.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 ih("Request was aborted");const c=r.map(p=>this.blockCache.get(p)||this.evictedBlocks.get(p)),h=c.filter(p=>!p);if(h.length)throw new CH(h,"Request failed");const u=new Map(AH(r,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 s=0;s{try{const o=(await i)[s],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 RH(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=[],s=null;const r=[];for(const a of e)s===null||s+1===a?(i.push(a),s=a):(r.push(new iA(i[0]*this.blockSize,i.length*this.blockSize,i)),i=[a],s=a);return r.push(new iA(i[0]*this.blockSize,i.length*this.blockSize,i)),r}readSliceData(t,e){return t.map(i=>{let s=i.offset+i.length;this.fileSize!==null&&(s=Math.min(this.fileSize,s));const r=Math.floor(i.offset/this.blockSize),a=Math.floor(s/this.blockSize),o=new ArrayBuffer(i.length),l=new Uint8Array(o);for(let c=r;c<=a;++c){const h=e.get(c),u=h.offset-i.offset,p=h.top-s;let m=0,g=0,x;u<0?m=-u:u>0&&(g=u),p<0?x=h.length-m:x=s-h.offset-m;const y=new Uint8Array(h.data,m,x);l.set(y,g)}return o})}}class sM{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 rM{constructor(t){this.url=t}async request({headers:t,signal:e}={}){throw new Error("request is not implemented")}}class IH extends sM{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 LH extends rM{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 IH(i)}}class DH extends sM{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 NH extends rM{constructRequest(t,e){return new Promise((i,s)=>{const r=new XMLHttpRequest;r.open("GET",this.url),r.responseType="arraybuffer";for(const[a,o]of Object.entries(t))r.setRequestHeader(a,o);r.onload=()=>{const a=r.response;i(new DH(r,a))},r.onerror=s,r.onabort=()=>s(new ih("Request aborted")),r.send(),e&&(e.aborted&&r.abort(),e.addEventListener("abort",()=>r.abort()))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}const dx={};class OH extends sM{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 FH extends rM{constructor(t){super(t),this.parsedUrl=dx.parse(this.url),this.httpApi=(this.parsedUrl.protocol==="http:",dx)}constructRequest(t,e){return new Promise((i,s)=>{const r=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",s)});i(new OH(a,o))});r.on("error",s),e&&(e.aborted&&r.destroy(new ih("Request aborted")),e.addEventListener("abort",()=>r.destroy(new ih("Request aborted"))))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}class aM extends JR{constructor(t,e,i,s){super(),this.client=t,this.headers=e,this.maxRanges=i,this.allowFullFile=s,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:s,length:r})=>`${s}-${s+r}`).join(",")}`},signal:e});if(i.ok)if(i.status===206){const{type:s,params:r}=bH(i.getHeader("content-type"));if(s==="multipart/byteranges"){const u=wH(await i.getData(),r.boundary);return this._fileSize=u[0].fileSize||null,u}const a=await i.getData(),{start:o,end:l,total:c}=pv(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 s=await i.getData();return this._fileSize=s.byteLength,[{data:s,offset:0,length:s.byteLength}]}else throw new Error("Error fetching data.")}async fetchSlice(t,e){const{offset:i,length:s}=t,r=await this.client.request({headers:{...this.headers,Range:`bytes=${i}-${i+s}`},signal:e});if(r.ok)if(r.status===206){const a=await r.getData(),{total:o}=pv(r.getHeader("content-range"));return this._fileSize=o||null,{data:a,offset:i,length:s}}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const a=await r.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 oM(n,{blockSize:t,cacheSize:e}){return t===null?n:new PH(n,{blockSize:t,cacheSize:e})}function UH(n,{headers:t={},credentials:e,maxRanges:i=0,allowFullFile:s=!1,...r}={}){const a=new LH(n,e),o=new aM(a,t,i,s);return oM(o,r)}function kH(n,{headers:t={},maxRanges:e=0,allowFullFile:i=!1,...s}={}){const r=new NH(n),a=new aM(r,t,e,i);return oM(a,s)}function zH(n,{headers:t={},maxRanges:e=0,allowFullFile:i=!1,...s}={}){const r=new FH(n),a=new aM(r,t,e,i);return oM(a,s)}function BH(n,{forceXHR:t=!1,...e}={}){return typeof fetch=="function"&&!t?UH(n,e):typeof XMLHttpRequest<"u"?kH(n,e):zH(n,e)}function mv(n){switch(n){case Ie.BYTE:case Ie.ASCII:case Ie.SBYTE:case Ie.UNDEFINED:return 1;case Ie.SHORT:case Ie.SSHORT:return 2;case Ie.LONG:case Ie.SLONG:case Ie.FLOAT:case Ie.IFD:return 4;case Ie.RATIONAL:case Ie.SRATIONAL:case Ie.DOUBLE:case Ie.LONG8:case Ie.SLONG8:case Ie.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${n}`)}}function HH(n){const t=n.GeoKeyDirectory;if(!t)return null;const e={};for(let i=4;i<=t[3]*4;i+=4){const s=J8[t[i]],r=t[i+1]?Lu[t[i+1]]:null,a=t[i+2],o=t[i+3];let l=null;if(!r)l=o;else{if(l=n[r],typeof l>"u"||l===null)throw new Error(`Could not get value of geoKey '${s}'.`);typeof l=="string"?l=l.substring(o,o+a-1):l.subarray&&(l=l.subarray(o,o+a),a===1&&(l=l[0]))}e[s]=l}return e}function xc(n,t,e,i){let s=null,r=null;const a=mv(t);switch(t){case Ie.BYTE:case Ie.ASCII:case Ie.UNDEFINED:s=new Uint8Array(e),r=n.readUint8;break;case Ie.SBYTE:s=new Int8Array(e),r=n.readInt8;break;case Ie.SHORT:s=new Uint16Array(e),r=n.readUint16;break;case Ie.SSHORT:s=new Int16Array(e),r=n.readInt16;break;case Ie.LONG:case Ie.IFD:s=new Uint32Array(e),r=n.readUint32;break;case Ie.SLONG:s=new Int32Array(e),r=n.readInt32;break;case Ie.LONG8:case Ie.IFD8:s=new Array(e),r=n.readUint64;break;case Ie.SLONG8:s=new Array(e),r=n.readInt64;break;case Ie.RATIONAL:s=new Uint32Array(e*2),r=n.readUint32;break;case Ie.SRATIONAL:s=new Int32Array(e*2),r=n.readInt32;break;case Ie.FLOAT:s=new Float32Array(e),r=n.readFloat32;break;case Ie.DOUBLE:s=new Float64Array(e),r=n.readFloat64;break;default:throw new RangeError(`Invalid field type: ${t}`)}if(t===Ie.RATIONAL||t===Ie.SRATIONAL)for(let o=0;og.getWidth()-x.getWidth());for(let g=0;gy||a&&a>_)break}}let p=e;if(o){const[m,g]=l.getOrigin(),[x,y]=c.getResolution(l);p=[Math.round((o[0]-m)/x),Math.round((o[1]-g)/y),Math.round((o[2]-m)/x),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 lM extends VH{constructor(t,e,i,s,r={}){super(),this.source=t,this.littleEndian=e,this.bigTiff=i,this.firstIFDOffset=s,this.cache=r.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,e){const i=this.bigTiff?4048:1024;return new vH((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 s=await this.getSlice(t);const r=this.bigTiff?s.readUint64(t):s.readUint16(t),a=r*e+(this.bigTiff?16:6);s.covers(t,a)||(s=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 _H(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 s=await this.getSlice(t,i);if(e===xc(s,Ie.ASCII,e.length,t)){const a=xc(s,Ie.ASCII,i,t).split(` +`;function JR(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 jH(n){const t=n.split(`\r +`).map(e=>{const i=e.split(":").map(s=>s.trim());return i[0]=i[0].toLowerCase(),i});return JR(t)}function XH(n){const[t,...e]=n.split(";").map(s=>s.trim()),i=e.map(s=>s.split("="));return{type:t,params:JR(i)}}function pv(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 qH(n,t){let e=null;const i=new TextDecoder("ascii"),s=[],r=`--${t}`,a=`${r}--`;for(let o=0;o<10;++o)i.decode(new Uint8Array(n,o,r.length))===r&&(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 YH 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 s=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.cache.has(t)?this.cache.set(t,{value:e,expiry:s}):this._set(t,{value:e,expiry:s}),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],[s,r]=i;this._deleteIfExpired(s,r)===!1&&(yield[s,r.value])}t=[...this.oldCache];for(let e=t.length-1;e>=0;--e){const i=t[e],[s,r]=i;this.cache.has(s)||this._deleteIfExpired(s,r)===!1&&(yield[s,r.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,s]of this.entriesAscending())t.call(e,s,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}async function $H(n){return new Promise(t=>setTimeout(t,n))}function ZH(n,t){const e=Array.isArray(n)?n:Array.from(n),i=Array.isArray(t)?t:Array.from(t);return e.map((s,r)=>[s,i[r]])}class ih extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,ih),this.name="AbortError"}}class KH extends Error{constructor(t,e){super(e),this.errors=t,this.message=e,this.name="AggregateError"}}const JH=KH;class QH{constructor(t,e,i=null){this.offset=t,this.length=e,this.data=i}get top(){return this.offset+this.length}}class hA{constructor(t,e,i){this.offset=t,this.length=e,this.blockIds=i}}class tG extends QR{constructor(t,{blockSize:e=65536,cacheSize:i=100}={}){super(),this.source=t,this.blockSize=e,this.blockCache=new YH({maxSize:i,onEviction:(s,r)=>{this.evictedBlocks.set(s,r)}}),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=[],s=[],r=[];this.evictedBlocks.clear();for(const{offset:p,length:m}of t){let g=p+m;const{fileSize:x}=this;x!==null&&(g=Math.min(g,x));const y=Math.floor(p/this.blockSize)*this.blockSize;for(let _=y;_this.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 ih("Request was aborted");const c=r.map(p=>this.blockCache.get(p)||this.evictedBlocks.get(p)),h=c.filter(p=>!p);if(h.length)throw new JH(h,"Request failed");const u=new Map(ZH(r,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 s=0;s{try{const o=(await i)[s],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 QH(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=[],s=null;const r=[];for(const a of e)s===null||s+1===a?(i.push(a),s=a):(r.push(new hA(i[0]*this.blockSize,i.length*this.blockSize,i)),i=[a],s=a);return r.push(new hA(i[0]*this.blockSize,i.length*this.blockSize,i)),r}readSliceData(t,e){return t.map(i=>{let s=i.offset+i.length;this.fileSize!==null&&(s=Math.min(this.fileSize,s));const r=Math.floor(i.offset/this.blockSize),a=Math.floor(s/this.blockSize),o=new ArrayBuffer(i.length),l=new Uint8Array(o);for(let c=r;c<=a;++c){const h=e.get(c),u=h.offset-i.offset,p=h.top-s;let m=0,g=0,x;u<0?m=-u:u>0&&(g=u),p<0?x=h.length-m:x=s-h.offset-m;const y=new Uint8Array(h.data,m,x);l.set(y,g)}return o})}}class rM{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 aM{constructor(t){this.url=t}async request({headers:t,signal:e}={}){throw new Error("request is not implemented")}}class eG extends rM{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 nG extends aM{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 eG(i)}}class iG extends rM{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 sG extends aM{constructRequest(t,e){return new Promise((i,s)=>{const r=new XMLHttpRequest;r.open("GET",this.url),r.responseType="arraybuffer";for(const[a,o]of Object.entries(t))r.setRequestHeader(a,o);r.onload=()=>{const a=r.response;i(new iG(r,a))},r.onerror=s,r.onabort=()=>s(new ih("Request aborted")),r.send(),e&&(e.aborted&&r.abort(),e.addEventListener("abort",()=>r.abort()))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}const px={};class rG extends rM{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 aG extends aM{constructor(t){super(t),this.parsedUrl=px.parse(this.url),this.httpApi=(this.parsedUrl.protocol==="http:",px)}constructRequest(t,e){return new Promise((i,s)=>{const r=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",s)});i(new rG(a,o))});r.on("error",s),e&&(e.aborted&&r.destroy(new ih("Request aborted")),e.addEventListener("abort",()=>r.destroy(new ih("Request aborted"))))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}class oM extends QR{constructor(t,e,i,s){super(),this.client=t,this.headers=e,this.maxRanges=i,this.allowFullFile=s,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:s,length:r})=>`${s}-${s+r}`).join(",")}`},signal:e});if(i.ok)if(i.status===206){const{type:s,params:r}=XH(i.getHeader("content-type"));if(s==="multipart/byteranges"){const u=qH(await i.getData(),r.boundary);return this._fileSize=u[0].fileSize||null,u}const a=await i.getData(),{start:o,end:l,total:c}=pv(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 s=await i.getData();return this._fileSize=s.byteLength,[{data:s,offset:0,length:s.byteLength}]}else throw new Error("Error fetching data.")}async fetchSlice(t,e){const{offset:i,length:s}=t,r=await this.client.request({headers:{...this.headers,Range:`bytes=${i}-${i+s}`},signal:e});if(r.ok)if(r.status===206){const a=await r.getData(),{total:o}=pv(r.getHeader("content-range"));return this._fileSize=o||null,{data:a,offset:i,length:s}}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const a=await r.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 lM(n,{blockSize:t,cacheSize:e}){return t===null?n:new tG(n,{blockSize:t,cacheSize:e})}function oG(n,{headers:t={},credentials:e,maxRanges:i=0,allowFullFile:s=!1,...r}={}){const a=new nG(n,e),o=new oM(a,t,i,s);return lM(o,r)}function lG(n,{headers:t={},maxRanges:e=0,allowFullFile:i=!1,...s}={}){const r=new sG(n),a=new oM(r,t,e,i);return lM(a,s)}function cG(n,{headers:t={},maxRanges:e=0,allowFullFile:i=!1,...s}={}){const r=new aG(n),a=new oM(r,t,e,i);return lM(a,s)}function hG(n,{forceXHR:t=!1,...e}={}){return typeof fetch=="function"&&!t?oG(n,e):typeof XMLHttpRequest<"u"?lG(n,e):cG(n,e)}function mv(n){switch(n){case Ie.BYTE:case Ie.ASCII:case Ie.SBYTE:case Ie.UNDEFINED:return 1;case Ie.SHORT:case Ie.SSHORT:return 2;case Ie.LONG:case Ie.SLONG:case Ie.FLOAT:case Ie.IFD:return 4;case Ie.RATIONAL:case Ie.SRATIONAL:case Ie.DOUBLE:case Ie.LONG8:case Ie.SLONG8:case Ie.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${n}`)}}function uG(n){const t=n.GeoKeyDirectory;if(!t)return null;const e={};for(let i=4;i<=t[3]*4;i+=4){const s=bH[t[i]],r=t[i+1]?Lu[t[i+1]]:null,a=t[i+2],o=t[i+3];let l=null;if(!r)l=o;else{if(l=n[r],typeof l>"u"||l===null)throw new Error(`Could not get value of geoKey '${s}'.`);typeof l=="string"?l=l.substring(o,o+a-1):l.subarray&&(l=l.subarray(o,o+a),a===1&&(l=l[0]))}e[s]=l}return e}function xc(n,t,e,i){let s=null,r=null;const a=mv(t);switch(t){case Ie.BYTE:case Ie.ASCII:case Ie.UNDEFINED:s=new Uint8Array(e),r=n.readUint8;break;case Ie.SBYTE:s=new Int8Array(e),r=n.readInt8;break;case Ie.SHORT:s=new Uint16Array(e),r=n.readUint16;break;case Ie.SSHORT:s=new Int16Array(e),r=n.readInt16;break;case Ie.LONG:case Ie.IFD:s=new Uint32Array(e),r=n.readUint32;break;case Ie.SLONG:s=new Int32Array(e),r=n.readInt32;break;case Ie.LONG8:case Ie.IFD8:s=new Array(e),r=n.readUint64;break;case Ie.SLONG8:s=new Array(e),r=n.readInt64;break;case Ie.RATIONAL:s=new Uint32Array(e*2),r=n.readUint32;break;case Ie.SRATIONAL:s=new Int32Array(e*2),r=n.readInt32;break;case Ie.FLOAT:s=new Float32Array(e),r=n.readFloat32;break;case Ie.DOUBLE:s=new Float64Array(e),r=n.readFloat64;break;default:throw new RangeError(`Invalid field type: ${t}`)}if(t===Ie.RATIONAL||t===Ie.SRATIONAL)for(let o=0;og.getWidth()-x.getWidth());for(let g=0;gy||a&&a>_)break}}let p=e;if(o){const[m,g]=l.getOrigin(),[x,y]=c.getResolution(l);p=[Math.round((o[0]-m)/x),Math.round((o[1]-g)/y),Math.round((o[2]-m)/x),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 cM extends dG{constructor(t,e,i,s,r={}){super(),this.source=t,this.littleEndian=e,this.bigTiff=i,this.firstIFDOffset=s,this.cache=r.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,e){const i=this.bigTiff?4048:1024;return new WH((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 s=await this.getSlice(t);const r=this.bigTiff?s.readUint64(t):s.readUint16(t),a=r*e+(this.bigTiff?16:6);s.covers(t,a)||(s=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 dm(t);return this.parseFileDirectoryAt(e.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(t=0){const e=await this.requestIFD(t);return new GH(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 dm)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 s=await this.getSlice(t,i);if(e===xc(s,Ie.ASCII,e.length,t)){const a=xc(s,Ie.ASCII,i,t).split(` `)[0],o=Number(a.split("=")[1].split(" ")[0])+a.length;o>i&&(s=await this.getSlice(t,o));const l=xc(s,Ie.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 s=(await t.fetch([{offset:0,length:1024}],i))[0],r=new xH(s),a=r.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=r.getUint16(2,o);let c;if(l===42)c=!1;else if(l===43){if(c=!0,r.getUint16(4,o)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const h=c?r.getUint64(8,o):r.getUint32(4,o);return new lM(t,o,c,h,e)}close(){return typeof this.source.close=="function"?this.source.close():!1}}async function cM(n,t={},e){return lM.fromSource(BH(n,t),e)}var QR={exports:{}};(function(n,t){(function(){var e=Math.PI,i=Math.sin,s=Math.cos,r=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 x($){return m($)-p}var y=c*23.4397;function _($,lt){return o(i($)*s(y)-r(lt)*i(y),s($))}function b($,lt){return a(i(lt)*s(y)+s(lt)*i(y)*i($))}function S($,lt,_t){return o(i($),s($)*i(lt)-r(_t)*s(lt))}function w($,lt,_t){return a(i(lt)*i(_t)+s(lt)*s(_t)*s($))}function R($,lt){return c*(280.16+360.9856235*$)-lt}function T($){return $<0&&($=0),2967e-7/Math.tan($+.00312536/($+.08901179))}function C($){return c*(357.5291+.98560028*$)}function L($){var lt=c*(1.9148*i($)+.02*i(2*$)+3e-4*i(3*$)),_t=c*102.9372;return $+lt+_t+e}function P($){var lt=C($),_t=L(lt);return{dec:b(_t,0),ra:_(_t,0)}}var E={};E.getPosition=function($,lt,_t){var q=c*-_t,rt=c*lt,St=x($),dt=P(St),It=R(St,q)-dt.ra;return{azimuth:S(It,rt,dt.dec),altitude:w(It,rt,dt.dec)}};var D=E.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];E.addTime=function($,lt,_t){D.push([$,lt,_t])};var z=9e-4;function G($,lt){return Math.round($-z-lt/(2*e))}function W($,lt,_t){return z+($+lt)/(2*e)+_t}function Q($,lt,_t){return p+$+.0053*i(lt)-.0069*i(2*_t)}function Y($,lt,_t){return l((i($)-i(lt)*i(_t))/(s(lt)*s(_t)))}function ot($){return-2.076*Math.sqrt($)/60}function H($,lt,_t,q,rt,St,dt){var It=Y($,_t,q),Ht=W(It,lt,rt);return Q(Ht,St,dt)}E.getTimes=function($,lt,_t,q){q=q||0;var rt=c*-_t,St=c*lt,dt=ot(q),It=x($),Ht=G(It,rt),Bt=W(0,rt,Ht),Qt=C(Bt),ht=L(Qt),gt=b(ht,0),k=Q(Bt,Qt,ht),Et,wt,Lt,Ct,ne,Ft,U={solarNoon:g(k),nadir:g(k-.5)};for(Et=0,wt=D.length;Et=0&&(Ft=Math.sqrt(wt)/(Math.abs(ht)*2),Ct=k-Ft,ne=k+Ft,Math.abs(Ct)<=1&&Lt++,Math.abs(ne)<=1&&Lt++,Ct<-1&&(Ct=ne)),Lt===1?dt<0?Bt=U+Ct:Qt=U+Ct:Lt===2&&(Bt=U+(Et<0?ne:Ct),Qt=U+(Et<0?Ct:ne)),!(Bt&&Qt));U+=2)dt=Ht;var N={};return Bt&&(N.rise=it(rt,Bt)),Qt&&(N.set=it(rt,Qt)),!Bt&&!Qt&&(N[Et>0?"alwaysUp":"alwaysDown"]=!0),N},n.exports=E})()})(QR);var WH=QR.exports;const jH=xf(WH);var XH=Object.defineProperty,qH=(n,t)=>{for(var e in t)XH(n,e,{get:t[e],enumerable:!0})},hM={};qH(hM,{interpolateThreeColors:()=>$H,interpolateTwoColors:()=>YH,viridis:()=>t3});function t3(n){n=Math.min(Math.max(n,0),1);const t=[.2777273272234177,.005407344544966578,.3340998053353061],e=[.1050930431085774,1.404613529898575,1.384590162594685],i=[-.3308618287255563,.214847559468213,.09509516302823659],s=[-4.634230498983486,-5.799100973351585,-19.33244095627987],r=[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*(s[0]+n*(r[0]+n*(a[0]+n*o[0]))))),t[1]+n*(e[1]+n*(i[1]+n*(s[1]+n*(r[1]+n*(a[1]+n*o[1]))))),t[2]+n*(e[2]+n*(i[2]+n*(s[2]+n*(r[2]+n*(a[2]+n*o[2])))))]}function YH(n){const{c0:t,c1:e}=n;return i=>{i=Math.min(Math.max(i,0),1);const s=t[0]*(1-i)+e[0]*i,r=t[1]*(1-i)+e[1]*i,a=t[2]*(1-i)+e[2]*i;return[s,r,a]}}function $H(n){const{c0:t,c1:e,c2:i}=n;return s=>{s=Math.max(0,Math.min(1,s));function r(c,h,u,p){return(1-c)*(1-c)*h+2*(1-c)*c*u+c*c*p}const a=r(s,t[0],e[0],i[0]),o=r(s,t[1],e[1],i[1]),l=r(s,t[2],e[2],i[2]);return[a,o,l]}}function ZH(n){let t=n.map(e=>({...e}));for(let e=0;e({radius:1,azimuth:r*(2*Math.PI/e),altitude:-1/0}));for(let s of n){const{azimuth:r,altitude:a}=KH(t,s),o=Math.round(r/(2*Math.PI/e))%e;a>i[o].altitude&&(i[o].altitude=a)}return ZH(i),i}function QH(n,t,e){let i=[],s=0;for(;sMath.abs(r.azimuth-i)=0;i--){const s=n[i],r=e(s.vector.spherical.azimuth);r&&s.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 x;return typeof g[0]=="number"?x=g[0]:x=g[0][0],x!=0||(x=(async(_,b,S,w,R)=>{let T;for(let C=1;C=0&&P=0&&E{const s=r=>{e(r),r=r+1,r==t?i():setTimeout(()=>s(r),0)};setTimeout(()=>s(0),0)})}function hG(n,t){for(var e=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 s=(await t.fetch([{offset:0,length:1024}],i))[0],r=new VH(s),a=r.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=r.getUint16(2,o);let c;if(l===42)c=!1;else if(l===43){if(c=!0,r.getUint16(4,o)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const h=c?r.getUint64(8,o):r.getUint32(4,o);return new cM(t,o,c,h,e)}close(){return typeof this.source.close=="function"?this.source.close():!1}}async function hM(n,t={},e){return cM.fromSource(hG(n,t),e)}var t3={exports:{}};(function(n,t){(function(){var e=Math.PI,i=Math.sin,s=Math.cos,r=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 x($){return m($)-p}var y=c*23.4397;function _($,lt){return o(i($)*s(y)-r(lt)*i(y),s($))}function b($,lt){return a(i(lt)*s(y)+s(lt)*i(y)*i($))}function S($,lt,_t){return o(i($),s($)*i(lt)-r(_t)*s(lt))}function w($,lt,_t){return a(i(lt)*i(_t)+s(lt)*s(_t)*s($))}function R($,lt){return c*(280.16+360.9856235*$)-lt}function T($){return $<0&&($=0),2967e-7/Math.tan($+.00312536/($+.08901179))}function C($){return c*(357.5291+.98560028*$)}function L($){var lt=c*(1.9148*i($)+.02*i(2*$)+3e-4*i(3*$)),_t=c*102.9372;return $+lt+_t+e}function P($){var lt=C($),_t=L(lt);return{dec:b(_t,0),ra:_(_t,0)}}var E={};E.getPosition=function($,lt,_t){var q=c*-_t,rt=c*lt,St=x($),dt=P(St),It=R(St,q)-dt.ra;return{azimuth:S(It,rt,dt.dec),altitude:w(It,rt,dt.dec)}};var D=E.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];E.addTime=function($,lt,_t){D.push([$,lt,_t])};var z=9e-4;function G($,lt){return Math.round($-z-lt/(2*e))}function W($,lt,_t){return z+($+lt)/(2*e)+_t}function Q($,lt,_t){return p+$+.0053*i(lt)-.0069*i(2*_t)}function Y($,lt,_t){return l((i($)-i(lt)*i(_t))/(s(lt)*s(_t)))}function ot($){return-2.076*Math.sqrt($)/60}function H($,lt,_t,q,rt,St,dt){var It=Y($,_t,q),Ht=W(It,lt,rt);return Q(Ht,St,dt)}E.getTimes=function($,lt,_t,q){q=q||0;var rt=c*-_t,St=c*lt,dt=ot(q),It=x($),Ht=G(It,rt),Bt=W(0,rt,Ht),Qt=C(Bt),ht=L(Qt),gt=b(ht,0),k=Q(Bt,Qt,ht),Et,wt,Lt,Ct,ne,Ft,U={solarNoon:g(k),nadir:g(k-.5)};for(Et=0,wt=D.length;Et=0&&(Ft=Math.sqrt(wt)/(Math.abs(ht)*2),Ct=k-Ft,ne=k+Ft,Math.abs(Ct)<=1&&Lt++,Math.abs(ne)<=1&&Lt++,Ct<-1&&(Ct=ne)),Lt===1?dt<0?Bt=U+Ct:Qt=U+Ct:Lt===2&&(Bt=U+(Et<0?ne:Ct),Qt=U+(Et<0?Ct:ne)),!(Bt&&Qt));U+=2)dt=Ht;var N={};return Bt&&(N.rise=it(rt,Bt)),Qt&&(N.set=it(rt,Qt)),!Bt&&!Qt&&(N[Et>0?"alwaysUp":"alwaysDown"]=!0),N},n.exports=E})()})(t3);var pG=t3.exports;const mG=xf(pG);var gG=Object.defineProperty,yG=(n,t)=>{for(var e in t)gG(n,e,{get:t[e],enumerable:!0})},uM={};yG(uM,{interpolateThreeColors:()=>xG,interpolateTwoColors:()=>_G,viridis:()=>e3});function e3(n){n=Math.min(Math.max(n,0),1);const t=[.2777273272234177,.005407344544966578,.3340998053353061],e=[.1050930431085774,1.404613529898575,1.384590162594685],i=[-.3308618287255563,.214847559468213,.09509516302823659],s=[-4.634230498983486,-5.799100973351585,-19.33244095627987],r=[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*(s[0]+n*(r[0]+n*(a[0]+n*o[0]))))),t[1]+n*(e[1]+n*(i[1]+n*(s[1]+n*(r[1]+n*(a[1]+n*o[1]))))),t[2]+n*(e[2]+n*(i[2]+n*(s[2]+n*(r[2]+n*(a[2]+n*o[2])))))]}function _G(n){const{c0:t,c1:e}=n;return i=>{i=Math.min(Math.max(i,0),1);const s=t[0]*(1-i)+e[0]*i,r=t[1]*(1-i)+e[1]*i,a=t[2]*(1-i)+e[2]*i;return[s,r,a]}}function xG(n){const{c0:t,c1:e,c2:i}=n;return s=>{s=Math.max(0,Math.min(1,s));function r(c,h,u,p){return(1-c)*(1-c)*h+2*(1-c)*c*u+c*c*p}const a=r(s,t[0],e[0],i[0]),o=r(s,t[1],e[1],i[1]),l=r(s,t[2],e[2],i[2]);return[a,o,l]}}function vG(n){let t=n.map(e=>({...e}));for(let e=0;e({radius:1,azimuth:r*(2*Math.PI/e),altitude:-1/0}));for(let s of n){const{azimuth:r,altitude:a}=MG(t,s),o=Math.round(r/(2*Math.PI/e))%e;a>i[o].altitude&&(i[o].altitude=a)}return vG(i),i}function wG(n,t,e){let i=[],s=0;for(;sMath.abs(r.azimuth-i)=0;i--){const s=n[i],r=e(s.vector.spherical.azimuth);r&&s.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 x;return typeof g[0]=="number"?x=g[0]:x=g[0][0],x!=0||(x=(async(_,b,S,w,R)=>{let T;for(let C=1;C=0&&P=0&&E{const s=r=>{e(r),r=r+1,r==t?i():setTimeout(()=>s(r),0)};setTimeout(()=>s(0),0)})}function NG(n,t){for(var e=0;e{const t=n.length/3 precision highp float; void main() { } - `,u=aA(l,l.VERTEX_SHADER,c),p=aA(l,l.FRAGMENT_SHADER,h),m=fG(l,u,p,["outColor"]),g=l.createVertexArray();l.bindVertexArray(g);var x=l.getParameter(l.MAX_TEXTURE_SIZE),y=Math.min(3*r,Math.floor(x/9)*9),_=Math.ceil(3*r/y);console.log("Max Texture Size",x,y,_);const b=e3(l,o*16),S=dG(l,b);l.useProgram(m);var w=l.createTexture();l.bindTexture(l.TEXTURE_2D,w);var R;if(_==1)R=e;else{R=new Float32Array(y*_*3);for(var T=0;T<3*r;T++)for(var C=3*T%y,L=Math.floor(3*T/y),P=L*y+C,E=0;E<3;E++)R[P+E]=e[3*T+E]}l.texImage2D(l.TEXTURE_2D,0,l.RGB32F,y,_,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 D=l.getUniformLocation(m,"u_triangles");l.activeTexture(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,w),l.uniform1i(D,0);var z=l.getUniformLocation(m,"textureWidth");l.uniform1i(z,y);const G=l.getAttribLocation(m,"a_position"),W=l.getAttribLocation(m,"a_normal"),Q=oA(l,n,G),Y=oA(l,t,W);var ot=null,H=null;return await cG(0,i.length,Z=>{if(!i[Z].isShadedByElevation){s(Z,i.length);let it=l.getUniformLocation(m,"u_sun_direction");l.uniform3fv(it,[i[Z].vector.cartesian.x,i[Z].vector.cartesian.y,i[Z].vector.cartesian.z]),pG(l,S,l.POINTS,o),H==null?(ot=rA(l,b,o),H=ot.filter(($,lt)=>(lt+1)%4===0)):(ot=rA(l,b,o),hG(H,ot.filter(($,lt)=>(lt+1)%4===0)))}}),l.deleteTexture(w),l.deleteShader(u),l.deleteShader(p),l.deleteProgram(m),l.deleteBuffer(Q),l.deleteBuffer(Y),l.deleteTransformFeedback(S),l.deleteBuffer(b),H}function rA(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 aA(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 fG(n,t,e,i){const s=n.createProgram();if(s===null||t===null||e===null)throw new Error("abortSimulation");if(n.attachShader(s,t),n.attachShader(s,e),n.transformFeedbackVaryings(s,i,n.SEPARATE_ATTRIBS),n.linkProgram(s),n.getProgramParameter(s,n.LINK_STATUS))return s;throw console.error(n.getProgramInfoLog(s)),n.deleteProgram(s),new Error("Program compilation error.")}function e3(n,t){const e=n.createBuffer();return n.bindBuffer(n.ARRAY_BUFFER,e),n.bufferData(n.ARRAY_BUFFER,t,n.DYNAMIC_DRAW),e}function dG(n,t){const e=n.createTransformFeedback();return n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,e),n.bindBufferBase(n.TRANSFORM_FEEDBACK_BUFFER,0,t),e}function oA(n,t,e){const i=e3(n,t);return n.enableVertexAttribArray(e),n.vertexAttribPointer(e,3,n.FLOAT,!1,0,0),i}function pG(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 n3=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=t3}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=[],s=[];for(let l=0;lc[p%3]))}let r=new Bf;const a=new Float32Array(s),o=new Float32Array(i);return r.setAttribute("position",new la(o,3)),r.setAttribute("normal",new la(a,3)),r.attributes.position.needsUpdate=!0,r.attributes.normal.needsUpdate=!0,r}async calculate(n={}){const{numberSimulations:t=80,diffuseIrradianceURL:e,pvCellEfficiency:i=.2,maxYieldPerSquareMeter:s=1400*.2,progressCallback:r=(T,C)=>console.log(`Progress: ${T}/${C}%`),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=JE(this.simulationGeometries),c=JE(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 T=0;T0&&console.log(`${m}/${g.length} midpoints are nan`);const x=new Float32Array(g.slice());let y=0;for(let T=0;T0&&console.log(`${y}/${h.length} mesh coordinates are nan`),console.log("Calling this.rayTrace");const _=typeof e=="string",b=_?2:1,S=await this.rayTrace(x,p,h,t,void 0,(T,C)=>r(T,C*b));let w=new Float32Array;_&&(w=await this.rayTrace(x,p,h,0,e,(T,C)=>r(T+C,C*b))),console.log("directIntensities",S),console.log("diffuseIntensities",w);const R=await sG(S,w,i,this.latitude,this.longitude,a,o);return console.log("finalIntensities",R),this.createMesh(l,R,s)}createMesh(n,t,e){const i=n.attributes.position.array.length/9;for(var s=new Float32Array(i*9),r=0;r0)a=QH(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=JH(this.elevationRaster,this.elevationRasterMidpoint,this.elevationAzimuthDivisions),iG(a,o)),t=t.filter((c,h)=>h%9<3);let l=await uG(n,t,e,a,r);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 of:return this.neutral(n);case i3:return this.keyword(n);case T0:return this.quoted(n);case r3:return this.afterquote(n);case s3:return this.number(n);case uM:return}};pa.prototype.afterquote=function(n){if(n==='"'){this.word+='"',this.state=T0;return}if(Cg.test(n)){this.word=this.word.trim(),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in afterquote yet, index '+this.place)};pa.prototype.afterItem=function(n){if(n===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=of;return}if(n==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=of,this.currentObject=this.stack.pop(),this.currentObject||(this.state=uM);return}};pa.prototype.number=function(n){if(a3.test(n)){this.word+=n;return}if(Cg.test(n)){this.word=parseFloat(this.word),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in number yet, index '+this.place)};pa.prototype.quoted=function(n){if(n==='"'){this.state=r3;return}this.word+=n};pa.prototype.keyword=function(n){if(SG.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=of;return}if(Cg.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in keyword yet, index '+this.place)};pa.prototype.neutral=function(n){if(wG.test(n)){this.word=n,this.state=i3;return}if(n==='"'){this.word="",this.state=T0;return}if(a3.test(n)){this.word=n,this.state=s3;return}if(Cg.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in neutral yet, index '+this.place)};pa.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=fr(n.lat0>0?90:-90))}function l3(n){var t=EG(n),e=t[0],i={};return Ic(t,i),o3(i),i[e]}function vi(n){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?vi[n]=yv(arguments[1]):vi[n]=l3(arguments[1]):vi[n]=e}else if(arguments.length===1){if(Array.isArray(n))return n.map(function(i){Array.isArray(i)?vi.apply(t,i):vi(i)});if(typeof n=="string"){if(n in vi)return vi[n]}else"EPSG"in n?vi["EPSG:"+n.EPSG]=n:"ESRI"in n?vi["ESRI:"+n.ESRI]=n:"IAU2000"in n?vi["IAU2000:"+n.IAU2000]=n:console.log(n);return}}mG(vi);function PG(n){return typeof n=="string"}function IG(n){return n in vi}var LG=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function DG(n){return LG.some(function(t){return n.indexOf(t)>-1})}var NG=["3857","900913","3785","102113"];function OG(n){var t=Ka(n,"authority");if(t){var e=Ka(t,"epsg");return e&&NG.indexOf(e)>-1}}function FG(n){var t=Ka(n,"extension");if(t)return Ka(t,"proj4")}function UG(n){return n[0]==="+"}function kG(n){if(PG(n)){if(IG(n))return vi[n];if(DG(n)){var t=l3(n);if(OG(t))return vi["EPSG:3857"];var e=FG(t);return e?yv(e):t}if(UG(n))return yv(n)}else return n}function uA(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 Pr(n,t,e){var i=n*t;return e/Math.sqrt(1-i*i)}function Gf(n){return n<0?-1:1}function $t(n){return Math.abs(n)<=vn?n:n-Gf(n)*af}function Ws(n,t,e){var i=n*e,s=.5*n;return i=Math.pow((1-i)/(1+i),s),Math.tan(.5*(Dt-t))/i}function lf(n,t){for(var e=.5*n,i,s,r=Dt-2*Math.atan(t),a=0;a<=15;a++)if(i=n*Math.sin(r),s=Dt-2*Math.atan(t*Math.pow((1-i)/(1+i),e))-r,r+=s,Math.abs(s)<=1e-10)return r;return-9999}function zG(){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=Pr(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function BG(n){var t=n.x,e=n.y;if(e*Mr>90&&e*Mr<-90&&t*Mr>180&&t*Mr<-180)return null;var i,s;if(Math.abs(Math.abs(e)-Dt)<=qt)return null;if(this.sphere)i=this.x0+this.a*this.k0*$t(t-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan($e+.5*e));else{var r=Math.sin(e),a=Ws(this.e,e,r);i=this.x0+this.a*this.k0*$t(t-this.long0),s=this.y0-this.a*this.k0*Math.log(a)}return n.x=i,n.y=s,n}function HG(n){var t=n.x-this.x0,e=n.y-this.y0,i,s;if(this.sphere)s=Dt-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var r=Math.exp(-e/(this.a*this.k0));if(s=lf(this.e,r),s===-9999)return null}return i=$t(this.long0+t/(this.a*this.k0)),n.x=i,n.y=s,n}var GG=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const VG={init:zG,forward:BG,inverse:HG,names:GG};function WG(){}function fA(n){return n}var jG=["longlat","identity"];const XG={init:WG,forward:fA,inverse:fA,names:jG};var qG=[VG,XG],Lm={},C0=[];function c3(n,t){var e=C0.length;return n.names?(C0[e]=n,n.names.forEach(function(i){Lm[i.toLowerCase()]=e}),this):(console.log(t),!0)}function YG(n){if(!n)return!1;var t=n.toLowerCase();if(typeof Lm[t]<"u"&&C0[Lm[t]])return C0[Lm[t]]}function $G(){qG.forEach(c3)}const ZG={start:$G,add:c3,get:YG};var we={};we.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};we.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};we.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};we.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};we.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};we.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};we.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};we.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};we.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};we.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};we.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};we.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};we.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};we.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};we.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};we.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};we.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};we.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};we.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};we.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};we.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};we.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};we.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};we.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};we.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};we.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};we.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};we.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};we.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};we.hough={a:6378270,rf:297,ellipseName:"Hough"};we.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};we.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};we.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};we.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};we.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};we.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};we.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};we.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};we.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};we.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};we.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};we.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var KG=we.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};we.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function JG(n,t,e,i){var s=n*n,r=t*t,a=(s-r)/s,o=0;i?(n*=1-a*(_G+a*(xG+a*vG)),s=n*n,a=0):o=Math.sqrt(a);var l=(s-r)/r;return{es:a,e:o,ep2:l}}function QG(n,t,e,i,s){if(!n){var r=Ka(we,i);r||(r=KG),n=r.a,t=r.b,e=r.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=gl,o.datum_params[3]*=Du,o.datum_params[4]*=Du,o.datum_params[5]*=Du,o.datum_params[6]=o.datum_params[6]/1e6+1)),a&&(o.datum_type=Bc,o.grids=a),o.a=e,o.b=i,o.es=s,o.ep2=r,o}var h3={};function nV(n,t){var e=new DataView(t),i=rV(e),s=aV(e,i),r=oV(e,s,i),a={header:s,subgrids:r};return h3[n]=a,a}function iV(n){if(n===void 0)return null;var t=n.split(",");return t.map(sV)}function sV(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:h3[n]||null,isNull:!1}}function Lc(n){return n/3600*Math.PI/180}function rV(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 aV(n,t){return{nFields:n.getInt32(8,t),nSubgridFields:n.getInt32(24,t),nSubgrids:n.getInt32(40,t),shiftType:_v(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 _v(n,t,e){return String.fromCharCode.apply(null,new Uint8Array(n.buffer.slice(t,e)))}function oV(n,t,e){for(var i=176,s=[],r=0;r5e-11?!1:n.datum_type===ml?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===gl?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 u3(n,t,e){var i=n.x,s=n.y,r=n.z?n.z:0,a,o,l,c;if(s<-Dt&&s>-1.001*Dt)s=-Dt;else if(s>Dt&&s<1.001*Dt)s=Dt;else{if(s<-Dt)return{x:-1/0,y:-1/0,z:n.z};if(s>Dt)return{x:1/0,y:1/0,z:n.z}}return i>Math.PI&&(i-=2*Math.PI),o=Math.sin(s),c=Math.cos(s),l=o*o,a=e/Math.sqrt(1-t*l),{x:(a+r)*c*Math.cos(i),y:(a+r)*c*Math.sin(i),z:(a*(1-t)+r)*o}}function f3(n,t,e,i){var s=1e-12,r=s*s,a=30,o,l,c,h,u,p,m,g,x,y,_,b,S,w=n.x,R=n.y,T=n.z?n.z:0,C,L,P;if(o=Math.sqrt(w*w+R*R),l=Math.sqrt(w*w+R*R+T*T),o/er&&Si.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=$t(r.x+e.ll[0]),i.y=r.y+e.ll[1]}else isNaN(r.x)||(i.x=n.x+r.x,i.y=n.y+r.y);return i}function mA(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)},s={x:e.x-1*i.x,y:e.y-1*i.y},r={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 r;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=s.x*s.y,p=s.x*(1-s.y),m=(1-s.x)*(1-s.y),g=(1-s.x)*s.y;return r.x=m*o.x+p*l.x+g*h.x+u*c.x,r.y=m*o.y+p*l.y+g*h.y+u*c.y,r}function gA(n,t,e){var i=e.x,s=e.y,r=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=s,"ns".indexOf(n.axis[l])!==-1?o="y":o="x"):(a=r,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 d3(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 gV(n){yA(n.x),yA(n.y)}function yA(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 yV(n,t){return(n.datum.datum_type===ml||n.datum.datum_type===gl||n.datum.datum_type===Bc)&&t.datumCode!=="WGS84"||(t.datum.datum_type===ml||t.datum.datum_type===gl||t.datum.datum_type===Bc)&&n.datumCode!=="WGS84"}function R0(n,t,e,i){var s;Array.isArray(e)?e=d3(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var r=e.z!==void 0;if(gV(e),n.datum&&t.datum&&yV(n,t)&&(s=new Ar("WGS84"),e=R0(n,s,e,i),n=s),i&&n.axis!=="enu"&&(e=gA(n,!1,e)),n.projName==="longlat")e={x:e.x*Xn,y:e.y*Xn,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=pV(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*Mr,y:e.y*Mr,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"?gA(t,!0,e):(e&&!r&&delete e.z,e)}var _A=Ar("WGS84");function mx(n,t,e,i){var s,r,a;return Array.isArray(e)?(s=R0(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 s.z=="number"?[s.x,s.y,s.z].concat(e.slice(3)):[s.x,s.y,e[2]].concat(e.slice(3)):[s.x,s.y].concat(e.slice(2)):[s.x,s.y]):(r=R0(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;r[o]=e[o]}),r)}function xA(n){return n instanceof Ar?n:n.oProj?n.oProj:Ar(n)}function Ts(n,t,e){n=xA(n);var i=!1,s;return typeof t>"u"?(t=n,n=_A,i=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,t=n,n=_A,i=!0),t=xA(t),e?mx(n,t,e):(s={forward:function(r,a){return mx(n,t,r,a)},inverse:function(r,a){return mx(t,n,r,a)}},i&&(s.oProj=t),s)}var vA=6,p3="AJSAJS",m3="AFAFAF",Dc=65,Oi=73,xs=79,mu=86,gu=90;const _V={forward:g3,inverse:xV,toPoint:y3};function g3(n,t){return t=t||5,bV(vV({lat:n[1],lon:n[0]}),t)}function xV(n){var t=fM(x3(n.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function y3(n){var t=fM(x3(n.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function gx(n){return n*(Math.PI/180)}function MA(n){return 180*(n/Math.PI)}function vV(n){var t=n.lat,e=n.lon,i=6378137,s=.00669438,r=.9996,a,o,l,c,h,u,p,m=gx(t),g=gx(e),x,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,x=gx(a),o=s/(1-s),l=i/Math.sqrt(1-s*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-x),p=i*((1-s/4-3*s*s/64-5*s*s*s/256)*m-(3*s/8+3*s*s/32+45*s*s*s/1024)*Math.sin(2*m)+(15*s*s/256+45*s*s*s/1024)*Math.sin(4*m)-35*s*s*s/3072*Math.sin(6*m));var _=r*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,b=r*(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&&(b+=1e7),{northing:Math.round(b),easting:Math.round(_),zoneNumber:y,zoneLetter:MV(t)}}function fM(n){var t=n.northing,e=n.easting,i=n.zoneLetter,s=n.zoneNumber;if(s<0||s>60)return null;var r=.9996,a=6378137,o=.00669438,l,c=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),h,u,p,m,g,x,y,_,b,S=e-5e5,w=t;i<"N"&&(w-=1e7),y=(s-1)*6-180+3,l=o/(1-o),x=w/r,_=x/(a*(1-o/4-3*o*o/64-5*o*o*o/256)),b=_+(3*c/2-27*c*c*c/32)*Math.sin(2*_)+(21*c*c/16-55*c*c*c*c/32)*Math.sin(4*_)+151*c*c*c/96*Math.sin(6*_),h=a/Math.sqrt(1-o*Math.sin(b)*Math.sin(b)),u=Math.tan(b)*Math.tan(b),p=l*Math.cos(b)*Math.cos(b),m=a*(1-o)/Math.pow(1-o*Math.sin(b)*Math.sin(b),1.5),g=S/(h*r);var R=b-h*Math.tan(b)/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=MA(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(b);T=y+MA(T);var C;if(n.accuracy){var L=fM({northing:n.northing+n.accuracy,easting:n.easting+n.accuracy,zoneLetter:n.zoneLetter,zoneNumber:n.zoneNumber});C={top:L.lat,right:L.lon,bottom:R,left:T}}else C={lat:R,lon:T};return C}function MV(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 bV(n,t){var e="00000"+n.easting,i="00000"+n.northing;return n.zoneNumber+n.zoneLetter+wV(n.easting,n.northing,n.zoneNumber)+e.substr(e.length-5,t)+i.substr(i.length-5,t)}function wV(n,t,e){var i=_3(e),s=Math.floor(n/1e5),r=Math.floor(t/1e5)%20;return SV(s,r,i)}function _3(n){var t=n%vA;return t===0&&(t=vA),t}function SV(n,t,e){var i=e-1,s=p3.charCodeAt(i),r=m3.charCodeAt(i),a=s+n-1,o=r+t,l=!1;a>gu&&(a=a-gu+Dc-1,l=!0),(a===Oi||sOi||(a>Oi||sxs||(a>xs||sgu&&(a=a-gu+Dc-1),o>mu?(o=o-mu+Dc-1,l=!0):l=!1,(o===Oi||rOi||(o>Oi||rxs||(o>xs||rmu&&(o=o-mu+Dc-1);var c=String.fromCharCode(a)+String.fromCharCode(o);return c}function x3(n){if(n&&n.length===0)throw"MGRSPoint coverting from nothing";for(var t=n.length,e=null,i="",s,r=0;!/[A-Z]/.test(s=n.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+n;i+=s,r++}var a=parseInt(i,10);if(r===0||r+3>t)throw"MGRSPoint bad conversion from: "+n;var o=n.charAt(r++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+n;e=n.substring(r,r+=2);for(var l=_3(a),c=EV(e.charAt(0),l),h=AV(e.charAt(1),l);h{if(!i[Z].isShadedByElevation){s(Z,i.length);let it=l.getUniformLocation(m,"u_sun_direction");l.uniform3fv(it,[i[Z].vector.cartesian.x,i[Z].vector.cartesian.y,i[Z].vector.cartesian.z]),kG(l,S,l.POINTS,o),H==null?(ot=fA(l,b,o),H=ot.filter(($,lt)=>(lt+1)%4===0)):(ot=fA(l,b,o),NG(H,ot.filter(($,lt)=>(lt+1)%4===0)))}}),l.deleteTexture(w),l.deleteShader(u),l.deleteShader(p),l.deleteProgram(m),l.deleteBuffer(Q),l.deleteBuffer(Y),l.deleteTransformFeedback(S),l.deleteBuffer(b),H}function fA(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 dA(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 FG(n,t,e,i){const s=n.createProgram();if(s===null||t===null||e===null)throw new Error("abortSimulation");if(n.attachShader(s,t),n.attachShader(s,e),n.transformFeedbackVaryings(s,i,n.SEPARATE_ATTRIBS),n.linkProgram(s),n.getProgramParameter(s,n.LINK_STATUS))return s;throw console.error(n.getProgramInfoLog(s)),n.deleteProgram(s),new Error("Program compilation error.")}function n3(n,t){const e=n.createBuffer();return n.bindBuffer(n.ARRAY_BUFFER,e),n.bufferData(n.ARRAY_BUFFER,t,n.DYNAMIC_DRAW),e}function UG(n,t){const e=n.createTransformFeedback();return n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,e),n.bindBufferBase(n.TRANSFORM_FEEDBACK_BUFFER,0,t),e}function pA(n,t,e){const i=n3(n,t);return n.enableVertexAttribArray(e),n.vertexAttribPointer(e,3,n.FLOAT,!1,0,0),i}function kG(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 i3=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=e3}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=[],s=[];for(let l=0;lc[p%3]))}let r=new Bf;const a=new Float32Array(s),o=new Float32Array(i);return r.setAttribute("position",new la(o,3)),r.setAttribute("normal",new la(a,3)),r.attributes.position.needsUpdate=!0,r.attributes.normal.needsUpdate=!0,r}async calculate(n={}){const{numberSimulations:t=80,diffuseIrradianceURL:e,pvCellEfficiency:i=.2,maxYieldPerSquareMeter:s=1400*.2,progressCallback:r=(T,C)=>console.log(`Progress: ${T}/${C}%`),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=rA(this.simulationGeometries),c=rA(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 T=0;T0&&console.log(`${m}/${g.length} midpoints are nan`);const x=new Float32Array(g.slice());let y=0;for(let T=0;T0&&console.log(`${y}/${h.length} mesh coordinates are nan`),console.log("Calling this.rayTrace");const _=typeof e=="string",b=_?2:1,S=await this.rayTrace(x,p,h,t,void 0,(T,C)=>r(T,C*b));let w=new Float32Array;_&&(w=await this.rayTrace(x,p,h,0,e,(T,C)=>r(T+C,C*b))),console.log("directIntensities",S),console.log("diffuseIntensities",w);const R=await CG(S,w,i,this.latitude,this.longitude,a,o);return console.log("finalIntensities",R),this.createMesh(l,R,s)}createMesh(n,t,e){const i=n.attributes.position.array.length/9;for(var s=new Float32Array(i*9),r=0;r0)a=wG(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=bG(this.elevationRaster,this.elevationRasterMidpoint,this.elevationAzimuthDivisions),TG(a,o)),t=t.filter((c,h)=>h%9<3);let l=await OG(n,t,e,a,r);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 of:return this.neutral(n);case s3:return this.keyword(n);case T0:return this.quoted(n);case a3:return this.afterquote(n);case r3:return this.number(n);case fM:return}};pa.prototype.afterquote=function(n){if(n==='"'){this.word+='"',this.state=T0;return}if(Cg.test(n)){this.word=this.word.trim(),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in afterquote yet, index '+this.place)};pa.prototype.afterItem=function(n){if(n===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=of;return}if(n==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=of,this.currentObject=this.stack.pop(),this.currentObject||(this.state=fM);return}};pa.prototype.number=function(n){if(o3.test(n)){this.word+=n;return}if(Cg.test(n)){this.word=parseFloat(this.word),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in number yet, index '+this.place)};pa.prototype.quoted=function(n){if(n==='"'){this.state=a3;return}this.word+=n};pa.prototype.keyword=function(n){if(YG.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=of;return}if(Cg.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in keyword yet, index '+this.place)};pa.prototype.neutral=function(n){if(qG.test(n)){this.word=n,this.state=s3;return}if(n==='"'){this.word="",this.state=T0;return}if(o3.test(n)){this.word=n,this.state=r3;return}if(Cg.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in neutral yet, index '+this.place)};pa.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=fr(n.lat0>0?90:-90))}function c3(n){var t=$G(n),e=t[0],i={};return Ic(t,i),l3(i),i[e]}function vi(n){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?vi[n]=yv(arguments[1]):vi[n]=c3(arguments[1]):vi[n]=e}else if(arguments.length===1){if(Array.isArray(n))return n.map(function(i){Array.isArray(i)?vi.apply(t,i):vi(i)});if(typeof n=="string"){if(n in vi)return vi[n]}else"EPSG"in n?vi["EPSG:"+n.EPSG]=n:"ESRI"in n?vi["ESRI:"+n.ESRI]=n:"IAU2000"in n?vi["IAU2000:"+n.IAU2000]=n:console.log(n);return}}zG(vi);function tV(n){return typeof n=="string"}function eV(n){return n in vi}var nV=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function iV(n){return nV.some(function(t){return n.indexOf(t)>-1})}var sV=["3857","900913","3785","102113"];function rV(n){var t=Ka(n,"authority");if(t){var e=Ka(t,"epsg");return e&&sV.indexOf(e)>-1}}function aV(n){var t=Ka(n,"extension");if(t)return Ka(t,"proj4")}function oV(n){return n[0]==="+"}function lV(n){if(tV(n)){if(eV(n))return vi[n];if(iV(n)){var t=c3(n);if(rV(t))return vi["EPSG:3857"];var e=aV(t);return e?yv(e):t}if(oV(n))return yv(n)}else return n}function _A(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 Pr(n,t,e){var i=n*t;return e/Math.sqrt(1-i*i)}function Gf(n){return n<0?-1:1}function $t(n){return Math.abs(n)<=vn?n:n-Gf(n)*af}function Ws(n,t,e){var i=n*e,s=.5*n;return i=Math.pow((1-i)/(1+i),s),Math.tan(.5*(Dt-t))/i}function lf(n,t){for(var e=.5*n,i,s,r=Dt-2*Math.atan(t),a=0;a<=15;a++)if(i=n*Math.sin(r),s=Dt-2*Math.atan(t*Math.pow((1-i)/(1+i),e))-r,r+=s,Math.abs(s)<=1e-10)return r;return-9999}function cV(){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=Pr(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function hV(n){var t=n.x,e=n.y;if(e*Mr>90&&e*Mr<-90&&t*Mr>180&&t*Mr<-180)return null;var i,s;if(Math.abs(Math.abs(e)-Dt)<=qt)return null;if(this.sphere)i=this.x0+this.a*this.k0*$t(t-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan($e+.5*e));else{var r=Math.sin(e),a=Ws(this.e,e,r);i=this.x0+this.a*this.k0*$t(t-this.long0),s=this.y0-this.a*this.k0*Math.log(a)}return n.x=i,n.y=s,n}function uV(n){var t=n.x-this.x0,e=n.y-this.y0,i,s;if(this.sphere)s=Dt-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var r=Math.exp(-e/(this.a*this.k0));if(s=lf(this.e,r),s===-9999)return null}return i=$t(this.long0+t/(this.a*this.k0)),n.x=i,n.y=s,n}var fV=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const dV={init:cV,forward:hV,inverse:uV,names:fV};function pV(){}function xA(n){return n}var mV=["longlat","identity"];const gV={init:pV,forward:xA,inverse:xA,names:mV};var yV=[dV,gV],Lm={},C0=[];function h3(n,t){var e=C0.length;return n.names?(C0[e]=n,n.names.forEach(function(i){Lm[i.toLowerCase()]=e}),this):(console.log(t),!0)}function _V(n){if(!n)return!1;var t=n.toLowerCase();if(typeof Lm[t]<"u"&&C0[Lm[t]])return C0[Lm[t]]}function xV(){yV.forEach(h3)}const vV={start:xV,add:h3,get:_V};var we={};we.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};we.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};we.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};we.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};we.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};we.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};we.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};we.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};we.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};we.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};we.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};we.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};we.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};we.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};we.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};we.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};we.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};we.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};we.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};we.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};we.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};we.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};we.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};we.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};we.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};we.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};we.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};we.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};we.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};we.hough={a:6378270,rf:297,ellipseName:"Hough"};we.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};we.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};we.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};we.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};we.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};we.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};we.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};we.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};we.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};we.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};we.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};we.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var MV=we.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};we.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function bV(n,t,e,i){var s=n*n,r=t*t,a=(s-r)/s,o=0;i?(n*=1-a*(GG+a*(VG+a*WG)),s=n*n,a=0):o=Math.sqrt(a);var l=(s-r)/r;return{es:a,e:o,ep2:l}}function wV(n,t,e,i,s){if(!n){var r=Ka(we,i);r||(r=MV),n=r.a,t=r.b,e=r.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=gl,o.datum_params[3]*=Du,o.datum_params[4]*=Du,o.datum_params[5]*=Du,o.datum_params[6]=o.datum_params[6]/1e6+1)),a&&(o.datum_type=Bc,o.grids=a),o.a=e,o.b=i,o.es=s,o.ep2=r,o}var u3={};function AV(n,t){var e=new DataView(t),i=RV(e),s=PV(e,i),r=IV(e,s,i),a={header:s,subgrids:r};return u3[n]=a,a}function TV(n){if(n===void 0)return null;var t=n.split(",");return t.map(CV)}function CV(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:u3[n]||null,isNull:!1}}function Lc(n){return n/3600*Math.PI/180}function RV(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 PV(n,t){return{nFields:n.getInt32(8,t),nSubgridFields:n.getInt32(24,t),nSubgrids:n.getInt32(40,t),shiftType:_v(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 _v(n,t,e){return String.fromCharCode.apply(null,new Uint8Array(n.buffer.slice(t,e)))}function IV(n,t,e){for(var i=176,s=[],r=0;r5e-11?!1:n.datum_type===ml?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===gl?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 f3(n,t,e){var i=n.x,s=n.y,r=n.z?n.z:0,a,o,l,c;if(s<-Dt&&s>-1.001*Dt)s=-Dt;else if(s>Dt&&s<1.001*Dt)s=Dt;else{if(s<-Dt)return{x:-1/0,y:-1/0,z:n.z};if(s>Dt)return{x:1/0,y:1/0,z:n.z}}return i>Math.PI&&(i-=2*Math.PI),o=Math.sin(s),c=Math.cos(s),l=o*o,a=e/Math.sqrt(1-t*l),{x:(a+r)*c*Math.cos(i),y:(a+r)*c*Math.sin(i),z:(a*(1-t)+r)*o}}function d3(n,t,e,i){var s=1e-12,r=s*s,a=30,o,l,c,h,u,p,m,g,x,y,_,b,S,w=n.x,R=n.y,T=n.z?n.z:0,C,L,P;if(o=Math.sqrt(w*w+R*R),l=Math.sqrt(w*w+R*R+T*T),o/er&&Si.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=$t(r.x+e.ll[0]),i.y=r.y+e.ll[1]}else isNaN(r.x)||(i.x=n.x+r.x,i.y=n.y+r.y);return i}function bA(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)},s={x:e.x-1*i.x,y:e.y-1*i.y},r={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 r;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=s.x*s.y,p=s.x*(1-s.y),m=(1-s.x)*(1-s.y),g=(1-s.x)*s.y;return r.x=m*o.x+p*l.x+g*h.x+u*c.x,r.y=m*o.y+p*l.y+g*h.y+u*c.y,r}function wA(n,t,e){var i=e.x,s=e.y,r=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=s,"ns".indexOf(n.axis[l])!==-1?o="y":o="x"):(a=r,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 p3(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 BV(n){SA(n.x),SA(n.y)}function SA(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 HV(n,t){return(n.datum.datum_type===ml||n.datum.datum_type===gl||n.datum.datum_type===Bc)&&t.datumCode!=="WGS84"||(t.datum.datum_type===ml||t.datum.datum_type===gl||t.datum.datum_type===Bc)&&n.datumCode!=="WGS84"}function R0(n,t,e,i){var s;Array.isArray(e)?e=p3(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var r=e.z!==void 0;if(BV(e),n.datum&&t.datum&&HV(n,t)&&(s=new Ar("WGS84"),e=R0(n,s,e,i),n=s),i&&n.axis!=="enu"&&(e=wA(n,!1,e)),n.projName==="longlat")e={x:e.x*Xn,y:e.y*Xn,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=kV(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*Mr,y:e.y*Mr,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"?wA(t,!0,e):(e&&!r&&delete e.z,e)}var EA=Ar("WGS84");function gx(n,t,e,i){var s,r,a;return Array.isArray(e)?(s=R0(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 s.z=="number"?[s.x,s.y,s.z].concat(e.slice(3)):[s.x,s.y,e[2]].concat(e.slice(3)):[s.x,s.y].concat(e.slice(2)):[s.x,s.y]):(r=R0(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;r[o]=e[o]}),r)}function AA(n){return n instanceof Ar?n:n.oProj?n.oProj:Ar(n)}function Ts(n,t,e){n=AA(n);var i=!1,s;return typeof t>"u"?(t=n,n=EA,i=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,t=n,n=EA,i=!0),t=AA(t),e?gx(n,t,e):(s={forward:function(r,a){return gx(n,t,r,a)},inverse:function(r,a){return gx(t,n,r,a)}},i&&(s.oProj=t),s)}var TA=6,m3="AJSAJS",g3="AFAFAF",Dc=65,Oi=73,xs=79,mu=86,gu=90;const GV={forward:y3,inverse:VV,toPoint:_3};function y3(n,t){return t=t||5,XV(WV({lat:n[1],lon:n[0]}),t)}function VV(n){var t=dM(v3(n.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function _3(n){var t=dM(v3(n.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function yx(n){return n*(Math.PI/180)}function CA(n){return 180*(n/Math.PI)}function WV(n){var t=n.lat,e=n.lon,i=6378137,s=.00669438,r=.9996,a,o,l,c,h,u,p,m=yx(t),g=yx(e),x,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,x=yx(a),o=s/(1-s),l=i/Math.sqrt(1-s*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-x),p=i*((1-s/4-3*s*s/64-5*s*s*s/256)*m-(3*s/8+3*s*s/32+45*s*s*s/1024)*Math.sin(2*m)+(15*s*s/256+45*s*s*s/1024)*Math.sin(4*m)-35*s*s*s/3072*Math.sin(6*m));var _=r*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,b=r*(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&&(b+=1e7),{northing:Math.round(b),easting:Math.round(_),zoneNumber:y,zoneLetter:jV(t)}}function dM(n){var t=n.northing,e=n.easting,i=n.zoneLetter,s=n.zoneNumber;if(s<0||s>60)return null;var r=.9996,a=6378137,o=.00669438,l,c=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),h,u,p,m,g,x,y,_,b,S=e-5e5,w=t;i<"N"&&(w-=1e7),y=(s-1)*6-180+3,l=o/(1-o),x=w/r,_=x/(a*(1-o/4-3*o*o/64-5*o*o*o/256)),b=_+(3*c/2-27*c*c*c/32)*Math.sin(2*_)+(21*c*c/16-55*c*c*c*c/32)*Math.sin(4*_)+151*c*c*c/96*Math.sin(6*_),h=a/Math.sqrt(1-o*Math.sin(b)*Math.sin(b)),u=Math.tan(b)*Math.tan(b),p=l*Math.cos(b)*Math.cos(b),m=a*(1-o)/Math.pow(1-o*Math.sin(b)*Math.sin(b),1.5),g=S/(h*r);var R=b-h*Math.tan(b)/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=CA(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(b);T=y+CA(T);var C;if(n.accuracy){var L=dM({northing:n.northing+n.accuracy,easting:n.easting+n.accuracy,zoneLetter:n.zoneLetter,zoneNumber:n.zoneNumber});C={top:L.lat,right:L.lon,bottom:R,left:T}}else C={lat:R,lon:T};return C}function jV(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 XV(n,t){var e="00000"+n.easting,i="00000"+n.northing;return n.zoneNumber+n.zoneLetter+qV(n.easting,n.northing,n.zoneNumber)+e.substr(e.length-5,t)+i.substr(i.length-5,t)}function qV(n,t,e){var i=x3(e),s=Math.floor(n/1e5),r=Math.floor(t/1e5)%20;return YV(s,r,i)}function x3(n){var t=n%TA;return t===0&&(t=TA),t}function YV(n,t,e){var i=e-1,s=m3.charCodeAt(i),r=g3.charCodeAt(i),a=s+n-1,o=r+t,l=!1;a>gu&&(a=a-gu+Dc-1,l=!0),(a===Oi||sOi||(a>Oi||sxs||(a>xs||sgu&&(a=a-gu+Dc-1),o>mu?(o=o-mu+Dc-1,l=!0):l=!1,(o===Oi||rOi||(o>Oi||rxs||(o>xs||rmu&&(o=o-mu+Dc-1);var c=String.fromCharCode(a)+String.fromCharCode(o);return c}function v3(n){if(n&&n.length===0)throw"MGRSPoint coverting from nothing";for(var t=n.length,e=null,i="",s,r=0;!/[A-Z]/.test(s=n.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+n;i+=s,r++}var a=parseInt(i,10);if(r===0||r+3>t)throw"MGRSPoint bad conversion from: "+n;var o=n.charAt(r++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+n;e=n.substring(r,r+=2);for(var l=x3(a),c=$V(e.charAt(0),l),h=ZV(e.charAt(1),l);h0&&(x=1e5/Math.pow(10,p),y=n.substring(r,r+p),m=parseFloat(y)*x,_=n.substring(r+p),g=parseFloat(_)*x),b=m+c,S=g+h,{easting:b,northing:S,zoneLetter:o,zoneNumber:a,accuracy:x}}function EV(n,t){for(var e=p3.charCodeAt(t-1),i=1e5,s=!1;e!==n.charCodeAt(0);){if(e++,e===Oi&&e++,e===xs&&e++,e>gu){if(s)throw"Bad character: "+n;e=Dc,s=!0}i+=1e5}return i}function AV(n,t){if(n>"V")throw"MGRSPoint given invalid Northing "+n;for(var e=m3.charCodeAt(t-1),i=0,s=!1;e!==n.charCodeAt(0);){if(e++,e===Oi&&e++,e===xs&&e++,e>mu){if(s)throw"Bad character: "+n;e=Dc,s=!0}i+=1e5}return i}function TV(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 sh(n,t,e){if(!(this instanceof sh))return new sh(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")}sh.fromMGRS=function(n){return new sh(y3(n))};sh.prototype.toMGRS=function(n){return g3([this.x,this.y],n)};var CV=1,RV=.25,bA=.046875,wA=.01953125,SA=.01068115234375,PV=.75,IV=.46875,LV=.013020833333333334,DV=.007120768229166667,NV=.3645833333333333,OV=.005696614583333333,FV=.3076171875;function dM(n){var t=[];t[0]=CV-n*(RV+n*(bA+n*(wA+n*SA))),t[1]=n*(PV-n*(bA+n*(wA+n*SA)));var e=n*n;return t[2]=e*(IV-n*(LV+n*DV)),e*=n,t[3]=e*(NV-n*OV),t[4]=e*n*FV,t}function xh(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 UV=20;function pM(n,t,e){for(var i=1/(1-t),s=n,r=UV;r;--r){var a=Math.sin(s),o=1-t*a*a;if(o=(xh(s,a,Math.cos(s),e)-n)*(o*Math.sqrt(o))*i,s-=o,Math.abs(o)qt?Math.tan(e):0,x=Math.pow(g,2),y=Math.pow(x,2);s=1-this.es*Math.pow(o,2),h=h/Math.sqrt(s);var _=xh(e,o,l,this.en);r=this.a*(this.k0*h*(1+u/6*(1-x+p+u/20*(5-18*x+y+14*p-58*x*p+u/42*(61+179*y-y*x-479*x)))))+this.x0,a=this.a*(this.k0*(_-this.ml0+o*i*h/2*(1+u/12*(5-x+9*p+4*m+u/30*(61+y-58*x+270*p-330*x*p+u/56*(1385+543*y-y*x-3111*x))))))+this.y0}else{var c=l*Math.sin(i);if(Math.abs(Math.abs(c)-1)=1){if(c-1>qt)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=r,n.y=a,n}function BV(n){var t,e,i,s,r=(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=pM(t,this.es,this.en),Math.abs(e)qt?Math.tan(e):0,g=this.ep2*Math.pow(p,2),x=Math.pow(g,2),y=Math.pow(m,2),_=Math.pow(y,2);t=1-this.es*Math.pow(u,2);var b=r*Math.sqrt(t)/this.k0,S=Math.pow(b,2);t=t*m,i=e-t*S/(1-this.es)*.5*(1-S/12*(5+3*y-9*g*y+g-4*x-S/30*(61+90*y-252*g*y+45*_+46*g-S/56*(1385+3633*y+4095*_+1574*_*y)))),s=$t(this.long0+b*(1-S/6*(1+2*y+g-S/20*(5+28*y+24*_+8*g*y+6*g-S/42*(61+662*y+1320*_+720*_*y))))/p)}else i=Dt*Gf(a),s=0;else{var o=Math.exp(r/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?s=0:s=$t(Math.atan2(l,h)+this.long0)}return n.x=s,n.y=i,n}var HV=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Nm={init:kV,forward:zV,inverse:BV,names:HV};function v3(n){var t=Math.exp(n);return t=(t-1/t)/2,t}function Ui(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 GV(n){var t=1+n,e=t-1;return e===0?n:n*Math.log(t)/e}function VV(n){var t=Math.abs(n);return t=GV(t*(1+t/(Ui(1,t)+1))),n<0?-t:t}function mM(n,t){for(var e=2*Math.cos(2*t),i=n.length-1,s=n[i],r=0,a;--i>=0;)a=-r+e*s+n[i],r=s,s=a;return t+a*Math.sin(2*t)}function WV(n,t){for(var e=2*Math.cos(t),i=n.length-1,s=n[i],r=0,a;--i>=0;)a=-r+e*s+n[i],r=s,s=a;return Math.sin(t)*a}function jV(n){var t=Math.exp(n);return t=(t+1/t)/2,t}function M3(n,t,e){for(var i=Math.sin(t),s=Math.cos(t),r=v3(e),a=jV(e),o=2*s*a,l=-2*i*r,c=n.length-1,h=n[c],u=0,p=0,m=0,g,x;--c>=0;)g=p,x=u,p=h,u=m,h=-g+o*p-l*u+n[c],m=-x+l*p+o*u;return o=i*a,l=s*r,[o*h-l*m,o*m+l*h]}function XV(){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=mM(this.cbg,this.lat0);this.Zb=-this.Qn*(i+WV(this.gtu,2*i))}function qV(n){var t=$t(n.x-this.long0),e=n.y;e=mM(this.cbg,e);var i=Math.sin(e),s=Math.cos(e),r=Math.sin(t),a=Math.cos(t);e=Math.atan2(i,a*s),t=Math.atan2(r*s,Ui(i,s*a)),t=VV(Math.tan(t));var o=M3(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 YV(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,s;if(Math.abs(t)<=2.623395162778){var r=M3(this.utg,2*e,2*t);e=e+r[0],t=t+r[1],t=Math.atan(v3(t));var a=Math.sin(e),o=Math.cos(e),l=Math.sin(t),c=Math.cos(t);e=Math.atan2(a*c,Ui(l,c*o)),t=Math.atan2(l,c*o),i=$t(t+this.long0),s=mM(this.cgb,e)}else i=1/0,s=1/0;return n.x=i,n.y=s,n}var $V=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Om={init:XV,forward:qV,inverse:YV,names:$V};function ZV(n,t){if(n===void 0){if(n=Math.floor(($t(t)+Math.PI)*30/Math.PI)+1,n<0)return 0;if(n>60)return 60}return n}var KV="etmerc";function JV(){var n=ZV(this.zone,this.long0);if(n===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(n)-183)*Xn,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 QV=["Universal Transverse Mercator System","utm"];const t9={init:JV,names:QV,dependsOn:KV};function gM(n,t){return Math.pow((1-n)/(1+n),t)}var e9=20;function n9(){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+$e)/(Math.pow(Math.tan(.5*this.lat0+$e),this.C)*gM(this.e*n,this.ratexp))}function i9(n){var t=n.x,e=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+$e),this.C)*gM(this.e*Math.sin(e),this.ratexp))-Dt,n.x=this.C*t,n}function s9(n){for(var t=1e-14,e=n.x/this.C,i=n.y,s=Math.pow(Math.tan(.5*i+$e)/this.K,1/this.C),r=e9;r>0&&(i=2*Math.atan(s*gM(this.e*Math.sin(n.y),-.5*this.e))-Dt,!(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)<=qt&&Math.abs(Math.cos(this.lat_ts))>qt&&(this.k0=.5*this.cons*Pr(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ws(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Pr(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Dt,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function d9(n){var t=n.x,e=n.y,i=Math.sin(e),s=Math.cos(e),r,a,o,l,c,h,u=$t(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=qt&&Math.abs(e+this.lat0)<=qt?(n.x=NaN,n.y=NaN,n):this.sphere?(r=2*this.k0/(1+this.sinlat0*i+this.coslat0*s*Math.cos(u)),n.x=this.a*r*s*Math.sin(u)+this.x0,n.y=this.a*r*(this.coslat0*i-this.sinlat0*s*Math.cos(u))+this.y0,n):(a=2*Math.atan(this.ssfn_(e,i,this.e))-Dt,l=Math.cos(a),o=Math.sin(a),Math.abs(this.coslat0)<=qt?(c=Ws(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=$t(this.long0+Math.atan2(n.x,-1*n.y)):t=$t(this.long0+Math.atan2(n.x,n.y)):t=$t(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)<=qt){if(a<=qt)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*lf(this.e,i),t=this.con*$t(this.con*this.long0+Math.atan2(n.x,-1*n.y))}else s=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=qt?r=this.X0:(r=Math.asin(Math.cos(s)*this.sinX0+n.y*Math.sin(s)*this.cosX0/a),t=$t(this.long0+Math.atan2(n.x*Math.sin(s),a*this.cosX0*Math.cos(s)-n.y*this.sinX0*Math.sin(s)))),e=-1*lf(this.e,Math.tan(.5*(Dt+r)));return n.x=t,n.y=e,n}var m9=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const g9={init:f9,forward:d9,inverse:p9,names:m9,ssfn_:u9};function y9(){var n=this.lat0;this.lambda0=this.long0;var t=Math.sin(n),e=this.a,i=this.rf,s=1/i,r=2*s-Math.pow(s,2),a=this.e=Math.sqrt(r);this.R=this.k0*e*Math.sqrt(1-r)/(1-r*Math.pow(t,2)),this.alpha=Math.sqrt(1+r/(1-r)*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 _9(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,s=2*(Math.atan(Math.exp(i))-Math.PI/4),r=this.alpha*(n.x-this.lambda0),a=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(r))),o=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(r));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 x9(n){for(var t=n.x-this.x0,e=n.y-this.y0,i=t/this.R,s=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(i)),a=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(s))),o=this.lambda0+a/this.alpha,l=0,c=r,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+r/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 v9=["somerc"];const M9={init:y9,forward:_9,inverse:x9,names:v9};var Ac=1e-7;function b9(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 w9(){var n,t,e,i,s,r,a,o,l,c,h=0,u,p=0,m=0,g=0,x=0,y=0,_=0;this.no_off=b9(this),this.no_rot="no_rot"in this;var b=!1;"alpha"in this&&(b=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),b&&(_=this.alpha),S&&(h=this.rectified_grid_angle*Xn),b||S)p=this.longc;else if(m=this.long1,x=this.lat1,g=this.long2,y=this.lat2,Math.abs(x-y)<=Ac||(n=Math.abs(x))<=Ac||Math.abs(n-Dt)<=Ac||Math.abs(Math.abs(this.lat0)-Dt)<=Ac||Math.abs(Math.abs(y)-Dt)<=Ac)throw new Error;var w=1-this.es;t=Math.sqrt(w),Math.abs(this.lat0)>qt?(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/w),this.A=this.B*this.k0*t/n,i=this.B*t/(e*Math.sqrt(n)),s=i*i-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=i,this.E*=Math.pow(Ws(this.e,this.lat0,o),this.B)):(this.B=1/t,this.A=this.k0,this.E=i=s=1),b||S?(b?(u=Math.asin(Math.sin(_)/i),S||(h=_)):(u=h,_=Math.asin(i*Math.sin(u))),this.lam0=p-Math.asin(.5*(s-1/s)*Math.tan(u))/this.B):(r=Math.pow(Ws(this.e,x,Math.sin(x)),this.B),a=Math.pow(Ws(this.e,y,Math.sin(y)),this.B),s=this.E/r,l=(a-r)/(a+r),c=this.E*this.E,c=(c-a*r)/(c+a*r),n=m-g,n<-Math.pi?g-=af:n>Math.pi&&(g+=af),this.lam0=$t(.5*(m+g)-Math.atan(c*Math.tan(.5*this.B*(m-g))/l)/this.B),u=Math.atan(2*Math.sin(this.B*$t(m-this.lam0))/(s-1/s)),h=_=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(_))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan($e-s)),this.v_pole_s=this.ArB*Math.log(Math.tan($e+s))}function S9(n){var t={},e,i,s,r,a,o,l,c;if(n.x=n.x-this.lam0,Math.abs(Math.abs(n.y)-Dt)>qt){if(a=this.E/Math.pow(Ws(this.e,n.y,Math.sin(n.y)),this.B),o=1/a,e=.5*(a-o),i=.5*(a+o),r=Math.sin(this.B*n.x),s=(e*this.singam-r*this.cosgam)/i,Math.abs(Math.abs(s)-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 E9(n){var t,e,i,s,r,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),s=.5*(i-1/i),r=.5*(i+1/i),a=Math.sin(this.BrA*t),o=(a*this.cosgam+s*this.singam)/r,Math.abs(Math.abs(o)-1)qt?this.ns=Math.log(i/o)/Math.log(s/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=i/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function R9(n){var t=n.x,e=n.y;Math.abs(2*Math.abs(e)-Math.PI)<=qt&&(e=Gf(e)*(Dt-2*qt));var i=Math.abs(Math.abs(e)-Dt),s,r;if(i>qt)s=Ws(this.e,e,Math.sin(e)),r=this.a*this.f0*Math.pow(s,this.ns);else{if(i=e*this.ns,i<=0)return null;r=0}var a=this.ns*$t(t-this.long0);return n.x=this.k0*(r*Math.sin(a))+this.x0,n.y=this.k0*(this.rh-r*Math.cos(a))+this.y0,n}function P9(n){var t,e,i,s,r,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),s=lf(this.e,i),s===-9999)return null}else s=-Dt;return r=$t(l/this.ns+this.long0),n.x=r,n.y=s,n}var I9=["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 L9={init:C9,forward:R9,inverse:P9,names:I9};function D9(){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 N9(n){var t,e,i,s,r,a,o,l=n.x,c=n.y,h=$t(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,s=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(i)),r=Math.asin(Math.cos(e)*Math.sin(i)/Math.cos(s)),a=this.n*r,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/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 O9(n){var t,e,i,s,r,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),r=Math.atan2(n.y,n.x),s=r/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(s)),e=Math.asin(Math.cos(i)*Math.sin(s)/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 F9=["Krovak","krovak"];const U9={init:D9,forward:N9,inverse:O9,names:F9};function bi(n,t,e,i,s){return n*s-t*Math.sin(2*s)+e*Math.sin(4*s)-i*Math.sin(6*s)}function Vf(n){return 1-.25*n*(1+n/16*(3+1.25*n))}function Wf(n){return .375*n*(1+.25*n*(1+.46875*n))}function jf(n){return .05859375*n*n*(1+.75*n)}function Xf(n){return n*n*n*(35/3072)}function rh(n,t,e){var i=t*e;return n/Math.sqrt(1-i*i)}function lo(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 V9=1,W9=2,j9=3,X9=4;function q9(){var n=Math.abs(this.lat0);if(Math.abs(n-Dt)0){var t;switch(this.qp=Wa(this.e,1),this.mmf=.5/(1-this.es),this.apa=n7(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=Wa(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 Y9(n){var t,e,i,s,r,a,o,l,c,h,u=n.x,p=n.y;if(u=$t(u-this.long0),this.sphere){if(r=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*r+this.cosph0*h*i,e<=qt)return null;e=Math.sqrt(2/e),t=e*h*Math.sin(u),e*=this.mode===this.EQUIT?r:this.cosph0*r-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))*s,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 $9(n){n.x-=this.x0,n.y-=this.y0;var t=n.x/this.a,e=n.y/this.a,i,s,r,a,o,l,c;if(this.sphere){var h=0,u,p=0;if(u=Math.sqrt(t*t+e*e),s=u*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(p=Math.sin(s),h=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(u)<=qt?0:Math.asin(e*p/u),t*=p,e=h*u;break;case this.OBLIQ:s=Math.abs(u)<=qt?this.lat0:Math.asin(h*this.sinph0+e*p*this.cosph0/u),t*=p*this.cosph0,e=(h-Math.sin(s)*this.sinph0)*u;break;case this.N_POLE:e=-e,s=Dt-s;break;case this.S_POLE:s-=Dt;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 a7(){Math.abs(this.lat1+this.lat2)qt?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 o7(n){var t=n.x,e=n.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var i=Wa(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,r=this.ns0*$t(t-this.long0),a=s*Math.sin(r)+this.x0,o=this.rh-s*Math.cos(r)+this.y0;return n.x=a,n.y=o,n}function l7(n){var t,e,i,s,r,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),s=0,t!==0&&(s=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)),r=$t(s/this.ns0+this.long0),n.x=r,n.y=a,n}function c7(n,t){var e,i,s,r,a,o=Ja(.5*t);if(n0||Math.abs(a)<=qt?(o=this.x0+this.a*r*e*Math.sin(i)/a,l=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*e*s)/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*s)),n.x=o,n.y=l,n}function p7(n){var t,e,i,s,r,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))?(s=Math.atan2(t,this.rc),e=Math.sin(s),i=Math.cos(s),a=Ja(i*this.sin_p14+n.y*e*this.cos_p14/t),r=Math.atan2(n.x*e,t*this.cos_p14*i-n.y*this.sin_p14*e),r=$t(this.long0+r)):(a=this.phic0,r=0),n.x=r,n.y=a,n}var m7=["gnom"];const g7={init:f7,forward:d7,inverse:p7,names:m7};function y7(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*Dt:Dt;for(var i=Math.asin(.5*t),s,r,a,o,l=0;l<30;l++)if(r=Math.sin(i),a=Math.cos(i),o=n*r,s=Math.pow(1-o*o,2)/(2*a)*(t/(1-n*n)-r/(1-o*o)+.5/n*Math.log((1-o)/(1+o))),i+=s,Math.abs(s)<=1e-10)return i;return NaN}function _7(){this.sphere||(this.k0=Pr(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function x7(n){var t=n.x,e=n.y,i,s,r=$t(t-this.long0);if(this.sphere)i=this.x0+this.a*r*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var a=Wa(this.e,Math.sin(e));i=this.x0+this.a*this.k0*r,s=this.y0+this.a*a*.5/this.k0}return n.x=i,n.y=s,n}function v7(n){n.x-=this.x0,n.y-=this.y0;var t,e;return this.sphere?(t=$t(this.long0+n.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(n.y/this.a*Math.cos(this.lat_ts))):(e=y7(this.e,2*n.y*this.k0/this.a),t=$t(this.long0+n.x/(this.a*this.k0))),n.x=t,n.y=e,n}var M7=["cea"];const b7={init:_7,forward:x7,inverse:v7,names:M7};function w7(){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 S7(n){var t=n.x,e=n.y,i=$t(t-this.long0),s=lo(e-this.lat0);return n.x=this.x0+this.a*i*this.rc,n.y=this.y0+this.a*s,n}function E7(n){var t=n.x,e=n.y;return n.x=$t(this.long0+(t-this.x0)/(this.a*this.rc)),n.y=lo(this.lat0+(e-this.y0)/this.a),n}var A7=["Equirectangular","Equidistant_Cylindrical","eqc"];const T7={init:w7,forward:S7,inverse:E7,names:A7};var EA=20;function C7(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Vf(this.es),this.e1=Wf(this.es),this.e2=jf(this.es),this.e3=Xf(this.es),this.ml0=this.a*bi(this.e0,this.e1,this.e2,this.e3,this.lat0)}function R7(n){var t=n.x,e=n.y,i,s,r,a=$t(t-this.long0);if(r=a*Math.sin(e),this.sphere)Math.abs(e)<=qt?(i=this.a*a,s=-1*this.a*this.lat0):(i=this.a*Math.sin(r)/Math.tan(e),s=this.a*(lo(e-this.lat0)+(1-Math.cos(r))/Math.tan(e)));else if(Math.abs(e)<=qt)i=this.a*a,s=-1*this.ml0;else{var o=rh(this.a,this.e,Math.sin(e))/Math.tan(e);i=o*Math.sin(r),s=this.a*bi(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+o*(1-Math.cos(r))}return n.x=i+this.x0,n.y=s+this.y0,n}function P7(n){var t,e,i,s,r,a,o,l,c;if(i=n.x-this.x0,s=n.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=qt)t=$t(i/this.a+this.long0),e=0;else{a=this.lat0+s/this.a,o=i*i/this.a/this.a+a*a,l=a;var h;for(r=EA;r;--r)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)<=qt){e=l;break}t=$t(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(e))}else if(Math.abs(s+this.ml0)<=qt)e=0,t=$t(this.long0+i/this.a);else{a=(this.ml0+s)/this.a,o=i*i/this.a/this.a+a*a,l=a;var u,p,m,g,x;for(r=EA;r;--r)if(x=this.e*Math.sin(l),u=Math.sqrt(1-x*x)*Math.tan(l),p=this.a*bi(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)<=qt){e=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=$t(this.long0+Math.asin(i*u/this.a)/Math.sin(e))}return n.x=t,n.y=e,n}var I7=["Polyconic","poly"];const L7={init:C7,forward:R7,inverse:P7,names:I7};function D7(){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 N7(n){var t,e=n.x,i=n.y,s=i-this.lat0,r=e-this.long0,a=s/Du*1e-5,o=r,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,x,y=0,_=0;for(t=1;t<=6;t++)g=p*h-m*u,x=m*h+p*u,p=g,m=x,y=y+this.B_re[t]*p-this.B_im[t]*m,_=_+this.B_im[t]*p+this.B_re[t]*m;return n.x=_*this.a+this.x0,n.y=y*this.a+this.y0,n}function O7(n){var t,e=n.x,i=n.y,s=e-this.x0,r=i-this.y0,a=r/this.a,o=s/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=$t(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 s=Math.asin(e);return n.x=i,n.y=s,n}var J7=["Mollweide","moll"];const Q7={init:$7,forward:Z7,inverse:K7,names:J7};function tW(){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 r=0;if(e!==0&&(r=Math.atan2(t*n.x,t*n.y)),this.sphere)return s=$t(this.long0+r/this.ns),i=lo(this.g-e/this.a),n.x=s,n.y=i,n;var a=this.g-e/this.a;return i=P0(a,this.e0,this.e1,this.e2,this.e3),s=$t(this.long0+r/this.ns),n.x=s,n.y=i,n}var iW=["Equidistant_Conic","eqdc"];const sW={init:tW,forward:eW,inverse:nW,names:iW};function rW(){this.R=this.a}function aW(n){var t=n.x,e=n.y,i=$t(t-this.long0),s,r;Math.abs(e)<=qt&&(s=this.x0+this.R*i,r=this.y0);var a=Ja(2*Math.abs(e/Math.PI));(Math.abs(i)<=qt||Math.abs(Math.abs(e)-Dt)<=qt)&&(s=this.x0,e>=0?r=this.y0+Math.PI*this.R*Math.tan(.5*a):r=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,x=Math.PI*this.R*(o*(u-g)+Math.sqrt(l*(u-g)*(u-g)-(g+l)*(p-g)))/(g+l);i<0&&(x=-x),s=this.x0+x;var y=l+u;return x=Math.PI*this.R*(m*y-o*Math.sqrt((g+l)*(l+1)-y*y))/(g+l),e>=0?r=this.y0+x:r=this.y0-x,n.x=s,n.y=r,n}function oW(n){var t,e,i,s,r,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,s=n.y/u,r=i*i+s*s,a=-Math.abs(s)*(1+r),o=a-2*s*s+i*i,l=-2*a+1+2*s*s+r*r,m=s*s/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*Dt*this.a?void 0:(e=t/this.a,i=Math.sin(e),s=Math.cos(e),r=this.long0,Math.abs(t)<=qt?a=this.lat0:(a=Ja(s*this.sin_p12+n.y*i*this.cos_p12/t),o=Math.abs(this.lat0)-Dt,Math.abs(o)<=qt?this.lat0>=0?r=$t(this.long0+Math.atan2(n.x,-n.y)):r=$t(this.long0-Math.atan2(-n.x,n.y)):r=$t(this.long0+Math.atan2(n.x*i,t*this.cos_p12*s-n.y*this.sin_p12*i))),n.x=r,n.y=a,n)):(l=Vf(this.es),c=Wf(this.es),h=jf(this.es),u=Xf(this.es),Math.abs(this.sin_p12-1)<=qt?(p=this.a*bi(l,c,h,u,Dt),t=Math.sqrt(n.x*n.x+n.y*n.y),m=p-t,a=P0(m/this.a,l,c,h,u),r=$t(this.long0+Math.atan2(n.x,-1*n.y)),n.x=r,n.y=a,n):Math.abs(this.sin_p12+1)<=qt?(p=this.a*bi(l,c,h,u,Dt),t=Math.sqrt(n.x*n.x+n.y*n.y),m=t-p,a=P0(m/this.a,l,c,h,u),r=$t(this.long0+Math.atan2(n.x,n.y)),n.x=r,n.y=a,n):(t=Math.sqrt(n.x*n.x+n.y*n.y),y=Math.atan2(n.x,n.y),g=rh(this.a,this.e,this.sin_p12),_=Math.cos(y),b=this.e*this.cos_p12*_,S=-b*b/(1-this.es),w=3*this.es*(1-S)*this.sin_p12*this.cos_p12*_/(1-this.es),R=t/g,T=R-S*(1+S)*Math.pow(R,3)/6-w*(1+3*S)*Math.pow(R,4)/24,C=1-S*T*T/2-R*T*T*T/6,x=Math.asin(this.sin_p12*Math.cos(T)+this.cos_p12*Math.sin(T)*_),r=$t(this.long0+Math.asin(Math.sin(y)*Math.sin(T)/Math.cos(x))),L=Math.sin(x),a=Math.atan2((L-this.es*C*this.sin_p12)*Math.tan(x),L*(1-this.es)),n.x=r,n.y=a,n))}var dW=["Azimuthal_Equidistant","aeqd"];const pW={init:hW,forward:uW,inverse:fW,names:dW};function mW(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function gW(n){var t,e,i,s,r,a,o,l,c=n.x,h=n.y;return i=$t(c-this.long0),t=Math.sin(h),e=Math.cos(h),s=Math.cos(i),a=this.sin_p14*t+this.cos_p14*e*s,r=1,(a>0||Math.abs(a)<=qt)&&(o=this.a*r*e*Math.sin(i),l=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*e*s)),n.x=o,n.y=l,n}function yW(n){var t,e,i,s,r,a,o;return n.x-=this.x0,n.y-=this.y0,t=Math.sqrt(n.x*n.x+n.y*n.y),e=Ja(t/this.a),i=Math.sin(e),s=Math.cos(e),a=this.long0,Math.abs(t)<=qt?(o=this.lat0,n.x=a,n.y=o,n):(o=Ja(s*this.sin_p14+n.y*i*this.cos_p14/t),r=Math.abs(this.lat0)-Dt,Math.abs(r)<=qt?(this.lat0>=0?a=$t(this.long0+Math.atan2(n.x,-n.y)):a=$t(this.long0-Math.atan2(-n.x,n.y)),n.x=a,n.y=o,n):(a=$t(this.long0+Math.atan2(n.x*i,t*this.cos_p14*s-n.y*this.sin_p14*i)),n.x=a,n.y=o,n))}var _W=["ortho"];const xW={init:mW,forward:gW,inverse:yW,names:_W};var un={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Ze={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function vW(){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>=Dt-$e/2?this.face=un.TOP:this.lat0<=-(Dt-$e/2)?this.face=un.BOTTOM:Math.abs(this.long0)<=$e?this.face=un.FRONT:Math.abs(this.long0)<=Dt+$e?this.face=this.long0>0?un.RIGHT:un.LEFT:this.face=un.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 MW(n){var t={x:0,y:0},e,i,s,r,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===un.TOP)r=Dt-e,i>=$e&&i<=Dt+$e?(l.value=Ze.AREA_0,s=i-Dt):i>Dt+$e||i<=-(Dt+$e)?(l.value=Ze.AREA_1,s=i>0?i-vn:i+vn):i>-(Dt+$e)&&i<=-$e?(l.value=Ze.AREA_2,s=i+Dt):(l.value=Ze.AREA_3,s=i);else if(this.face===un.BOTTOM)r=Dt+e,i>=$e&&i<=Dt+$e?(l.value=Ze.AREA_0,s=-i+Dt):i<$e&&i>=-$e?(l.value=Ze.AREA_1,s=-i):i<-$e&&i>=-(Dt+$e)?(l.value=Ze.AREA_2,s=-i-Dt):(l.value=Ze.AREA_3,s=i>0?-i+vn:-i-vn);else{var c,h,u,p,m,g,x;this.face===un.RIGHT?i=Hc(i,+Dt):this.face===un.BACK?i=Hc(i,+vn):this.face===un.LEFT&&(i=Hc(i,-Dt)),p=Math.sin(e),m=Math.cos(e),g=Math.sin(i),x=Math.cos(i),c=m*x,h=m*g,u=p,this.face===un.FRONT?(r=Math.acos(c),s=dm(r,u,h,l)):this.face===un.RIGHT?(r=Math.acos(h),s=dm(r,u,-c,l)):this.face===un.BACK?(r=Math.acos(-c),s=dm(r,u,-h,l)):this.face===un.LEFT?(r=Math.acos(-h),s=dm(r,u,c,l)):(r=s=0,l.value=Ze.AREA_0)}return o=Math.atan(12/vn*(s+Math.acos(Math.sin(s)*Math.cos($e))-Dt)),a=Math.sqrt((1-Math.cos(r))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(s))))),l.value===Ze.AREA_1?o+=Dt:l.value===Ze.AREA_2?o+=vn:l.value===Ze.AREA_3&&(o+=1.5*vn),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 bW(n){var t={lam:0,phi:0},e,i,s,r,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=Ze.AREA_0:n.y>=0&&n.y>=Math.abs(n.x)?(u.value=Ze.AREA_1,e-=Dt):n.x<0&&-n.x>=Math.abs(n.y)?(u.value=Ze.AREA_2,e=e<0?e+vn:e-vn):(u.value=Ze.AREA_3,e+=Dt),h=vn/12*Math.tan(e),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),o=Math.atan(a),s=Math.cos(e),r=Math.tan(i),l=1-s*s*r*r*(1-Math.cos(Math.atan(1/Math.cos(o)))),l<-1?l=-1:l>1&&(l=1),this.face===un.TOP)c=Math.acos(l),t.phi=Dt-c,u.value===Ze.AREA_0?t.lam=o+Dt:u.value===Ze.AREA_1?t.lam=o<0?o+vn:o-vn:u.value===Ze.AREA_2?t.lam=o-Dt:t.lam=o;else if(this.face===un.BOTTOM)c=Math.acos(l),t.phi=c-Dt,u.value===Ze.AREA_0?t.lam=-o+Dt:u.value===Ze.AREA_1?t.lam=-o:u.value===Ze.AREA_2?t.lam=-o-Dt:t.lam=o<0?-o-vn:-o+vn;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===Ze.AREA_1?(h=m,m=-g,g=h):u.value===Ze.AREA_2?(m=-m,g=-g):u.value===Ze.AREA_3&&(h=m,m=g,g=-h),this.face===un.RIGHT?(h=p,p=-m,m=h):this.face===un.BACK?(p=-p,m=-m):this.face===un.LEFT&&(h=p,p=m,m=-h),t.phi=Math.acos(-g)-Dt,t.lam=Math.atan2(m,p),this.face===un.RIGHT?t.lam=Hc(t.lam,-Dt):this.face===un.BACK?t.lam=Hc(t.lam,-vn):this.face===un.LEFT&&(t.lam=Hc(t.lam,+Dt))}if(this.es!==0){var x,y,_;x=t.phi<0?1:0,y=Math.tan(t.phi),_=this.b/Math.sqrt(y*y+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-_*_)/(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 s;return n$e&&s<=Dt+$e?(i.value=Ze.AREA_1,s-=Dt):s>Dt+$e||s<=-(Dt+$e)?(i.value=Ze.AREA_2,s=s>=0?s-vn:s+vn):(i.value=Ze.AREA_3,s+=Dt)),s}function Hc(n,t){var e=n+t;return e<-vn?e+=af:e>+vn&&(e-=af),e}var wW=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const SW={init:vW,forward:MW,inverse:bW,names:wW};var xv=[[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]],yu=[[-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]],b3=.8487,w3=1.3523,S3=Mr/5,EW=1/S3,Nc=18,I0=function(n,t){return n[0]+t*(n[1]+t*(n[2]+t*n[3]))},AW=function(n,t){return n[1]+t*(2*n[2]+t*3*n[3])};function TW(n,t,e,i){for(var s=t;i;--i){var r=n(s);if(s-=r,Math.abs(r)=Nc&&(i=Nc-1),e=Mr*(e-EW*i);var s={x:I0(xv[i],e)*t,y:I0(yu[i],e)};return n.y<0&&(s.y=-s.y),s.x=s.x*this.a*b3+this.x0,s.y=s.y*this.a*w3+this.y0,s}function PW(n){var t={x:(n.x-this.x0)/(this.a*b3),y:Math.abs(n.y-this.y0)/(this.a*w3)};if(t.y>=1)t.x/=xv[Nc][0],t.y=n.y<0?-Dt:Dt;else{var e=Math.floor(t.y*Nc);for(e<0?e=0:e>=Nc&&(e=Nc-1);;)if(yu[e][0]>t.y)--e;else if(yu[e+1][0]<=t.y)++e;else break;var i=yu[e],s=5*(t.y-i[0])/(yu[e+1][0]-i[0]);s=TW(function(r){return(I0(i,r)-t.y)/AW(i,r)},s,qt,100),t.x/=I0(xv[e],s),t.y=(5*e+s)*Xn,n.y<0&&(t.y=-t.y)}return t.x=$t(t.x+this.long0),t}var IW=["Robinson","robin"];const LW={init:CW,forward:RW,inverse:PW,names:IW};function DW(){this.name="geocent"}function NW(n){var t=u3(n,this.es,this.a);return t}function OW(n){var t=f3(n,this.es,this.a,this.b);return t}var FW=["Geocentric","geocentric","geocent","Geocent"];const UW={init:DW,forward:NW,inverse:OW,names:FW};var ui={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},lu={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 kW(){if(Object.keys(lu).forEach((function(e){if(typeof this[e]>"u")this[e]=lu[e].def;else{if(lu[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);lu[e].num&&(this[e]=parseFloat(this[e]))}lu[e].degrees&&(this[e]=this[e]*Xn)}).bind(this)),Math.abs(Math.abs(this.lat0)-Dt)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 zW(n){n.x-=this.long0;var t=Math.sin(n.y),e=Math.cos(n.y),i=Math.cos(n.x),s,r;switch(this.mode){case ui.OBLIQ:r=this.sinph0*t+this.cosph0*e*i;break;case ui.EQUIT:r=e*i;break;case ui.S_POLE:r=-t;break;case ui.N_POLE:r=t;break}switch(r=this.pn1/(this.p-r),s=r*e*Math.sin(n.x),this.mode){case ui.OBLIQ:r*=this.cosph0*t-this.sinph0*e*i;break;case ui.EQUIT:r*=t;break;case ui.N_POLE:r*=-(e*i);break;case ui.S_POLE:r*=e*i;break}var a,o;return a=r*this.cg+s*this.sg,o=1/(a*this.sw*this.h1+this.cw),s=(s*this.cg-r*this.sg)*this.cw*o,r=a*o,n.x=s*this.a,n.y=r*this.a,n}function BW(n){n.x/=this.a,n.y/=this.a;var t={x:n.x,y:n.y},e,i,s;s=1/(this.pn1-n.y*this.sw),e=this.pn1*n.x*s,i=this.pn1*n.y*this.cw*s,n.x=e*this.cg+i*this.sg,n.y=i*this.cg-e*this.sg;var r=Ui(n.x,n.y);if(Math.abs(r)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 WW(n){var t=n.x,e=n.y,i,s,r,a;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var o=this.radius_p/Ui(this.radius_p*Math.cos(e),Math.sin(e));if(s=o*Math.cos(t)*Math.cos(e),r=o*Math.sin(t)*Math.cos(e),a=o*Math.sin(e),(this.radius_g-s)*s-r*r-a*a*this.radius_p_inv2<0)return n.x=Number.NaN,n.y=Number.NaN,n;i=this.radius_g-s,this.flip_axis?(n.x=this.radius_g_1*Math.atan(r/Ui(a,i)),n.y=this.radius_g_1*Math.atan(a/i)):(n.x=this.radius_g_1*Math.atan(r/i),n.y=this.radius_g_1*Math.atan(a/Ui(r,i)))}else this.shape==="sphere"&&(i=Math.cos(e),s=Math.cos(t)*i,r=Math.sin(t)*i,a=Math.sin(e),i=this.radius_g-s,this.flip_axis?(n.x=this.radius_g_1*Math.atan(r/Ui(a,i)),n.y=this.radius_g_1*Math.atan(a/i)):(n.x=this.radius_g_1*Math.atan(r/i),n.y=this.radius_g_1*Math.atan(a/Ui(r,i))));return n.x=n.x*this.a,n.y=n.y*this.a,n}function jW(n){var t=-1,e=0,i=0,s,r,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)*Ui(1,i)):(e=Math.tan(n.x/this.radius_g_1),i=Math.tan(n.y/this.radius_g_1)*Ui(1,e));var l=i/this.radius_p;if(s=e*e+l*l+t*t,r=2*this.radius_g*t,a=r*r-4*s*this.C,a<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-r-Math.sqrt(a))/(2*s),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)),s=e*e+i*i+t*t,r=2*this.radius_g*t,a=r*r-4*s*this.C,a<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-r-Math.sqrt(a))/(2*s),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 XW=["Geostationary Satellite View","Geostationary_Satellite","geos"];const qW={init:VW,forward:WW,inverse:jW,names:XW};var Nu=1.340264,Ou=-.081106,Fu=893e-6,Uu=.003796,L0=Math.sqrt(3)/2;function YW(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function $W(n){var t=$t(n.x-this.long0),e=n.y,i=Math.asin(L0*Math.sin(e)),s=i*i,r=s*s*s;return n.x=t*Math.cos(i)/(L0*(Nu+3*Ou*s+r*(7*Fu+9*Uu*s))),n.y=i*(Nu+Ou*s+r*(Fu+Uu*s)),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function ZW(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,s,r,a,o,l,c;for(c=0;c=Dt?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=ij,this.forward=nj)}function tj(n){var t=$t(n.x-(this.long0||0)),e=n.y,i,s,r;return i=this.am1+this.m1-xh(e,s=Math.sin(e),r=Math.cos(e),this.en),s=r*t/(i*Math.sqrt(1-this.es*s*s)),n.x=i*Math.sin(s),n.y=this.am1-i*Math.cos(s),n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function ej(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var t,e,i,s;if(e=Ui(n.x,n.y=this.am1-n.y),s=pM(this.am1+this.m1-e,this.es,this.en),(t=Math.abs(s))cf?(n.x=s*Math.sin(i=t*Math.cos(e)/s),n.y=this.cphi1-s*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 ij(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var t,e,i=Ui(n.x,n.y=this.cphi1-n.y);if(e=this.cphi1+this.phi1-i,Math.abs(e)>Dt)throw new Error;return Math.abs(Math.abs(e)-Dt)<=cf?t=0:t=i*Math.atan2(n.x,n.y)/Math.cos(e),n.x=$t(t+(this.long0||0)),n.y=lo(e),n}var sj=["bonne","Bonne (Werner lat_1=90)"];const rj={init:QW,names:sj};function aj(n){n.Proj.projections.add(Nm),n.Proj.projections.add(Om),n.Proj.projections.add(t9),n.Proj.projections.add(h9),n.Proj.projections.add(g9),n.Proj.projections.add(M9),n.Proj.projections.add(T9),n.Proj.projections.add(L9),n.Proj.projections.add(U9),n.Proj.projections.add(G9),n.Proj.projections.add(r7),n.Proj.projections.add(u7),n.Proj.projections.add(g7),n.Proj.projections.add(b7),n.Proj.projections.add(T7),n.Proj.projections.add(L7),n.Proj.projections.add(U7),n.Proj.projections.add(G7),n.Proj.projections.add(Y7),n.Proj.projections.add(Q7),n.Proj.projections.add(sW),n.Proj.projections.add(cW),n.Proj.projections.add(pW),n.Proj.projections.add(xW),n.Proj.projections.add(SW),n.Proj.projections.add(LW),n.Proj.projections.add(UW),n.Proj.projections.add(GW),n.Proj.projections.add(qW),n.Proj.projections.add(JW),n.Proj.projections.add(rj)}Ts.defaultDatum="WGS84";Ts.Proj=Ar;Ts.WGS84=new Ts.Proj("WGS84");Ts.Point=sh;Ts.toPoint=d3;Ts.defs=vi;Ts.nadgrid=nV;Ts.transform=R0;Ts.mgrs=_V;Ts.version="__VERSION__";aj(Ts);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const oj=4,AA=0,TA=1,lj=2;function vh(n){let t=n.length;for(;--t>=0;)n[t]=0}const cj=0,E3=1,hj=2,uj=3,fj=258,_M=29,qf=256,hf=qf+1+_M,Gc=30,xM=19,A3=2*hf+1,Yo=15,yx=16,dj=7,vM=256,T3=16,C3=17,R3=18,vv=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]),pj=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),P3=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),mj=512,Kr=new Array((hf+2)*2);vh(Kr);const ku=new Array(Gc*2);vh(ku);const uf=new Array(mj);vh(uf);const ff=new Array(fj-uj+1);vh(ff);const MM=new Array(_M);vh(MM);const D0=new Array(Gc);vh(D0);function _x(n,t,e,i,s){this.static_tree=n,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=s,this.has_stree=n&&n.length}let I3,L3,D3;function xx(n,t){this.dyn_tree=n,this.max_code=0,this.stat_desc=t}const N3=n=>n<256?uf[n]:uf[256+(n>>>7)],df=(n,t)=>{n.pending_buf[n.pending++]=t&255,n.pending_buf[n.pending++]=t>>>8&255},zi=(n,t,e)=>{n.bi_valid>yx-e?(n.bi_buf|=t<>yx-n.bi_valid,n.bi_valid+=e-yx):(n.bi_buf|=t<{zi(n,e[t*2],e[t*2+1])},O3=(n,t)=>{let e=0;do e|=n&1,n>>>=1,e<<=1;while(--t>0);return e>>>1},gj=n=>{n.bi_valid===16?(df(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)},yj=(n,t)=>{const e=t.dyn_tree,i=t.max_code,s=t.stat_desc.static_tree,r=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,x=0;for(p=0;p<=Yo;p++)n.bl_count[p]=0;for(e[n.heap[n.heap_max]*2+1]=0,c=n.heap_max+1;cl&&(p=l,x++),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),r&&(n.static_len+=g*(s[h*2+1]+m)));if(x!==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]--,x-=2}while(x>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--)}},F3=(n,t,e)=>{const i=new Array(Yo+1);let s=0,r,a;for(r=1;r<=Yo;r++)s=s+e[r-1]<<1,i[r]=s;for(a=0;a<=t;a++){let o=n[a*2+1];o!==0&&(n[a*2]=O3(i[o]++,o))}},_j=()=>{let n,t,e,i,s;const r=new Array(Yo+1);for(e=0,i=0;i<_M-1;i++)for(MM[i]=e,n=0;n<1<>=7;i{let t;for(t=0;t{n.bi_valid>8?df(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},CA=(n,t,e,i)=>{const s=t*2,r=e*2;return n[s]{const i=n.heap[e];let s=e<<1;for(;s<=n.heap_len&&(s{let i,s,r=0,a,o;if(n.sym_next!==0)do i=n.pending_buf[n.sym_buf+r++]&255,i+=(n.pending_buf[n.sym_buf+r++]&255)<<8,s=n.pending_buf[n.sym_buf+r++],i===0?xr(n,s,t):(a=ff[s],xr(n,a+qf+1,t),o=vv[a],o!==0&&(s-=MM[a],zi(n,s,o)),i--,a=N3(i),xr(n,a,e),o=Fm[a],o!==0&&(i-=D0[a],zi(n,i,o)));while(r{const e=t.dyn_tree,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,r=t.stat_desc.elems;let a,o,l=-1,c;for(n.heap_len=0,n.heap_max=A3,a=0;a>1;a>=1;a--)vx(n,e,a);c=r;do a=n.heap[1],n.heap[1]=n.heap[n.heap_len--],vx(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++,vx(n,e,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],yj(n,t),F3(e,l,n.bl_count)},PA=(n,t,e)=>{let i,s=-1,r,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++)r=a,a=t[(i+1)*2+1],!(++o{let i,s=-1,r,a=t[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),i=0;i<=e;i++)if(r=a,a=t[(i+1)*2+1],!(++o{let t;for(PA(n,n.dyn_ltree,n.l_desc.max_code),PA(n,n.dyn_dtree,n.d_desc.max_code),Mv(n,n.bl_desc),t=xM-1;t>=3&&n.bl_tree[P3[t]*2+1]===0;t--);return n.opt_len+=3*(t+1)+5+5+4,t},vj=(n,t,e,i)=>{let s;for(zi(n,t-257,5),zi(n,e-1,5),zi(n,i-4,4),s=0;s{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&n.dyn_ltree[e*2]!==0)return AA;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return TA;for(e=32;e{LA||(_j(),LA=!0),n.l_desc=new xx(n.dyn_ltree,I3),n.d_desc=new xx(n.dyn_dtree,L3),n.bl_desc=new xx(n.bl_tree,D3),n.bi_buf=0,n.bi_valid=0,U3(n)},z3=(n,t,e,i)=>{zi(n,(cj<<1)+(i?1:0),3),k3(n),df(n,e),df(n,~e),e&&n.pending_buf.set(n.window.subarray(t,t+e),n.pending),n.pending+=e},wj=n=>{zi(n,E3<<1,3),xr(n,vM,Kr),gj(n)},Sj=(n,t,e,i)=>{let s,r,a=0;n.level>0?(n.strm.data_type===lj&&(n.strm.data_type=Mj(n)),Mv(n,n.l_desc),Mv(n,n.d_desc),a=xj(n),s=n.opt_len+3+7>>>3,r=n.static_len+3+7>>>3,r<=s&&(s=r)):s=r=e+5,e+4<=s&&t!==-1?z3(n,t,e,i):n.strategy===oj||r===s?(zi(n,(E3<<1)+(i?1:0),3),RA(n,Kr,ku)):(zi(n,(hj<<1)+(i?1:0),3),vj(n,n.l_desc.max_code+1,n.d_desc.max_code+1,a+1),RA(n,n.dyn_ltree,n.dyn_dtree)),U3(n),i&&k3(n)},Ej=(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[(ff[e]+qf+1)*2]++,n.dyn_dtree[N3(t)*2]++),n.sym_next===n.sym_end);var Aj=bj,Tj=z3,Cj=Sj,Rj=Ej,Pj=wj,Ij={_tr_init:Aj,_tr_stored_block:Tj,_tr_flush_block:Cj,_tr_tally:Rj,_tr_align:Pj};const Lj=(n,t,e,i)=>{let s=n&65535|0,r=n>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do s=s+t[i++]|0,r=r+s|0;while(--a);s%=65521,r%=65521}return s|r<<16|0};var pf=Lj;const Dj=()=>{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},Nj=new Uint32Array(Dj()),Oj=(n,t,e,i)=>{const s=Nj,r=i+e;n^=-1;for(let a=i;a>>8^s[(n^t[a])&255];return n^-1};var Hn=Oj,ah={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"},Yf={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:Fj,_tr_stored_block:bv,_tr_flush_block:Uj,_tr_tally:ja,_tr_align:kj}=Ij,{Z_NO_FLUSH:Xa,Z_PARTIAL_FLUSH:zj,Z_FULL_FLUSH:Bj,Z_FINISH:bs,Z_BLOCK:DA,Z_OK:jn,Z_STREAM_END:NA,Z_STREAM_ERROR:Tr,Z_DATA_ERROR:Hj,Z_BUF_ERROR:Mx,Z_DEFAULT_COMPRESSION:Gj,Z_FILTERED:Vj,Z_HUFFMAN_ONLY:pm,Z_RLE:Wj,Z_FIXED:jj,Z_DEFAULT_STRATEGY:Xj,Z_UNKNOWN:qj,Z_DEFLATED:Rg}=Yf,Yj=9,$j=15,Zj=8,Kj=29,Jj=256,wv=Jj+1+Kj,Qj=30,tX=19,eX=2*wv+1,nX=15,ze=3,Ba=258,Cr=Ba+ze+1,iX=32,oh=42,bM=57,Sv=69,Ev=73,Av=91,Tv=103,$o=113,_u=666,wi=1,Mh=2,yl=3,bh=4,sX=3,Zo=(n,t)=>(n.msg=ah[t],t),OA=n=>n*2-(n>4?9:0),za=n=>{let t=n.length;for(;--t>=0;)n[t]=0},rX=n=>{let t,e,i,s=n.w_size;t=n.hash_size,i=t;do e=n.head[--i],n.head[i]=e>=s?e-s:0;while(--t);t=s,i=t;do e=n.prev[--i],n.prev[i]=e>=s?e-s:0;while(--t)};let aX=(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))},is=(n,t)=>{Uj(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,t),n.block_start=n.strstart,Qi(n.strm)},Xe=(n,t)=>{n.pending_buf[n.pending++]=t},cu=(n,t)=>{n.pending_buf[n.pending++]=t>>>8&255,n.pending_buf[n.pending++]=t&255},Cv=(n,t,e,i)=>{let s=n.avail_in;return s>i&&(s=i),s===0?0:(n.avail_in-=s,t.set(n.input.subarray(n.next_in,n.next_in+s),e),n.state.wrap===1?n.adler=pf(n.adler,t,s,e):n.state.wrap===2&&(n.adler=Hn(n.adler,t,s,e)),n.next_in+=s,n.total_in+=s,s)},B3=(n,t)=>{let e=n.max_chain_length,i=n.strstart,s,r,a=n.prev_length,o=n.nice_match;const l=n.strstart>n.w_size-Cr?n.strstart-(n.w_size-Cr):0,c=n.window,h=n.w_mask,u=n.prev,p=n.strstart+Ba;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(s=t,!(c[s+a]!==g||c[s+a-1]!==m||c[s]!==c[i]||c[++s]!==c[i+1])){i+=2,s++;do;while(c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&ia){if(n.match_start=t,a=r,r>=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},lh=n=>{const t=n.w_size;let e,i,s;do{if(i=n.window_size-n.lookahead-n.strstart,n.strstart>=t+(t-Cr)&&(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),rX(n),i+=t),n.strm.avail_in===0)break;if(e=Cv(n.strm,n.window,n.strstart+n.lookahead,i),n.lookahead+=e,n.lookahead+n.insert>=ze)for(s=n.strstart-n.insert,n.ins_h=n.window[s],n.ins_h=qa(n,n.ins_h,n.window[s+1]);n.insert&&(n.ins_h=qa(n,n.ins_h,n.window[s+ze-1]),n.prev[s&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=s,s++,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,s,r,a=0,o=n.strm.avail_in;do{if(i=65535,r=n.bi_valid+42>>3,n.strm.avail_outs+n.strm.avail_in&&(i=s+n.strm.avail_in),i>r&&(i=r),i>8,n.pending_buf[n.pending-2]=~i,n.pending_buf[n.pending-1]=~i>>8,Qi(n.strm),s&&(s>i&&(s=i),n.strm.output.set(n.window.subarray(n.block_start,n.block_start+s),n.strm.next_out),n.strm.next_out+=s,n.strm.avail_out-=s,n.strm.total_out+=s,n.block_start+=s,i-=s),i&&(Cv(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_waterr&&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++,r+=n.w_size,n.insert>n.strstart&&(n.insert=n.strstart)),r>n.strm.avail_in&&(r=n.strm.avail_in),r&&(Cv(n.strm,n.window,n.strstart,r),n.strstart+=r,n.insert+=r>n.w_size-n.insert?n.w_size-n.insert:r),n.high_water>3,r=n.pending_buf_size-r>65535?65535:n.pending_buf_size-r,e=r>n.w_size?n.w_size:r,s=n.strstart-n.block_start,(s>=e||(s||t===bs)&&t!==Xa&&n.strm.avail_in===0&&s<=r)&&(i=s>r?r:s,a=t===bs&&n.strm.avail_in===0&&i===s?1:0,bv(n,n.block_start,i,a),n.block_start+=i,Qi(n.strm)),a?yl:wi)},bx=(n,t)=>{let e,i;for(;;){if(n.lookahead=ze&&(n.ins_h=qa(n,n.ins_h,n.window[n.strstart+ze-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-Cr&&(n.match_length=B3(n,e)),n.match_length>=ze)if(i=ja(n,n.strstart-n.match_start,n.match_length-ze),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=ze){n.match_length--;do n.strstart++,n.ins_h=qa(n,n.ins_h,n.window[n.strstart+ze-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=qa(n,n.ins_h,n.window[n.strstart+1]);else i=ja(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&(is(n,!1),n.strm.avail_out===0))return wi}return n.insert=n.strstart{let e,i,s;for(;;){if(n.lookahead=ze&&(n.ins_h=qa(n,n.ins_h,n.window[n.strstart+ze-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=ze-1,e!==0&&n.prev_length4096)&&(n.match_length=ze-1)),n.prev_length>=ze&&n.match_length<=n.prev_length){s=n.strstart+n.lookahead-ze,i=ja(n,n.strstart-1-n.prev_match,n.prev_length-ze),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=s&&(n.ins_h=qa(n,n.ins_h,n.window[n.strstart+ze-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=ze-1,n.strstart++,i&&(is(n,!1),n.strm.avail_out===0))return wi}else if(n.match_available){if(i=ja(n,0,n.window[n.strstart-1]),i&&is(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return wi}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=ja(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart{let e,i,s,r;const a=n.window;for(;;){if(n.lookahead<=Ba){if(lh(n),n.lookahead<=Ba&&t===Xa)return wi;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=ze&&n.strstart>0&&(s=n.strstart-1,i=a[s],i===a[++s]&&i===a[++s]&&i===a[++s])){r=n.strstart+Ba;do;while(i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&sn.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=ze?(e=ja(n,1,n.match_length-ze),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(e=ja(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),e&&(is(n,!1),n.strm.avail_out===0))return wi}return n.insert=0,t===bs?(is(n,!0),n.strm.avail_out===0?yl:bh):n.sym_next&&(is(n,!1),n.strm.avail_out===0)?wi:Mh},lX=(n,t)=>{let e;for(;;){if(n.lookahead===0&&(lh(n),n.lookahead===0)){if(t===Xa)return wi;break}if(n.match_length=0,e=ja(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,e&&(is(n,!1),n.strm.avail_out===0))return wi}return n.insert=0,t===bs?(is(n,!0),n.strm.avail_out===0?yl:bh):n.sym_next&&(is(n,!1),n.strm.avail_out===0)?wi:Mh};function dr(n,t,e,i,s){this.good_length=n,this.max_lazy=t,this.nice_length=e,this.max_chain=i,this.func=s}const xu=[new dr(0,0,0,0,H3),new dr(4,4,8,4,bx),new dr(4,5,16,8,bx),new dr(4,6,32,32,bx),new dr(4,4,16,16,vc),new dr(8,16,32,32,vc),new dr(8,16,128,128,vc),new dr(8,32,128,256,vc),new dr(32,128,258,1024,vc),new dr(32,258,258,4096,vc)],cX=n=>{n.window_size=2*n.w_size,za(n.head),n.max_lazy_match=xu[n.level].max_lazy,n.good_match=xu[n.level].good_length,n.nice_match=xu[n.level].nice_length,n.max_chain_length=xu[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=ze-1,n.match_available=0,n.ins_h=0};function hX(){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=Rg,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(eX*2),this.dyn_dtree=new Uint16Array((2*Qj+1)*2),this.bl_tree=new Uint16Array((2*tX+1)*2),za(this.dyn_ltree),za(this.dyn_dtree),za(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(nX+1),this.heap=new Uint16Array(2*wv+1),za(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*wv+1),za(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 $f=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.status!==oh&&t.status!==bM&&t.status!==Sv&&t.status!==Ev&&t.status!==Av&&t.status!==Tv&&t.status!==$o&&t.status!==_u?1:0},G3=n=>{if($f(n))return Zo(n,Tr);n.total_in=n.total_out=0,n.data_type=qj;const t=n.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?bM:t.wrap?oh:$o,n.adler=t.wrap===2?0:1,t.last_flush=-2,Fj(t),jn},V3=n=>{const t=G3(n);return t===jn&&cX(n.state),t},uX=(n,t)=>$f(n)||n.state.wrap!==2?Tr:(n.state.gzhead=t,jn),W3=(n,t,e,i,s,r)=>{if(!n)return Tr;let a=1;if(t===Gj&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),s<1||s>Yj||e!==Rg||i<8||i>15||t<0||t>9||r<0||r>jj||i===8&&a!==1)return Zo(n,Tr);i===8&&(i=9);const o=new hX;return n.state=o,o.strm=n,o.status=oh,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<W3(n,t,Rg,$j,Zj,Xj),dX=(n,t)=>{if($f(n)||t>DA||t<0)return n?Zo(n,Tr):Tr;const e=n.state;if(!n.output||n.avail_in!==0&&!n.input||e.status===_u&&t!==bs)return Zo(n,n.avail_out===0?Mx:Tr);const i=e.last_flush;if(e.last_flush=t,e.pending!==0){if(Qi(n),n.avail_out===0)return e.last_flush=-1,jn}else if(n.avail_in===0&&OA(t)<=OA(i)&&t!==bs)return Zo(n,Mx);if(e.status===_u&&n.avail_in!==0)return Zo(n,Mx);if(e.status===oh&&e.wrap===0&&(e.status=$o),e.status===oh){let s=Rg+(e.w_bits-8<<4)<<8,r=-1;if(e.strategy>=pm||e.level<2?r=0:e.level<6?r=1:e.level===6?r=2:r=3,s|=r<<6,e.strstart!==0&&(s|=iX),s+=31-s%31,cu(e,s),e.strstart!==0&&(cu(e,n.adler>>>16),cu(e,n.adler&65535)),n.adler=1,e.status=$o,Qi(n),e.pending!==0)return e.last_flush=-1,jn}if(e.status===bM){if(n.adler=0,Xe(e,31),Xe(e,139),Xe(e,8),e.gzhead)Xe(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)),Xe(e,e.gzhead.time&255),Xe(e,e.gzhead.time>>8&255),Xe(e,e.gzhead.time>>16&255),Xe(e,e.gzhead.time>>24&255),Xe(e,e.level===9?2:e.strategy>=pm||e.level<2?4:0),Xe(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(Xe(e,e.gzhead.extra.length&255),Xe(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(n.adler=Hn(n.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=Sv;else if(Xe(e,0),Xe(e,0),Xe(e,0),Xe(e,0),Xe(e,0),Xe(e,e.level===9?2:e.strategy>=pm||e.level<2?4:0),Xe(e,sX),e.status=$o,Qi(n),e.pending!==0)return e.last_flush=-1,jn}if(e.status===Sv){if(e.gzhead.extra){let s=e.pending,r=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+r>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>s&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s)),e.gzindex+=o,Qi(n),e.pending!==0)return e.last_flush=-1,jn;s=0,r-=o}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+r),e.pending),e.pending+=r,e.gzhead.hcrc&&e.pending>s&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s)),e.gzindex=0}e.status=Ev}if(e.status===Ev){if(e.gzhead.name){let s=e.pending,r;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>s&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s)),Qi(n),e.pending!==0)return e.last_flush=-1,jn;s=0}e.gzindexs&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s)),e.gzindex=0}e.status=Av}if(e.status===Av){if(e.gzhead.comment){let s=e.pending,r;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>s&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s)),Qi(n),e.pending!==0)return e.last_flush=-1,jn;s=0}e.gzindexs&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s))}e.status=Tv}if(e.status===Tv){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(Qi(n),e.pending!==0))return e.last_flush=-1,jn;Xe(e,n.adler&255),Xe(e,n.adler>>8&255),n.adler=0}if(e.status=$o,Qi(n),e.pending!==0)return e.last_flush=-1,jn}if(n.avail_in!==0||e.lookahead!==0||t!==Xa&&e.status!==_u){let s=e.level===0?H3(e,t):e.strategy===pm?lX(e,t):e.strategy===Wj?oX(e,t):xu[e.level].func(e,t);if((s===yl||s===bh)&&(e.status=_u),s===wi||s===yl)return n.avail_out===0&&(e.last_flush=-1),jn;if(s===Mh&&(t===zj?kj(e):t!==DA&&(bv(e,0,0,!1),t===Bj&&(za(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),Qi(n),n.avail_out===0))return e.last_flush=-1,jn}return t!==bs?jn:e.wrap<=0?NA:(e.wrap===2?(Xe(e,n.adler&255),Xe(e,n.adler>>8&255),Xe(e,n.adler>>16&255),Xe(e,n.adler>>24&255),Xe(e,n.total_in&255),Xe(e,n.total_in>>8&255),Xe(e,n.total_in>>16&255),Xe(e,n.total_in>>24&255)):(cu(e,n.adler>>>16),cu(e,n.adler&65535)),Qi(n),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?jn:NA)},pX=n=>{if($f(n))return Tr;const t=n.state.status;return n.state=null,t===$o?Zo(n,Hj):jn},mX=(n,t)=>{let e=t.length;if($f(n))return Tr;const i=n.state,s=i.wrap;if(s===2||s===1&&i.status!==oh||i.lookahead)return Tr;if(s===1&&(n.adler=pf(n.adler,t,e,0)),i.wrap=0,e>=i.w_size){s===0&&(za(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 r=n.avail_in,a=n.next_in,o=n.input;for(n.avail_in=e,n.next_in=0,n.input=t,lh(i);i.lookahead>=ze;){let l=i.strstart,c=i.lookahead-(ze-1);do i.ins_h=qa(i,i.ins_h,i.window[l+ze-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=ze-1,lh(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=ze-1,i.match_available=0,n.next_in=a,n.input=o,n.avail_in=r,i.wrap=s,jn};var gX=fX,yX=W3,_X=V3,xX=G3,vX=uX,MX=dX,bX=pX,wX=mX,SX="pako deflate (from Nodeca project)",zu={deflateInit:gX,deflateInit2:yX,deflateReset:_X,deflateResetKeep:xX,deflateSetHeader:vX,deflate:MX,deflateEnd:bX,deflateSetDictionary:wX,deflateInfo:SX};const EX=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);var AX=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)EX(e,i)&&(n[i]=e[i])}}return n},TX=n=>{let t=0;for(let i=0,s=n.length;i=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;mf[254]=mf[254]=1;var CX=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let t,e,i,s,r,a=n.length,o=0;for(s=0;s>>6,t[r++]=128|e&63):e<65536?(t[r++]=224|e>>>12,t[r++]=128|e>>>6&63,t[r++]=128|e&63):(t[r++]=240|e>>>18,t[r++]=128|e>>>12&63,t[r++]=128|e>>>6&63,t[r++]=128|e&63);return t};const RX=(n,t)=>{if(t<65534&&n.subarray&&j3)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,s;const r=new Array(e*2);for(s=0,i=0;i4){r[s++]=65533,i+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&i1){r[s++]=65533;continue}a<65536?r[s++]=a:(a-=65536,r[s++]=55296|a>>10&1023,r[s++]=56320|a&1023)}return RX(r,s)},IX=(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+mf[n[e]]>t?e:t},gf={string2buf:CX,buf2string:PX,utf8border:IX};function LX(){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 X3=LX;const q3=Object.prototype.toString,{Z_NO_FLUSH:DX,Z_SYNC_FLUSH:NX,Z_FULL_FLUSH:OX,Z_FINISH:FX,Z_OK:N0,Z_STREAM_END:UX,Z_DEFAULT_COMPRESSION:kX,Z_DEFAULT_STRATEGY:zX,Z_DEFLATED:BX}=Yf;function wM(n){this.options=Pg.assign({level:kX,method:BX,chunkSize:16384,windowBits:15,memLevel:8,strategy:zX},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 X3,this.strm.avail_out=0;let e=zu.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==N0)throw new Error(ah[e]);if(t.header&&zu.deflateSetHeader(this.strm,t.header),t.dictionary){let i;if(typeof t.dictionary=="string"?i=gf.string2buf(t.dictionary):q3.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,e=zu.deflateSetDictionary(this.strm,i),e!==N0)throw new Error(ah[e]);this._dict_set=!0}}wM.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize;let s,r;if(this.ended)return!1;for(t===~~t?r=t:r=t===!0?FX:DX,typeof n=="string"?e.input=gf.string2buf(n):q3.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),(r===NX||r===OX)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(s=zu.deflate(e,r),s===UX)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),s=zu.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===N0;if(e.avail_out===0){this.onData(e.output);continue}if(r>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};wM.prototype.onData=function(n){this.chunks.push(n)};wM.prototype.onEnd=function(n){n===N0&&(this.result=Pg.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};const mm=16209,HX=16191;var GX=function(t,e){let i,s,r,a,o,l,c,h,u,p,m,g,x,y,_,b,S,w,R,T,C,L,P,E;const D=t.state;i=t.next_in,P=t.input,s=i+(t.avail_in-5),r=t.next_out,E=t.output,a=r-(e-t.avail_out),o=r+(t.avail_out-257),l=D.dmax,c=D.wsize,h=D.whave,u=D.wnext,p=D.window,m=D.hold,g=D.bits,x=D.lencode,y=D.distcode,_=(1<>>24,m>>>=w,g-=w,w=S>>>16&255,w===0)E[r++]=S&65535;else if(w&16){R=S&65535,w&=15,w&&(g>>=w,g-=w),g<15&&(m+=P[i++]<>>24,m>>>=w,g-=w,w=S>>>16&255,w&16){if(T=S&65535,w&=15,gl){t.msg="invalid distance too far back",D.mode=mm;break t}if(m>>>=w,g-=w,w=r-a,T>w){if(w=T-w,w>h&&D.sane){t.msg="invalid distance too far back",D.mode=mm;break t}if(C=0,L=p,u===0){if(C+=c-w,w2;)E[r++]=L[C++],E[r++]=L[C++],E[r++]=L[C++],R-=3;R&&(E[r++]=L[C++],R>1&&(E[r++]=L[C++]))}else{C=r-T;do E[r++]=E[C++],E[r++]=E[C++],E[r++]=E[C++],R-=3;while(R>2);R&&(E[r++]=E[C++],R>1&&(E[r++]=E[C++]))}}else if(w&64){t.msg="invalid distance code",D.mode=mm;break t}else{S=y[(S&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,x=0,y=0,_=0,b=0,S,w,R,T,C,L=null,P;const E=new Uint16Array(Mc+1),D=new Uint16Array(Mc+1);let z=null,G,W,Q;for(c=0;c<=Mc;c++)E[c]=0;for(h=0;h=1&&E[p]===0;p--);if(m>p&&(m=p),p===0)return s[r++]=1<<24|64<<16|0,s[r++]=1<<24|64<<16|0,o.bits=1,0;for(u=1;u0&&(n===kA||p!==1))return-1;for(D[1]=0,c=1;cFA||n===zA&&_>UA)return 1;for(;;){G=c-x,a[h]+1=P?(W=z[a[h]-P],Q=L[a[h]-P]):(W=96,Q=0),S=1<>x)+w]=G<<24|W<<16|Q|0;while(w!==0);for(S=1<>=1;if(S!==0?(b&=S-1,b+=S):b=0,h++,--E[c]===0){if(c===p)break;c=t[e+a[h]]}if(c>m&&(b&T)!==R){for(x===0&&(x=m),C+=u,g=c-x,y=1<FA||n===zA&&_>UA)return 1;R=b&T,s[R]=m<<24|g<<16|C-r|0}}return b!==0&&(s[C+b]=c-x<<24|64<<16|0),o.bits=m,0};var Bu=qX;const YX=0,Y3=1,$3=2,{Z_FINISH:BA,Z_BLOCK:$X,Z_TREES:gm,Z_OK:_l,Z_STREAM_END:ZX,Z_NEED_DICT:KX,Z_STREAM_ERROR:Cs,Z_DATA_ERROR:Z3,Z_MEM_ERROR:K3,Z_BUF_ERROR:JX,Z_DEFLATED:HA}=Yf,Ig=16180,GA=16181,VA=16182,WA=16183,jA=16184,XA=16185,qA=16186,YA=16187,$A=16188,ZA=16189,O0=16190,$r=16191,Sx=16192,KA=16193,Ex=16194,JA=16195,QA=16196,tT=16197,eT=16198,ym=16199,_m=16200,nT=16201,iT=16202,sT=16203,rT=16204,aT=16205,Ax=16206,oT=16207,lT=16208,ln=16209,J3=16210,Q3=16211,QX=852,tq=592,eq=15,nq=eq,cT=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function iq(){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 wl=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.modeQ3?1:0},tP=n=>{if(wl(n))return Cs;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=Ig,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(QX),t.distcode=t.distdyn=new Int32Array(tq),t.sane=1,t.back=-1,_l},eP=n=>{if(wl(n))return Cs;const t=n.state;return t.wsize=0,t.whave=0,t.wnext=0,tP(n)},nP=(n,t)=>{let e;if(wl(n))return Cs;const i=n.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Cs:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=e,i.wbits=t,eP(n))},iP=(n,t)=>{if(!n)return Cs;const e=new iq;n.state=e,e.strm=n,e.window=null,e.mode=Ig;const i=nP(n,t);return i!==_l&&(n.state=null),i},sq=n=>iP(n,nq);let hT=!0,Tx,Cx;const rq=n=>{if(hT){Tx=new Int32Array(512),Cx=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(Bu(Y3,n.lens,0,288,Tx,0,n.work,{bits:9}),t=0;t<32;)n.lens[t++]=5;Bu($3,n.lens,0,32,Cx,0,n.work,{bits:5}),hT=!1}n.lencode=Tx,n.lenbits=9,n.distcode=Cx,n.distbits=5},sP=(n,t,e,i)=>{let s;const r=n.state;return r.window===null&&(r.wsize=1<=r.wsize?(r.window.set(t.subarray(e-r.wsize,e),0),r.wnext=0,r.whave=r.wsize):(s=r.wsize-r.wnext,s>i&&(s=i),r.window.set(t.subarray(e-i,e-i+s),r.wnext),i-=s,i?(r.window.set(t.subarray(e-i,e),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=s,r.wnext===r.wsize&&(r.wnext=0),r.whave{let e,i,s,r,a,o,l,c,h,u,p,m,g,x,y=0,_,b,S,w,R,T,C,L;const P=new Uint8Array(4);let E,D;const z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(wl(n)||!n.output||!n.input&&n.avail_in!==0)return Cs;e=n.state,e.mode===$r&&(e.mode=Sx),a=n.next_out,s=n.output,l=n.avail_out,r=n.next_in,i=n.input,o=n.avail_in,c=e.hold,h=e.bits,u=o,p=l,L=_l;t:for(;;)switch(e.mode){case Ig:if(e.wrap===0){e.mode=Sx;break}for(;h<16;){if(o===0)break t;o--,c+=i[r++]<>>8&255,e.check=Hn(e.check,P,2,0),c=0,h=0,e.mode=GA;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((c&255)<<8)+(c>>8))%31){n.msg="incorrect header check",e.mode=ln;break}if((c&15)!==HA){n.msg="unknown compression method",e.mode=ln;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=ln;break}e.dmax=1<>8&1),e.flags&512&&e.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,e.check=Hn(e.check,P,2,0)),c=0,h=0,e.mode=VA;case VA:for(;h<32;){if(o===0)break t;o--,c+=i[r++]<>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,e.check=Hn(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[r++]<>8),e.flags&512&&e.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,e.check=Hn(e.check,P,2,0)),c=0,h=0,e.mode=jA;case jA:if(e.flags&1024){for(;h<16;){if(o===0)break t;o--,c+=i[r++]<>>8&255,e.check=Hn(e.check,P,2,0)),c=0,h=0}else e.head&&(e.head.extra=null);e.mode=XA;case XA: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(r,r+m),C)),e.flags&512&&e.wrap&4&&(e.check=Hn(e.check,i,m,r)),o-=m,r+=m,e.length-=m),e.length))break t;e.length=0,e.mode=qA;case qA:if(e.flags&2048){if(o===0)break t;m=0;do C=i[r+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=$r;break;case ZA:for(;h<32;){if(o===0)break t;o--,c+=i[r++]<>>=h&7,h-=h&7,e.mode=Ax;break}for(;h<3;){if(o===0)break t;o--,c+=i[r++]<>>=1,h-=1,c&3){case 0:e.mode=KA;break;case 1:if(rq(e),e.mode=ym,t===gm){c>>>=2,h-=2;break t}break;case 2:e.mode=QA;break;case 3:n.msg="invalid block type",e.mode=ln}c>>>=2,h-=2;break;case KA:for(c>>>=h&7,h-=h&7;h<32;){if(o===0)break t;o--,c+=i[r++]<>>16^65535)){n.msg="invalid stored block lengths",e.mode=ln;break}if(e.length=c&65535,c=0,h=0,e.mode=Ex,t===gm)break t;case Ex:e.mode=JA;case JA:if(m=e.length,m){if(m>o&&(m=o),m>l&&(m=l),m===0)break t;s.set(i.subarray(r,r+m),a),o-=m,r+=m,l-=m,a+=m,e.length-=m;break}e.mode=$r;break;case QA:for(;h<14;){if(o===0)break t;o--,c+=i[r++]<>>=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=ln;break}e.have=0,e.mode=tT;case tT:for(;e.have>>=3,h-=3}for(;e.have<19;)e.lens[z[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,E={bits:e.lenbits},L=Bu(YX,e.lens,0,19,e.lencode,0,e.work,E),e.lenbits=E.bits,L){n.msg="invalid code lengths set",e.mode=ln;break}e.have=0,e.mode=eT;case eT:for(;e.have>>24,b=y>>>16&255,S=y&65535,!(_<=h);){if(o===0)break t;o--,c+=i[r++]<>>=_,h-=_,e.lens[e.have++]=S;else{if(S===16){for(D=_+2;h>>=_,h-=_,e.have===0){n.msg="invalid bit length repeat",e.mode=ln;break}C=e.lens[e.have-1],m=3+(c&3),c>>>=2,h-=2}else if(S===17){for(D=_+3;h>>=_,h-=_,C=0,m=3+(c&7),c>>>=3,h-=3}else{for(D=_+7;h>>=_,h-=_,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=ln;break}for(;m--;)e.lens[e.have++]=C}}if(e.mode===ln)break;if(e.lens[256]===0){n.msg="invalid code -- missing end-of-block",e.mode=ln;break}if(e.lenbits=9,E={bits:e.lenbits},L=Bu(Y3,e.lens,0,e.nlen,e.lencode,0,e.work,E),e.lenbits=E.bits,L){n.msg="invalid literal/lengths set",e.mode=ln;break}if(e.distbits=6,e.distcode=e.distdyn,E={bits:e.distbits},L=Bu($3,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,E),e.distbits=E.bits,L){n.msg="invalid distances set",e.mode=ln;break}if(e.mode=ym,t===gm)break t;case ym:e.mode=_m;case _m:if(o>=6&&l>=258){n.next_out=a,n.avail_out=l,n.next_in=r,n.avail_in=o,e.hold=c,e.bits=h,GX(n,p),a=n.next_out,s=n.output,l=n.avail_out,r=n.next_in,i=n.input,o=n.avail_in,c=e.hold,h=e.bits,e.mode===$r&&(e.back=-1);break}for(e.back=0;y=e.lencode[c&(1<>>24,b=y>>>16&255,S=y&65535,!(_<=h);){if(o===0)break t;o--,c+=i[r++]<>w)],_=y>>>24,b=y>>>16&255,S=y&65535,!(w+_<=h);){if(o===0)break t;o--,c+=i[r++]<>>=w,h-=w,e.back+=w}if(c>>>=_,h-=_,e.back+=_,e.length=S,b===0){e.mode=aT;break}if(b&32){e.back=-1,e.mode=$r;break}if(b&64){n.msg="invalid literal/length code",e.mode=ln;break}e.extra=b&15,e.mode=nT;case nT:if(e.extra){for(D=e.extra;h>>=e.extra,h-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=iT;case iT:for(;y=e.distcode[c&(1<>>24,b=y>>>16&255,S=y&65535,!(_<=h);){if(o===0)break t;o--,c+=i[r++]<>w)],_=y>>>24,b=y>>>16&255,S=y&65535,!(w+_<=h);){if(o===0)break t;o--,c+=i[r++]<>>=w,h-=w,e.back+=w}if(c>>>=_,h-=_,e.back+=_,b&64){n.msg="invalid distance code",e.mode=ln;break}e.offset=S,e.extra=b&15,e.mode=sT;case sT:if(e.extra){for(D=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=ln;break}e.mode=rT;case rT: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=ln;break}m>e.wnext?(m-=e.wnext,g=e.wsize-m):g=e.wnext-m,m>e.length&&(m=e.length),x=e.window}else x=s,g=a-e.offset,m=e.length;m>l&&(m=l),l-=m,e.length-=m;do s[a++]=x[g++];while(--m);e.length===0&&(e.mode=_m);break;case aT:if(l===0)break t;s[a++]=e.length,l--,e.mode=_m;break;case Ax:if(e.wrap){for(;h<32;){if(o===0)break t;o--,c|=i[r++]<{if(wl(n))return Cs;let t=n.state;return t.window&&(t.window=null),n.state=null,_l},lq=(n,t)=>{if(wl(n))return Cs;const e=n.state;return e.wrap&2?(e.head=t,t.done=!1,_l):Cs},cq=(n,t)=>{const e=t.length;let i,s,r;return wl(n)||(i=n.state,i.wrap!==0&&i.mode!==O0)?Cs:i.mode===O0&&(s=1,s=pf(s,t,e,0),s!==i.check)?Z3:(r=sP(n,t,e,e),r?(i.mode=J3,K3):(i.havedict=1,_l))};var hq=eP,uq=nP,fq=tP,dq=sq,pq=iP,mq=aq,gq=oq,yq=lq,_q=cq,xq="pako inflate (from Nodeca project)",Jr={inflateReset:hq,inflateReset2:uq,inflateResetKeep:fq,inflateInit:dq,inflateInit2:pq,inflate:mq,inflateEnd:gq,inflateGetHeader:yq,inflateSetDictionary:_q,inflateInfo:xq};function vq(){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 Mq=vq;const rP=Object.prototype.toString,{Z_NO_FLUSH:bq,Z_FINISH:wq,Z_OK:yf,Z_STREAM_END:Rx,Z_NEED_DICT:Px,Z_STREAM_ERROR:Sq,Z_DATA_ERROR:uT,Z_MEM_ERROR:Eq}=Yf;function Zf(n){this.options=Pg.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 X3,this.strm.avail_out=0;let e=Jr.inflateInit2(this.strm,t.windowBits);if(e!==yf)throw new Error(ah[e]);if(this.header=new Mq,Jr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=gf.string2buf(t.dictionary):rP.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=Jr.inflateSetDictionary(this.strm,t.dictionary),e!==yf)))throw new Error(ah[e])}Zf.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let r,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?wq:bq,rP.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),r=Jr.inflate(e,a),r===Px&&s&&(r=Jr.inflateSetDictionary(e,s),r===yf?r=Jr.inflate(e,a):r===uT&&(r=Px));e.avail_in>0&&r===Rx&&e.state.wrap>0&&n[e.next_in]!==0;)Jr.inflateReset(e),r=Jr.inflate(e,a);switch(r){case Sq:case uT:case Px:case Eq:return this.onEnd(r),this.ended=!0,!1}if(o=e.avail_out,e.next_out&&(e.avail_out===0||r===Rx))if(this.options.to==="string"){let l=gf.utf8border(e.output,e.next_out),c=e.next_out-l,h=gf.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(!(r===yf&&o===0)){if(r===Rx)return r=Jr.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};Zf.prototype.onData=function(n){this.chunks.push(n)};Zf.prototype.onEnd=function(n){n===yf&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Pg.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function SM(n,t){const e=new Zf(t);if(e.push(n),e.err)throw e.msg||ah[e.err];return e.result}function Aq(n,t){return t=t||{},t.raw=!0,SM(n,t)}var Tq=Zf,Cq=SM,Rq=Aq,Pq=SM,Iq=Yf,Lq={Inflate:Tq,inflate:Cq,inflateRaw:Rq,ungzip:Pq,constants:Iq};const{Inflate:q$,inflate:Dq,inflateRaw:Y$,ungzip:$$}=Lq;var Z$=Dq;const Ix=new WeakMap;class Nq extends mi{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,s){const r=new as(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(t,a=>{this.parse(a,e,s)},i,s)}parse(t,e,i=()=>{}){this.decodeDracoFile(t,e,null,null,fn,i).catch(i)}decodeDracoFile(t,e,i,s,r=$n,a=()=>{}){const o={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:r};return this.decodeGeometry(t,o).then(e).catch(a)}decodeGeometry(t,e){const i=JSON.stringify(e);if(Ix.has(t)){const l=Ix.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 s;const r=this.workerNextTaskID++,a=t.byteLength,o=this._getWorker(r,a).then(l=>(s=l,new Promise((c,h)=>{s._callbacks[r]={resolve:c,reject:h},s.postMessage({type:"decode",id:r,taskConfig:e,buffer:t},[t])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{s&&r&&this._releaseTask(s,r)}),Ix.set(t,{key:i,promise:o}),o}_createGeometry(t){const e=new ve;t.index&&e.setIndex(new De(t.index.array,1));for(let i=0;i{i.load(t,s,void 0,r)})}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 s=i[0];t||(this.decoderConfig.wasmBinary=i[1]);const r=Oq.toString(),a=["/* draco decoder */",s,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(t,e){return this._initDecoder().then(()=>{if(this.workerPool.lengthr._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(x=>x.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 x={index:null,attributes:[]};for(const y in h){const _=self[u[y]];let b,S;if(c.useUniqueIDs)S=h[y],b=o.GetAttributeByUniqueId(p,S);else{if(S=o.GetAttributeId(p,a[h[y]]),S===-1)continue;b=o.GetAttribute(p,S)}const w=s(a,o,p,y,_,b);y==="color"&&(w.vertexColorSpace=c.vertexColorSpace),x.attributes.push(w)}return g===a.TRIANGULAR_MESH&&(x.index=i(a,o,p)),a.destroy(p),x}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 s(a,o,l,c,h,u){const p=u.num_components(),g=l.num_points()*p,x=g*h.BYTES_PER_ELEMENT,y=r(a,h),_=a._malloc(x);o.GetAttributeDataArrayForAllPoints(l,u,y,x,_);const b=new h(a.HEAPF32.buffer,_,g).slice();return a._free(_),{name:c,array:b,itemSize:p}}function r(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 Fq extends mi{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new Hq(e)}),this.register(function(e){return new Gq(e)}),this.register(function(e){return new Kq(e)}),this.register(function(e){return new Jq(e)}),this.register(function(e){return new Qq(e)}),this.register(function(e){return new Wq(e)}),this.register(function(e){return new jq(e)}),this.register(function(e){return new Xq(e)}),this.register(function(e){return new qq(e)}),this.register(function(e){return new Bq(e)}),this.register(function(e){return new Yq(e)}),this.register(function(e){return new Vq(e)}),this.register(function(e){return new Zq(e)}),this.register(function(e){return new $q(e)}),this.register(function(e){return new kq(e)}),this.register(function(e){return new tY(e)}),this.register(function(e){return new eY(e)})}load(t,e,i,s){const r=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const c=Ga.extractUrlBase(t);a=Ga.resolveURL(c,this.path)}else a=Ga.extractUrlBase(t);this.manager.itemStart(t);const o=function(c){s?s(c):console.error(c),r.manager.itemError(t),r.manager.itemEnd(t)},l=new as(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(t,function(c){try{r.parse(c,a,function(h){e(h),r.manager.itemEnd(t)},o)}catch(h){o(h)}},i,o)}setDRACOLoader(t){return this.dracoLoader=t,this}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,s){let r;const a={},o={},l=new TextDecoder;if(typeof t=="string")r=JSON.parse(t);else if(t instanceof ArrayBuffer)if(l.decode(new Uint8Array(t,0,4))===aP){try{a[ke.KHR_BINARY_GLTF]=new nY(t)}catch(u){s&&s(u);return}r=JSON.parse(a[ke.KHR_BINARY_GLTF].content)}else r=JSON.parse(l.decode(t));else r=t;if(r.asset===void 0||r.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new mY(r,{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,s)}parseAsync(t,e){const i=this;return new Promise(function(s,r){i.parse(t,e,s,r)})}}function Uq(){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 ke={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 kq{constructor(t){this.parser=t,this.name=ke.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,s=e.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,r.source,a)}}class Jq{constructor(t){this.parser=t,this.name=ke.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,s=i.json,r=s.textures[t];if(!r.extensions||!r.extensions[e])return null;const a=r.extensions[e],o=s.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(s.extensionsRequired&&s.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 Qq{constructor(t){this.parser=t,this.name=ke.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,s=i.json,r=s.textures[t];if(!r.extensions||!r.extensions[e])return null;const a=r.extensions[e],o=s.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(s.extensionsRequired&&s.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 tY{constructor(t){this.name=ke.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 s=i.extensions[this.name],r=this.parser.getDependency("buffer",s.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 r.then(function(o){const l=s.byteOffset||0,c=s.byteLength||0,h=s.count,u=s.byteStride,p=new Uint8Array(o,l,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(h,u,p,s.mode,s.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,s.mode,s.filter),m})})}else return null}}class eY{constructor(t){this.name=ke.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 s=e.meshes[i.mesh];for(const c of s.primitives)if(c.mode!==vs.TRIANGLES&&c.mode!==vs.TRIANGLE_STRIP&&c.mode!==vs.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 x=new ye,y=new O,_=new Cn,b=new O(1,1,1),S=new m1(g.geometry,g.material,p);for(let w=0;w0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":n.search(/\.ktx2($|\?)/i)>0||n.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const pY=new ye;class mY{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new Uq,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,s=-1,r=!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+)/);s=i&&l?parseInt(l[1],10):-1,r=o.indexOf("Firefox")>-1,a=r?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&s<17||r&&a<98?this.textureLoader=new I1(this.options.manager):this.textureLoader=new WC(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new as(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,s=this.json,r=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][s.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:s.asset,parser:i,userData:{}};return Fo(r,o,s),Zr(o,s),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 s=0,r=e.length;s{const l=this.associations.get(a);l!=null&&this.associations.set(o,l);for(const[c,h]of a.children.entries())r(h,o.children[c])};return r(i,s),s.name+="_instance_"+t.uses[e]++,s}_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.")}y.normalized=g}return y})}loadTexture(t){const e=this.json,i=this.options,r=e.textures[t].source,a=e.images[r];let o=this.textureLoader;if(a.uri){const l=i.manager.getHandler(a.uri);l!==null&&(o=l)}return this.loadTextureImage(t,r,o)}loadTextureImage(t,e,i){const s=this,r=this.json,a=r.textures[t],o=r.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=(r.samplers||{})[a.sampler]||{};return h.magFilter=dT[p.magFilter]||yn,h.minFilter=dT[p.minFilter]||ws,h.wrapS=pT[p.wrapS]||$a,h.wrapT=pT[p.wrapT]||$a,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==Dn&&h.minFilter!==yn,s.associations.set(h,{textures:t}),h}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(t,e){const i=this,s=this.json,r=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(u=>u.clone());const a=s.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(x){const y=new bn(x);y.needsUpdate=!0,p(y)}),e.load(Ga.resolveURL(u,r.path),g,void 0,m)})}).then(function(u){return c===!0&&o.revokeObjectURL(l),Zr(u,a),u.userData.mimeType=a.mimeType||dY(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,s){const r=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),r.extensions[ke.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[ke.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(a);a=r.extensions[ke.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),r.associations.set(a,l)}}return s!==void 0&&(a.colorSpace=s),t[e]=a,a})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const s=e.attributes.tangent===void 0,r=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 Lf,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 Zn,Rn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(o,l)),i=l}if(s||r||a){let o="ClonedMaterial:"+i.uuid+":";s&&(o+="derivative-tangents:"),r&&(o+="vertex-colors:"),a&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=i.clone(),r&&(l.vertexColors=!0),a&&(l.flatShading=!0),s&&(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 dh}loadMaterial(t){const e=this,i=this.json,s=this.extensions,r=i.materials[t];let a;const o={},l=r.extensions||{},c=[];if(l[ke.KHR_MATERIALS_UNLIT]){const u=s[ke.KHR_MATERIALS_UNLIT];a=u.getMaterialType(),c.push(u.extendParams(o,r,e))}else{const u=r.pbrMetallicRoughness||{};if(o.color=new kt(1,1,1),o.opacity=1,Array.isArray(u.baseColorFactor)){const p=u.baseColorFactor;o.color.setRGB(p[0],p[1],p[2],$n),o.opacity=p[3]}u.baseColorTexture!==void 0&&c.push(e.assignTexture(o,"map",u.baseColorTexture,fn)),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)})))}r.doubleSided===!0&&(o.side=fi);const h=r.alphaMode||Dx.OPAQUE;if(h===Dx.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,h===Dx.MASK&&(o.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&a!==ns&&(c.push(e.assignTexture(o,"normalMap",r.normalTexture)),o.normalScale=new xt(1,1),r.normalTexture.scale!==void 0)){const u=r.normalTexture.scale;o.normalScale.set(u,u)}if(r.occlusionTexture!==void 0&&a!==ns&&(c.push(e.assignTexture(o,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&a!==ns){const u=r.emissiveFactor;o.emissive=new kt().setRGB(u[0],u[1],u[2],$n)}return r.emissiveTexture!==void 0&&a!==ns&&c.push(e.assignTexture(o,"emissiveMap",r.emissiveTexture,fn)),Promise.all(c).then(function(){const u=new a(o);return r.name&&(u.name=r.name),Zr(u,r),e.associations.set(u,{materials:t}),r.extensions&&Fo(s,u,r),u})}createUniqueName(t){const e=He.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,s=this.primitiveCache;function r(o){return i[ke.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,e).then(function(l){return mT(l,o,e)})}const a=[];for(let o=0,l=t.length;o0&&uY(_,r),_.name=e.createUniqueName(r.name||"mesh_"+t),Zr(_,r),y.extensions&&Fo(s,_,y),e.assignFinalMaterial(_),u.push(_)}for(let m=0,g=u.length;m1?h=new na:c.length===1?h=c[0]:h=new qe,h!==c[0])for(let u=0,p=c.length;u{const u=new Map;for(const[p,m]of s.associations)(p instanceof Rn||p instanceof bn)&&u.set(p,m);return h.traverse(p=>{const m=s.associations.get(p);m!=null&&u.set(p,m)}),u};return s.associations=c(r),r})}_createAnimationTracks(t,e,i,s,r){const a=[],o=t.name?t.name:t.uuid,l=[];Ua[r.path]===Ua.weights?t.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(o);let c;switch(Ua[r.path]){case Ua.weights:c=fl;break;case Ua.rotation:c=dl;break;case Ua.position:case Ua.scale:c=pl;break;default:switch(i.itemSize){case 1:c=fl;break;case 2:case 3:default:c=pl;break}break}const h=s.interpolation!==void 0?lY[s.interpolation]:Kc,u=this._getArrayFromAccessor(i);for(let p=0,m=l.length;pvY(s));return(await Promise.all(e)).flat()}async function vY(n){const{tile:t,center:e}=n,i=`https://maps.heidler.info/germany-draco/15-${t.x}-${t.y}.glb`;try{const s=await cP.loadAsync(i);let r=[];for(let l of s.scenes)for(let c of l.children){let h=c.geometry;const u=new ye;u.makeScale(1/8192,1/8192,1);const p=new ye;p.makeTranslation(t.x-e.x,t.y-e.y,0);const m=new ye;m.makeScale(gT(),-gT(),1);const g=m;g.multiply(p),g.multiply(u),h.applyMatrix4(g),h=h.toNonIndexed();let x={};const y=h.attributes.position.array,_=h.attributes.normal.array,b=h.attributes._feature_id_0.array;for(let S=0;Sp.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 bY(n){return!n||!n.bbox||!n.data?(console.error("Invalid heightmap data, missing bbox or data"),null):{...n,data:new Float32Array(n.data)}}function wY(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 s={surrounding:[],background:[]};n.bbox;const[r,a]=km,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),x=n.bbox[3]+(n.bbox[1]-n.bbox[3])*(u/n.height),y=(g-r)*F0(),_=(x-a)*F0();p%100+u%100==0&&console.log(y,_);const b=(y-c)*(y-c)+(_-h)*(_-h);if(b<=l){const S=SY(y,_,m);b<=o?s.surrounding.push(S):s.background.push(S)}}}return console.log("Vegetation processing complete."),console.log("Surrounding geometries:",s.surrounding.length),console.log("Background geometries:",s.background.length),s}function SY(n,t,e){const r=new io(1,1,20).toNonIndexed().deleteAttribute("uv");return r.translate(n,t,e-10),r}const uP=[0,0,.2],fP=[1,.2,.1],dP=[1,1,.1];async function EY(n){if(window.setAttribution)for(let t of Object.values(window.setAttribution))t(!1);if(typeof n<"u"&&n!=null){let r=function(l,c){return window.setSimulationProgress(l*100/c)};const t=await xY(n);let e=hP(t,new O(0,0,0),80);if(window.setGeometries(e),e.simulation.length==0)return window.setFrontendState("ErrorAdress"),{simulationMesh:void 0};const i=new n3(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(hM.interpolateThreeColors({c0:uP,c1:fP,c2:dP})),yY()=="BY"){const[l,c]=km;console.log("coordinatesWebMercator:"+km);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 MY(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=bY(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=wY(m,new O(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(x=>{i.addShadingGeometry(x)}),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 s=window.numSimulations||80;const a=await i.calculate({numberSimulations:s,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:r});let o=new O;return a.geometry.computeBoundingBox(),a.geometry.boundingBox.getCenter(o),a.middle=o,{simulationMesh:a}}}async function AY(n){let t=SR(n.selectedMesh.map(m=>m.geometry));t.computeBoundingBox(),t.computeBoundingSphere();let e=new O;t.boundingBox.getCenter(e),console.log(n.geometries);const i=t.boundingSphere.radius+80,s=[...n.geometries.surrounding,...n.geometries.background,...n.geometries.simulation],r=hP(s,e,i),a=new n3(parseFloat(n.geoLocation.lat),parseFloat(n.geoLocation.lon));a.addColorMap(hM.interpolateThreeColors({c0:uP,c1:fP,c2:dP})),a.addSimulationGeometry(t),r.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 ph({vertexColors:!0,side:fi});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([])}const TY=({selectedMesh:n,setSelectedMesh:t,simulationMeshes:e,setSimulationMeshes:i,geometries:s,geoLocation:r})=>{const{isOpen:a,onClose:o,onOpen:l}=sl(),[c,h]=J.useState(!1),{t:u}=Qa();J.useEffect(()=>{n.length>0&&l()},[n]);const p=()=>{o(),t([])};if(!a)return null;const m=async()=>{h(!0);try{await AY({selectedMesh:n,setSelectedMesh:t,simulationMeshes:e,setSimulationMeshes:i,geometries:s,geoLocation:r})}finally{h(!1),o()}};return V.jsx(ca,{position:"fixed",bottom:4,left:"50%",transform:"translateX(-50%)",width:"300px",zIndex:9999,children:V.jsxs(TT,{alignItems:"start",boxShadow:"md",rounded:"md",colorScheme:"gray",children:[V.jsx(ca,{width:"100%",children:V.jsx($v,{spacing:2,justify:"start",children:V.jsx(yr,{isLoading:c,colorScheme:"teal",onClick:m,children:u("button.simulateBuilding")})})}),V.jsx(CT,{position:"absolute",right:1,top:1,onClick:p})]})})};function CY({selectedPVSystem:n,setSelectedPVSystem:t,onCloseAlert:e}){const{isOpen:i,onOpen:s,onClose:r}=sl({defaultIsOpen:!1}),{isOpen:a,onToggle:o}=sl({defaultIsOpen:!1}),{t:l}=Qa(),[c,h]=J.useState("3000"),[u,p]=J.useState("0"),[m,g]=J.useState("30"),[x,y]=J.useState(0),[_,b]=J.useState(0),S=L=>L.replace(",","."),w=L=>P=>{const E=P.target.value;(E===""||/^[0-9]*[.,]?[0-9]*$/.test(E))&&L(E)};let R;n.length>0&&(R=Math.round(n.reduce((L,P)=>L+P.annualYield,0)));async function T(){async function L({pvProduction:P,consumptionHousehold:E,storageCapacity:D,electricityPrice:z,setSelfConsumption:G,setAnnualSavings:W}){const Y=await(await fetch("https://www.openpv.de/data/savings_calculation/cons_prod.json")).json(),ot=Y.Consumption,H=Y.Production,Z={};let it=0;for(const lt in ot){const _t=ot[lt]*E/1e3,q=H[lt]*P/1e3;let rt=0,St=0;if(q>_t){rt=_t,St=q-_t;const dt=D-it,It=Math.min(St,dt);it+=It}else{const dt=_t-q,It=Math.min(dt,it);it-=It,rt=q+It}Z[lt]=rt}let $=Object.values(Z).reduce((lt,_t)=>lt+_t,0);G(Math.round($)),W(Math.round($*z/100))}await L({pvProduction:R,consumptionHousehold:parseFloat(S(c)),storageCapacity:parseFloat(S(u)),electricityPrice:parseFloat(S(m)),setSelfConsumption:y,setAnnualSavings:b})}const C=z0.useRef(null);return V.jsxs(V.Fragment,{children:[n.length>0&&V.jsx(yr,{colorScheme:"teal",onClick:()=>{s()},children:l("savingsCalculation.button")}),V.jsxs(Fv,{isOpen:i,onClose:()=>{r(),e(),t([])},size:"xl",children:[V.jsx(Uv,{}),V.jsxs(RT,{children:[V.jsx(kv,{children:l("savingsCalculation.button")}),V.jsx(zv,{}),V.jsx(Bv,{children:V.jsxs(V.Fragment,{children:[V.jsxs(Gy,{children:[V.jsxs(vu,{children:[l("savingsCalculation.consumptionTitle"),V.jsx(Sf,{label:l("savingsCalculation.consumptionHelperInfo"),children:V.jsx(Bo,{color:"teal",fontSize:"xs",children:l("savingsCalculation.consumptionHelperLabel")})})]}),V.jsx(Vy,{ref:C,value:c,onChange:w(h)})]}),V.jsx("br",{}),V.jsxs(Gy,{children:[V.jsx(vu,{children:l("savingsCalculation.storageTitle")}),V.jsx(Vy,{value:u,onChange:w(p)})]}),V.jsx("br",{}),V.jsxs(Gy,{children:[V.jsx(vu,{children:l("savingsCalculation.electricityPriceTitle")}),V.jsx(Vy,{placeholder:l("savingsCalculation.electricityPricePlaceholder"),value:m,onChange:w(g)})]}),V.jsx(zT,{in:a,animateOpacity:!0,children:V.jsxs(ca,{p:"40px",color:"white",mt:"4",bg:"teal",rounded:"md",shadow:"md",children:[V.jsx(Bo,{children:l("savingsCalculation.disclaimer")}),V.jsxs(PT,{children:[V.jsxs(Go,{children:[l("savingsCalculation.results.production"),V.jsxs(Bo,{as:"b",color:"white",children:[R," kWh"]})]}),V.jsxs(Go,{children:[l("savingsCalculation.results.consumption"),V.jsxs(Bo,{as:"b",color:"white",children:[x," kWh"]})]}),V.jsxs(Go,{children:[l("savingsCalculation.results.savings"),V.jsxs(Bo,{as:"b",color:"white",children:[_,"€"]})]})]})]})}),V.jsx("br",{})]})}),V.jsx(TI,{children:V.jsx(yr,{mr:3,onClick:()=>{T(),a||o()},children:l("savingsCalculation.calculate")})})]})]})]})}const RY=({selectedPVSystem:n,setSelectedPVSystem:t,setPVSystems:e})=>{const{isOpen:i,onClose:s,onOpen:r}=sl(),{t:a}=Qa();J.useEffect(()=>{n.length>0&&r()},[n]);const o=()=>{s(),t([])};return i?V.jsx(ca,{position:"fixed",bottom:4,left:"50%",transform:"translateX(-50%)",width:"300px",zIndex:9999,children:V.jsxs(TT,{alignItems:"start",boxShadow:"md",rounded:"md",colorScheme:"gray",children:[V.jsxs(ca,{width:"100%",children:[V.jsx(hI,{display:"block",mb:2,children:a("savingsCalculation.notificationLabel")}),V.jsxs($v,{spacing:2,justify:"start",children:[V.jsx(CY,{selectedPVSystem:n,setSelectedPVSystem:t,onCloseAlert:s}),V.jsx(yr,{colorScheme:"teal",onClick:()=>{e([]),t([]),s()},children:a("delete")})]})]}),V.jsx(CT,{position:"absolute",right:1,top:1,onClick:o})]})}):null};function PY({frontendState:n,setFrontendState:t,showTerrain:e,setShowTerrain:i,selectedMesh:s,setSelectedMesh:r,selectedPVSystem:a,setSelectedPVSystem:o,geometries:l,geoLocation:c,pvSystems:h,setPVSystems:u,pvPoints:p,setPVPoints:m,simulationMeshes:g,setSimulationMeshes:x}){const{isOpen:y,onOpen:_,onClose:b}=sl(),{isOpen:S,onOpen:w,onClose:R}=sl(),{t:T}=Qa(),C=z0.useRef(),L=()=>{_6({setPVSystems:u,setSelectedPVSystem:o,pvPoints:p,setPVPoints:m,simulationMeshes:g}),t("Results")},P=()=>{t("Results")};return V.jsxs(V.Fragment,{children:[V.jsxs(IY,{children:[V.jsx(RY,{selectedPVSystem:a,setSelectedPVSystem:o,setPVSystems:u}),V.jsx(TY,{selectedMesh:s,setSelectedMesh:r,simulationMeshes:g,setSimulationMeshes:x,geometries:l,geoLocation:c}),n=="Results"&&V.jsx(V.Fragment,{children:V.jsx(yr,{ref:C,colorScheme:"teal",onClick:_,variant:"link",zIndex:100,children:T("button.options")})}),V.jsx(yr,{onClick:w,colorScheme:"teal",variant:"link",children:T("mapControlHelp.button")}),V.jsx(NY,{isOpen:S,onClose:R}),V.jsx(DY,{isOpen:y,onClose:b,showTerrain:e,setShowTerrain:i})]}),V.jsxs(LY,{children:[n=="Results"&&V.jsx(w5,{buttonLabel:T("button.drawPVSystem"),onClick:()=>{t("DrawPV"),b()},className:h.length==0?"button-high-prio":"",hoverText:T("button.drawPVSystemHover")}),n=="DrawPV"&&V.jsxs(V.Fragment,{children:[p.length>0&&V.jsxs(V.Fragment,{children:[V.jsx(yr,{className:"button-high-prio",onClick:L,children:T("button.createPVSystem")}),V.jsx(yr,{onClick:()=>{m(p.slice(0,-1))},children:T("button.deleteLastPoint")})]}),V.jsx(yr,{onClick:P,children:T("button.cancel")})]})]})]})}const IY=({children:n})=>V.jsx(V.Fragment,{children:V.jsx(ca,{display:"flex",flexDirection:"row",justifyContent:"flex-start",pointerEvents:"none",zIndex:100,minWidth:0,minHeight:0,overflow:"hidden",sx:{"> *":{pointerEvents:"auto"}},children:V.jsx(ca,{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})})}),LY=({children:n})=>V.jsx(V.Fragment,{children:V.jsx(ca,{display:"flex",flexDirection:"column",justifyContent:"space-between",pointerEvents:"none",zIndex:100,minWidth:0,minHeight:0,overflow:"hidden",sx:{"> *":{pointerEvents:"auto"}},children:V.jsx(ca,{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})})}),DY=({isOpen:n,onClose:t,showTerrain:e,setShowTerrain:i})=>{const{t:s}=Qa(),[r,a]=z0.useState(window.numSimulations);return V.jsx(PI,{spacing:"24px",children:V.jsxs(QD,{isOpen:n,placement:"left",onClose:t,size:"xs",children:[V.jsx(Uv,{}),V.jsxs(KT,{height:"100%",children:[V.jsx(zv,{}),V.jsx(kv,{children:s("button.options")}),V.jsx(Bv,{children:V.jsxs(V.Fragment,{children:[V.jsx(Bo,{as:"b",children:s("sidebar.header")}),V.jsx(Bo,{children:s("sidebar.mainText")}),V.jsxs(vu,{children:[s("button.showMap"),V.jsx(i2,{isChecked:e,onChange:()=>i(o=>!o),colorScheme:"teal",margin:"5px"})]}),V.jsx(E5,{sliderProps:{min:1,max:200},label:s("sidebar.numberSimulations"),hoverHelpLabel:s("sidebar.numberSimulationsHover"),sliderValue:r,setSliderValue:o=>{a(o),window.numSimulations=o}})]})})]})]})})},NY=({isOpen:n,onClose:t})=>{const{t:e}=Qa(),i=window.isTouchDevice?"touch.":"";return V.jsxs(Fv,{isOpen:n,onClose:t,children:[V.jsx(Uv,{}),V.jsxs(RT,{children:[V.jsx(kv,{children:e("mapControlHelp.title")}),V.jsx(zv,{}),V.jsx(Bv,{children:V.jsxs(PT,{children:[V.jsx(Go,{children:e(`mapControlHelp.${i}leftMouse`)}),V.jsx(Go,{children:e(`mapControlHelp.${i}rightMouse`)}),V.jsx(Go,{children:e(`mapControlHelp.${i}wheel`)}),V.jsx(Go,{children:e(`mapControlHelp.${i}doubleClick`)})]})})]})]})};var OY=Object.defineProperty,FY=(n,t,e)=>t in n?OY(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ge=(n,t,e)=>(FY(n,typeof t!="symbol"?t+"":t,e),e);const xm=new no,yT=new gr,UY=Math.cos(70*(Math.PI/180)),_T=(n,t)=>(n%t+t)%t;let kY=class extends Zs{constructor(t,e){super(),ge(this,"object"),ge(this,"domElement"),ge(this,"enabled",!0),ge(this,"target",new O),ge(this,"minDistance",0),ge(this,"maxDistance",1/0),ge(this,"minZoom",0),ge(this,"maxZoom",1/0),ge(this,"minPolarAngle",0),ge(this,"maxPolarAngle",Math.PI),ge(this,"minAzimuthAngle",-1/0),ge(this,"maxAzimuthAngle",1/0),ge(this,"enableDamping",!1),ge(this,"dampingFactor",.05),ge(this,"enableZoom",!0),ge(this,"zoomSpeed",1),ge(this,"enableRotate",!0),ge(this,"rotateSpeed",1),ge(this,"enablePan",!0),ge(this,"panSpeed",1),ge(this,"screenSpacePanning",!0),ge(this,"keyPanSpeed",7),ge(this,"zoomToCursor",!1),ge(this,"autoRotate",!1),ge(this,"autoRotateSpeed",2),ge(this,"reverseOrbit",!1),ge(this,"reverseHorizontalOrbit",!1),ge(this,"reverseVerticalOrbit",!1),ge(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ge(this,"mouseButtons",{LEFT:Gn.ROTATE,MIDDLE:Gn.DOLLY,RIGHT:Gn.PAN}),ge(this,"touches",{ONE:ts.ROTATE,TWO:ts.DOLLY_PAN}),ge(this,"target0"),ge(this,"position0"),ge(this,"zoom0"),ge(this,"_domElementKeyEvents",null),ge(this,"getPolarAngle"),ge(this,"getAzimuthalAngle"),ge(this,"setPolarAngle"),ge(this,"setAzimuthalAngle"),ge(this,"getDistance"),ge(this,"getZoomScale"),ge(this,"listenToKeyEvents"),ge(this,"stopListenToKeyEvents"),ge(this,"saveState"),ge(this,"reset"),ge(this,"update"),ge(this,"connect"),ge(this,"dispose"),ge(this,"dollyIn"),ge(this,"dollyOut"),ge(this,"getScale"),ge(this,"setScale"),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=X=>{let bt=_T(X,2*Math.PI),Gt=h.phi;Gt<0&&(Gt+=2*Math.PI),bt<0&&(bt+=2*Math.PI);let j=Math.abs(bt-Gt);2*Math.PI-j{let bt=_T(X,2*Math.PI),Gt=h.theta;Gt<0&&(Gt+=2*Math.PI),bt<0&&(bt+=2*Math.PI);let j=Math.abs(bt-Gt);2*Math.PI-ji.object.position.distanceTo(i.target),this.listenToKeyEvents=X=>{X.addEventListener("keydown",zt),this._domElementKeyEvents=X},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",zt),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(s),i.update(),l=o.NONE},this.update=(()=>{const X=new O,bt=new O(0,1,0),Gt=new Cn().setFromUnitVectors(t.up,bt),j=Gt.clone().invert(),Ot=new O,pt=new Cn,At=2*Math.PI;return function(){const Wt=i.object.position;Gt.setFromUnitVectors(t.up,bt),j.copy(Gt).invert(),X.copy(Wt).sub(i.target),X.applyQuaternion(Gt),h.setFromVector3(X),i.autoRotate&&l===o.NONE&&W(z()),i.enableDamping?(h.theta+=u.theta*i.dampingFactor,h.phi+=u.phi*i.dampingFactor):(h.theta+=u.theta,h.phi+=u.phi);let pe=i.minAzimuthAngle,Be=i.maxAzimuthAngle;isFinite(pe)&&isFinite(Be)&&(pe<-Math.PI?pe+=At:pe>Math.PI&&(pe-=At),Be<-Math.PI?Be+=At:Be>Math.PI&&(Be-=At),pe<=Be?h.theta=Math.max(pe,Math.min(Be,h.theta)):h.theta=h.theta>(pe+Be)/2?Math.max(pe,h.theta):Math.min(Be,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=_t(h.radius):h.radius=_t(h.radius*p),X.setFromSpherical(h),X.applyQuaternion(j),Wt.copy(i.target).add(X),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 nn=!1;if(i.zoomToCursor&&P){let Fe=null;if(i.object instanceof gn&&i.object.isPerspectiveCamera){const wn=X.length();Fe=_t(wn*p);const Jn=wn-Fe;i.object.position.addScaledVector(C,Jn),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const wn=new O(L.x,L.y,0);wn.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),nn=!0;const Jn=new O(L.x,L.y,0);Jn.unproject(i.object),i.object.position.sub(Jn).add(wn),i.object.updateMatrixWorld(),Fe=X.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Fe!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Fe).add(i.object.position):(xm.origin.copy(i.object.position),xm.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(xm.direction))c||8*(1-pt.dot(i.object.quaternion))>c?(i.dispatchEvent(s),Ot.copy(i.object.position),pt.copy(i.object.quaternion),nn=!1,!0):!1}})(),this.connect=X=>{i.domElement=X,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",at),i.domElement.addEventListener("pointerdown",N),i.domElement.addEventListener("pointercancel",yt),i.domElement.addEventListener("wheel",te)},this.dispose=()=>{var X,bt,Gt,j,Ot,pt;i.domElement&&(i.domElement.style.touchAction="auto"),(X=i.domElement)==null||X.removeEventListener("contextmenu",at),(bt=i.domElement)==null||bt.removeEventListener("pointerdown",N),(Gt=i.domElement)==null||Gt.removeEventListener("pointercancel",yt),(j=i.domElement)==null||j.removeEventListener("wheel",te),(Ot=i.domElement)==null||Ot.ownerDocument.removeEventListener("pointermove",st),(pt=i.domElement)==null||pt.ownerDocument.removeEventListener("pointerup",yt),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",zt)};const i=this,s={type:"change"},r={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 O,g=new xt,x=new xt,y=new xt,_=new xt,b=new xt,S=new xt,w=new xt,R=new xt,T=new xt,C=new O,L=new xt;let P=!1;const E=[],D={};function z(){return 2*Math.PI/60/60*i.autoRotateSpeed}function G(){return Math.pow(.95,i.zoomSpeed)}function W(X){i.reverseOrbit||i.reverseHorizontalOrbit?u.theta+=X:u.theta-=X}function Q(X){i.reverseOrbit||i.reverseVerticalOrbit?u.phi+=X:u.phi-=X}const Y=(()=>{const X=new O;return function(Gt,j){X.setFromMatrixColumn(j,0),X.multiplyScalar(-Gt),m.add(X)}})(),ot=(()=>{const X=new O;return function(Gt,j){i.screenSpacePanning===!0?X.setFromMatrixColumn(j,1):(X.setFromMatrixColumn(j,0),X.crossVectors(i.object.up,X)),X.multiplyScalar(Gt),m.add(X)}})(),H=(()=>{const X=new O;return function(Gt,j){const Ot=i.domElement;if(Ot&&i.object instanceof gn&&i.object.isPerspectiveCamera){const pt=i.object.position;X.copy(pt).sub(i.target);let At=X.length();At*=Math.tan(i.object.fov/2*Math.PI/180),Y(2*Gt*At/Ot.clientHeight,i.object.matrix),ot(2*j*At/Ot.clientHeight,i.object.matrix)}else Ot&&i.object instanceof aa&&i.object.isOrthographicCamera?(Y(Gt*(i.object.right-i.object.left)/i.object.zoom/Ot.clientWidth,i.object.matrix),ot(j*(i.object.top-i.object.bottom)/i.object.zoom/Ot.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function Z(X){i.object instanceof gn&&i.object.isPerspectiveCamera||i.object instanceof aa&&i.object.isOrthographicCamera?p=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function it(X){Z(p/X)}function $(X){Z(p*X)}function lt(X){if(!i.zoomToCursor||!i.domElement)return;P=!0;const bt=i.domElement.getBoundingClientRect(),Gt=X.clientX-bt.left,j=X.clientY-bt.top,Ot=bt.width,pt=bt.height;L.x=Gt/Ot*2-1,L.y=-(j/pt)*2+1,C.set(L.x,L.y,1).unproject(i.object).sub(i.object.position).normalize()}function _t(X){return Math.max(i.minDistance,Math.min(i.maxDistance,X))}function q(X){g.set(X.clientX,X.clientY)}function rt(X){lt(X),w.set(X.clientX,X.clientY)}function St(X){_.set(X.clientX,X.clientY)}function dt(X){x.set(X.clientX,X.clientY),y.subVectors(x,g).multiplyScalar(i.rotateSpeed);const bt=i.domElement;bt&&(W(2*Math.PI*y.x/bt.clientHeight),Q(2*Math.PI*y.y/bt.clientHeight)),g.copy(x),i.update()}function It(X){R.set(X.clientX,X.clientY),T.subVectors(R,w),T.y>0?it(G()):T.y<0&&$(G()),w.copy(R),i.update()}function Ht(X){b.set(X.clientX,X.clientY),S.subVectors(b,_).multiplyScalar(i.panSpeed),H(S.x,S.y),_.copy(b),i.update()}function Bt(X){lt(X),X.deltaY<0?$(G()):X.deltaY>0&&it(G()),i.update()}function Qt(X){let bt=!1;switch(X.code){case i.keys.UP:H(0,i.keyPanSpeed),bt=!0;break;case i.keys.BOTTOM:H(0,-i.keyPanSpeed),bt=!0;break;case i.keys.LEFT:H(i.keyPanSpeed,0),bt=!0;break;case i.keys.RIGHT:H(-i.keyPanSpeed,0),bt=!0;break}bt&&(X.preventDefault(),i.update())}function ht(){if(E.length==1)g.set(E[0].pageX,E[0].pageY);else{const X=.5*(E[0].pageX+E[1].pageX),bt=.5*(E[0].pageY+E[1].pageY);g.set(X,bt)}}function gt(){if(E.length==1)_.set(E[0].pageX,E[0].pageY);else{const X=.5*(E[0].pageX+E[1].pageX),bt=.5*(E[0].pageY+E[1].pageY);_.set(X,bt)}}function k(){const X=E[0].pageX-E[1].pageX,bt=E[0].pageY-E[1].pageY,Gt=Math.sqrt(X*X+bt*bt);w.set(0,Gt)}function Et(){i.enableZoom&&k(),i.enablePan&>()}function wt(){i.enableZoom&&k(),i.enableRotate&&ht()}function Lt(X){if(E.length==1)x.set(X.pageX,X.pageY);else{const Gt=Vt(X),j=.5*(X.pageX+Gt.x),Ot=.5*(X.pageY+Gt.y);x.set(j,Ot)}y.subVectors(x,g).multiplyScalar(i.rotateSpeed);const bt=i.domElement;bt&&(W(2*Math.PI*y.x/bt.clientHeight),Q(2*Math.PI*y.y/bt.clientHeight)),g.copy(x)}function Ct(X){if(E.length==1)b.set(X.pageX,X.pageY);else{const bt=Vt(X),Gt=.5*(X.pageX+bt.x),j=.5*(X.pageY+bt.y);b.set(Gt,j)}S.subVectors(b,_).multiplyScalar(i.panSpeed),H(S.x,S.y),_.copy(b)}function ne(X){const bt=Vt(X),Gt=X.pageX-bt.x,j=X.pageY-bt.y,Ot=Math.sqrt(Gt*Gt+j*j);R.set(0,Ot),T.set(0,Math.pow(R.y/w.y,i.zoomSpeed)),it(T.y),w.copy(R)}function Ft(X){i.enableZoom&&ne(X),i.enablePan&&Ct(X)}function U(X){i.enableZoom&&ne(X),i.enableRotate&&Lt(X)}function N(X){var bt,Gt;i.enabled!==!1&&(E.length===0&&((bt=i.domElement)==null||bt.ownerDocument.addEventListener("pointermove",st),(Gt=i.domElement)==null||Gt.ownerDocument.addEventListener("pointerup",yt)),Tt(X),X.pointerType==="touch"?Zt(X):Rt(X))}function st(X){i.enabled!==!1&&(X.pointerType==="touch"?Re(X):Mt(X))}function yt(X){var bt,Gt,j;ae(X),E.length===0&&((bt=i.domElement)==null||bt.releasePointerCapture(X.pointerId),(Gt=i.domElement)==null||Gt.ownerDocument.removeEventListener("pointermove",st),(j=i.domElement)==null||j.ownerDocument.removeEventListener("pointerup",yt)),i.dispatchEvent(a),l=o.NONE}function Rt(X){let bt;switch(X.button){case 0:bt=i.mouseButtons.LEFT;break;case 1:bt=i.mouseButtons.MIDDLE;break;case 2:bt=i.mouseButtons.RIGHT;break;default:bt=-1}switch(bt){case Gn.DOLLY:if(i.enableZoom===!1)return;rt(X),l=o.DOLLY;break;case Gn.ROTATE:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enablePan===!1)return;St(X),l=o.PAN}else{if(i.enableRotate===!1)return;q(X),l=o.ROTATE}break;case Gn.PAN:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enableRotate===!1)return;q(X),l=o.ROTATE}else{if(i.enablePan===!1)return;St(X),l=o.PAN}break;default:l=o.NONE}l!==o.NONE&&i.dispatchEvent(r)}function Mt(X){if(i.enabled!==!1)switch(l){case o.ROTATE:if(i.enableRotate===!1)return;dt(X);break;case o.DOLLY:if(i.enableZoom===!1)return;It(X);break;case o.PAN:if(i.enablePan===!1)return;Ht(X);break}}function te(X){i.enabled===!1||i.enableZoom===!1||l!==o.NONE&&l!==o.ROTATE||(X.preventDefault(),i.dispatchEvent(r),Bt(X),i.dispatchEvent(a))}function zt(X){i.enabled===!1||i.enablePan===!1||Qt(X)}function Zt(X){switch(ue(X),E.length){case 1:switch(i.touches.ONE){case ts.ROTATE:if(i.enableRotate===!1)return;ht(),l=o.TOUCH_ROTATE;break;case ts.PAN:if(i.enablePan===!1)return;gt(),l=o.TOUCH_PAN;break;default:l=o.NONE}break;case 2:switch(i.touches.TWO){case ts.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;Et(),l=o.TOUCH_DOLLY_PAN;break;case ts.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;wt(),l=o.TOUCH_DOLLY_ROTATE;break;default:l=o.NONE}break;default:l=o.NONE}l!==o.NONE&&i.dispatchEvent(r)}function Re(X){switch(ue(X),l){case o.TOUCH_ROTATE:if(i.enableRotate===!1)return;Lt(X),i.update();break;case o.TOUCH_PAN:if(i.enablePan===!1)return;Ct(X),i.update();break;case o.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;Ft(X),i.update();break;case o.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;U(X),i.update();break;default:l=o.NONE}}function at(X){i.enabled!==!1&&X.preventDefault()}function Tt(X){E.push(X)}function ae(X){delete D[X.pointerId];for(let bt=0;bt{$(X),i.update()},this.dollyOut=(X=G())=>{it(X),i.update()},this.getScale=()=>p,this.setScale=X=>{Z(X),i.update()},this.getZoomScale=()=>G(),e!==void 0&&this.connect(e),this.update()}};const zY=J.forwardRef(({makeDefault:n,camera:t,regress:e,domElement:i,enableDamping:s=!0,keyEvents:r=!1,onChange:a,onStart:o,onEnd:l,...c},h)=>{const u=mr(T=>T.invalidate),p=mr(T=>T.camera),m=mr(T=>T.gl),g=mr(T=>T.events),x=mr(T=>T.setEvents),y=mr(T=>T.set),_=mr(T=>T.get),b=mr(T=>T.performance),S=t||p,w=i||g.connected||m.domElement,R=J.useMemo(()=>new kY(S),[S]);return Sg(()=>{R.enabled&&R.update()},-1),J.useEffect(()=>(r&&R.connect(r===!0?w:r),R.connect(w),()=>void R.dispose()),[r,w,e,R,u]),J.useEffect(()=>{const T=P=>{u(),e&&b.regress(),a&&a(P)},C=P=>{o&&o(P)},L=P=>{l&&l(P)};return R.addEventListener("change",T),R.addEventListener("start",C),R.addEventListener("end",L),()=>{R.removeEventListener("start",C),R.removeEventListener("end",L),R.removeEventListener("change",T)}},[a,o,l,R,u,x]),J.useEffect(()=>{if(n){const T=_().controls;return y({controls:R}),()=>y({controls:T})}},[n,R]),J.createElement("primitive",uI({ref:h,object:R,enableDamping:s},c))});function BY(n){const t=J.useRef(),e=J.useRef(new bg),i=J.useRef(new xt),{gl:s,camera:r,scene:a}=mr();let o=0;const l=u=>{u.preventDefault();const m=(()=>{const y=window.isTouchDevice,_=y?u.touches[0].clientX:u.clientX,b=y?u.touches[0].clientY:u.clientY,S=u.target.getBoundingClientRect();return i.current.x=(_-S.left)/S.width*2-1,i.current.y=-(b-S.top)/S.height*2+1,e.current.setFromCamera(i.current,r),e.current.intersectObjects(a.children,!0)})();if(m.length===0){console.log("No children in the intersected mesh.");return}let g=0;for(;g{l(u)},h=u=>{const p=new Date().getTime(),m=p-o;m<300&&m>0&&l(u),o=p};return J.useEffect(()=>{const u=s.domElement;return u.addEventListener("dblclick",c),u.addEventListener("touchstart",h),()=>{u.removeEventListener("dblclick",c),u.removeEventListener("touchstart",h)}},[r,a]),Sg(()=>{t.current&&t.current.update()}),V.jsx(zY,{ref:t,args:[r,s.domElement],target:n.middle,mouseButtons:{LEFT:Gn.PAN,MIDDLE:Gn.DOLLY,RIGHT:Gn.ROTATE},screenSpacePanning:!1,dampingFactor:1,maxPolarAngle:Math.PI/2})}const xT={type:"change"},AM={type:"start"},pP={type:"end"},vm=new no,vT=new gr,HY=Math.cos(70*h1.DEG2RAD),In=new O,Di=2*Math.PI,Qe={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Ox=1e-6;class GY extends ZC{constructor(t,e=null){super(t,e),this.state=Qe.NONE,this.enabled=!0,this.target=new O,this.cursor=new O,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:Gn.ROTATE,MIDDLE:Gn.DOLLY,RIGHT:Gn.PAN},this.touches={ONE:ts.ROTATE,TWO:ts.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new O,this._lastQuaternion=new Cn,this._lastTargetPosition=new O,this._quat=new Cn().setFromUnitVectors(t.up,new O(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new sf,this._sphericalDelta=new sf,this._scale=1,this._panOffset=new O,this._rotateStart=new xt,this._rotateEnd=new xt,this._rotateDelta=new xt,this._panStart=new xt,this._panEnd=new xt,this._panDelta=new xt,this._dollyStart=new xt,this._dollyEnd=new xt,this._dollyDelta=new xt,this._dollyDirection=new O,this._mouse=new xt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=WY.bind(this),this._onPointerDown=VY.bind(this),this._onPointerUp=jY.bind(this),this._onContextMenu=JY.bind(this),this._onMouseWheel=YY.bind(this),this._onKeyDown=$Y.bind(this),this._onTouchStart=ZY.bind(this),this._onTouchMove=KY.bind(this),this._onMouseDown=XY.bind(this),this._onMouseMove=qY.bind(this),this._interceptControlDown=QY.bind(this),this._interceptControlUp=t$.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(xT),this.update(),this.state=Qe.NONE}update(t=null){const e=this.object.position;In.copy(e).sub(this.target),In.applyQuaternion(this._quat),this._spherical.setFromVector3(In),this.autoRotate&&this.state===Qe.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let i=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(i)&&isFinite(s)&&(i<-Math.PI?i+=Di:i>Math.PI&&(i-=Di),s<-Math.PI?s+=Di:s>Math.PI&&(s-=Di),i<=s?this._spherical.theta=Math.max(i,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+s)/2?Math.max(i,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(In.setFromSpherical(this._spherical),In.applyQuaternion(this._quatInverse),e.copy(this.target).add(In),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=In.length();a=this._clampDistance(o*this._scale);const l=o-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),r=!!l}else if(this.object.isOrthographicCamera){const o=new O(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=l!==this.object.zoom;const c=new O(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(o),this.object.updateMatrixWorld(),a=In.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(vm.origin.copy(this.object.position),vm.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(vm.direction))Ox||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Ox||this._lastTargetPosition.distanceToSquared(this.target)>Ox?(this.dispatchEvent(xT),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Di/60*this.autoRotateSpeed*t:Di/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){In.setFromMatrixColumn(e,0),In.multiplyScalar(-t),this._panOffset.add(In)}_panUp(t,e){this.screenSpacePanning===!0?In.setFromMatrixColumn(e,1):(In.setFromMatrixColumn(e,0),In.crossVectors(this.object.up,In)),In.multiplyScalar(t),this._panOffset.add(In)}_pan(t,e){const i=this.domElement;if(this.object.isPerspectiveCamera){const s=this.object.position;In.copy(s).sub(this.target);let r=In.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/i.clientHeight,this.object.matrix),this._panUp(2*e*r/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),s=t-i.left,r=e-i.top,a=i.width,o=i.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Di*this._rotateDelta.x/e.clientHeight),this._rotateUp(Di*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Di*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Di*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Di*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Di*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(i,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(i,s)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(i*i+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),r=.5*(t.pageY+i.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Di*this._rotateDelta.x/e.clientHeight),this._rotateUp(Di*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),i=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(i,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),i=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(i*i+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e{const{camera:e,gl:i,scene:s}=mr(),r=J.useRef(new bg),a=J.useRef(new xt),o=J.useRef();J.useEffect(()=>(o.current=new GY(e,i.domElement),o.current.target=n,o.current.mouseButtons={MIDDLE:Gn.DOLLY,RIGHT:Gn.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,r.current.setFromCamera(a.current,e);const u=r.current.intersectObjects(s.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(x=>[...x,{point:m,normal:g}])}};return J.useEffect(()=>(i.domElement.addEventListener("pointerdown",l),()=>{i.domElement.removeEventListener("pointerdown",l)}),[i]),Sg(()=>{o.current&&o.current.update()}),null};function n$({geometries:n}){return V.jsx(V.Fragment,{children:n.map((t,e)=>V.jsx("mesh",{geometry:t,material:new ph({color:"red",transparent:!1})},e))})}function i$({meshes:n}){return V.jsx(V.Fragment,{children:n.map((t,e)=>V.jsx("mesh",{geometry:t.geometry,material:new ph({color:"#2b2c40",transparent:!1})},e))})}const s$=({meshes:n})=>V.jsx(V.Fragment,{children:n.map((t,e)=>V.jsx("mesh",{geometry:t.geometry,children:V.jsx("meshLambertMaterial",{vertexColors:!0,side:fi})},e))}),MT=({geometries:n})=>V.jsx(V.Fragment,{children:n.map((t,e)=>V.jsx("mesh",{geometry:t,children:V.jsx("meshLambertMaterial",{vertexColors:!1,color:11245952,side:fi})},e))}),bT=["#27AD6B","#2DBE76","#33CC80"],wT=({geometries:n})=>{const t=J.useMemo(()=>n.map(()=>bT[Math.floor(Math.random()*bT.length)]),[n]);return V.jsx(V.Fragment,{children:n.map((e,i)=>V.jsx("mesh",{geometry:e,children:V.jsx("meshLambertMaterial",{vertexColors:!1,color:t[i],side:fi})},i))})},r$=({points:n})=>{const t=J.useMemo(()=>{const e=n.map((o,l)=>{const c=new ve().setFromPoints([o.point]),h=new Lf({color:"#333333",size:10,sizeAttenuation:!1});return V.jsx("points",{geometry:c,material:h},`point-${l}`)}),i=new ve,s=[];for(let o=0;o{const t=n.zoom,e=n.x,i=n.y,s=n.divisions,r=`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]=J.useState(null),[l,c]=J.useState(null),[h,u]=J.useState(!1),p=V.jsx(V.Fragment,{children:h&&V.jsx("mesh",{geometry:a,material:l})});return J.useEffect(()=>{async function m(){const g=new I1().loadAsync(r),[x,y,_,b]=RI(e,i,t);let S=[],w=[],R=[],T=0;const C=s+1;for(let W=0;W<=s;W++)for(let Q=0;Q<=s;Q++){const Y=x+Q/s*(_-x),ot=y+W/s*(b-y);S.push(Iv.toPoint3D(Y,ot)),w=w.concat([Q/s,1-W/s]),Q>0&&W>0&&(R=R.concat([T-C-1,T-1,T-C,T-C,T-1,T])),T+=1}S=await Promise.all(S);const L=new Float32Array(S.flatMap(W=>W.point)),P=new Float32Array(S.flatMap(W=>W.normal)),E=new Float32Array(w),D=new Uint32Array(R),z=new ve;z.setAttribute("position",new De(L,3)),z.setAttribute("normal",new De(P,3)),z.setAttribute("uv",new De(E,2)),z.setIndex(new De(D,1)),o(z);const G=await g;G.colorSpace=fn,c(new ph({flatShading:!1,map:await g,side:js})),u(!0)}m()},[]),p},o$=({visible:n})=>{const[t,e]=CI,[i,s]=J.useState([]),r=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)),J.useEffect(()=>{let l=[];const c=h=>{if(hc(h+1),0)}};return c(0),()=>{s([])}},[r,a]),V.jsx("group",{visible:n,children:i})},l$=({geometries:n,simulationMeshes:t,showTerrain:e,frontendState:i,pvSystems:s,selectedMesh:r,setSelectedMesh:a,selectedPVSystem:o,setSelectedPVSystem:l,pvPoints:c,setPVPoints:h,vegetationGeometries:u})=>{window.setPVPoints=h;const p=[t[0].middle.x,t[0].middle.y-40,t[0].middle.z+80],m=J.useRef();return V.jsxs(m6,{camera:{fov:45,near:1,far:2e4,position:p,up:[0,0,1],ref:m},children:[V.jsx("ambientLight",{intensity:2}),V.jsx("directionalLight",{intensity:1,position:[0,-1,-2]}),V.jsx("directionalLight",{intensity:.5,position:[1,0,-2]}),V.jsx("directionalLight",{intensity:.5,position:[-1,0,-2]}),n.surrounding.length>0&&V.jsx(MT,{geometries:n.surrounding}),n.background.length>0&&V.jsx(MT,{geometries:n.background}),t.length>0&&V.jsx(s$,{meshes:t}),r&&V.jsx(i$,{meshes:r}),o&&V.jsx(n$,{geometries:o}),t.length>0&&i=="Results"&&V.jsx(BY,{middle:t[0].middle,setSelectedMesh:a,setSelectedPVSystem:l}),i=="DrawPV"&&V.jsx(e$,{middle:t[0].middle,setPVPoints:h}),i=="DrawPV"&&V.jsx(r$,{points:c}),s.length>0&&V.jsx(y6,{pvSystems:s}),u&&V.jsxs(V.Fragment,{children:[u.background&&u.background.length>0&&V.jsx(wT,{geometries:u.background}),u.surrounding&&u.surrounding.length>0&&V.jsx(wT,{geometries:u.surrounding})]}),t.length>0&&V.jsx(o$,{visible:e})]})};function c$(){const n=fI(),[t,e]=J.useState("Loading"),[i,s]=J.useState(!0),[r,a]=J.useState(0),[o,l]=J.useState([]),[c,h]=J.useState([]),[u,p]=J.useState(!1);window.setFederalState=p;const[m,g]=J.useState({simulation:[],surrounding:[],background:[]}),[x,y]=J.useState([]),[_,b]=J.useState([]),[S,w]=J.useState([]);window.setGeometries=g,window.setFrontendState=e,window.setSimulationProgress=a;const[R,T]=J.useState([]);window.setVegetationGeometries=T;const C=async()=>{const{simulationMesh:L}=await EY(n);L&&(w([...S,L]),e("Results"))};return J.useEffect(()=>{C()},[]),V.jsx(dI,{description:"Berechne das Potential deiner Solaranlage.",children:V.jsxs("div",{className:"content",children:[(t=="Results"||t=="DrawPV")&&V.jsx(PY,{frontendState:t,setFrontendState:e,showTerrain:i,setShowTerrain:s,selectedMesh:x,setSelectedMesh:y,geometries:m,geoLocation:n,setPVSystems:l,pvSystems:o,selectedPVSystem:_,setSelectedPVSystem:b,pvPoints:c,setPVPoints:h,simulationMeshes:S,setSimulationMeshes:w}),t=="ErrorAdress"&&V.jsx(M5,{}),(t=="Results"||t=="DrawPV")&&V.jsx(l$,{geometries:m,simulationMeshes:S,showTerrain:i,frontendState:t,pvSystems:o,setPVSystems:l,selectedMesh:x,setSelectedMesh:y,selectedPVSystem:_,setSelectedPVSystem:b,pvPoints:c,setPVPoints:h,vegetationGeometries:R}),t=="Loading"&&V.jsx(b5,{progress:r}),V.jsx(bI,{federalState:u,frontendState:t})]})})}const J$=Object.freeze(Object.defineProperty({__proto__:null,default:c$},Symbol.toStringTag,{value:"Module"}));export{j$ as L,J$ as S,X$ as a,Z$ as i}; +northing meters`+n;var p=u/2,m=0,g=0,x,y,_,b,S;return p>0&&(x=1e5/Math.pow(10,p),y=n.substring(r,r+p),m=parseFloat(y)*x,_=n.substring(r+p),g=parseFloat(_)*x),b=m+c,S=g+h,{easting:b,northing:S,zoneLetter:o,zoneNumber:a,accuracy:x}}function $V(n,t){for(var e=m3.charCodeAt(t-1),i=1e5,s=!1;e!==n.charCodeAt(0);){if(e++,e===Oi&&e++,e===xs&&e++,e>gu){if(s)throw"Bad character: "+n;e=Dc,s=!0}i+=1e5}return i}function ZV(n,t){if(n>"V")throw"MGRSPoint given invalid Northing "+n;for(var e=g3.charCodeAt(t-1),i=0,s=!1;e!==n.charCodeAt(0);){if(e++,e===Oi&&e++,e===xs&&e++,e>mu){if(s)throw"Bad character: "+n;e=Dc,s=!0}i+=1e5}return i}function KV(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 sh(n,t,e){if(!(this instanceof sh))return new sh(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")}sh.fromMGRS=function(n){return new sh(_3(n))};sh.prototype.toMGRS=function(n){return y3([this.x,this.y],n)};var JV=1,QV=.25,RA=.046875,PA=.01953125,IA=.01068115234375,t9=.75,e9=.46875,n9=.013020833333333334,i9=.007120768229166667,s9=.3645833333333333,r9=.005696614583333333,a9=.3076171875;function pM(n){var t=[];t[0]=JV-n*(QV+n*(RA+n*(PA+n*IA))),t[1]=n*(t9-n*(RA+n*(PA+n*IA)));var e=n*n;return t[2]=e*(e9-n*(n9+n*i9)),e*=n,t[3]=e*(s9-n*r9),t[4]=e*n*a9,t}function xh(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 o9=20;function mM(n,t,e){for(var i=1/(1-t),s=n,r=o9;r;--r){var a=Math.sin(s),o=1-t*a*a;if(o=(xh(s,a,Math.cos(s),e)-n)*(o*Math.sqrt(o))*i,s-=o,Math.abs(o)qt?Math.tan(e):0,x=Math.pow(g,2),y=Math.pow(x,2);s=1-this.es*Math.pow(o,2),h=h/Math.sqrt(s);var _=xh(e,o,l,this.en);r=this.a*(this.k0*h*(1+u/6*(1-x+p+u/20*(5-18*x+y+14*p-58*x*p+u/42*(61+179*y-y*x-479*x)))))+this.x0,a=this.a*(this.k0*(_-this.ml0+o*i*h/2*(1+u/12*(5-x+9*p+4*m+u/30*(61+y-58*x+270*p-330*x*p+u/56*(1385+543*y-y*x-3111*x))))))+this.y0}else{var c=l*Math.sin(i);if(Math.abs(Math.abs(c)-1)=1){if(c-1>qt)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=r,n.y=a,n}function h9(n){var t,e,i,s,r=(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=mM(t,this.es,this.en),Math.abs(e)qt?Math.tan(e):0,g=this.ep2*Math.pow(p,2),x=Math.pow(g,2),y=Math.pow(m,2),_=Math.pow(y,2);t=1-this.es*Math.pow(u,2);var b=r*Math.sqrt(t)/this.k0,S=Math.pow(b,2);t=t*m,i=e-t*S/(1-this.es)*.5*(1-S/12*(5+3*y-9*g*y+g-4*x-S/30*(61+90*y-252*g*y+45*_+46*g-S/56*(1385+3633*y+4095*_+1574*_*y)))),s=$t(this.long0+b*(1-S/6*(1+2*y+g-S/20*(5+28*y+24*_+8*g*y+6*g-S/42*(61+662*y+1320*_+720*_*y))))/p)}else i=Dt*Gf(a),s=0;else{var o=Math.exp(r/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?s=0:s=$t(Math.atan2(l,h)+this.long0)}return n.x=s,n.y=i,n}var u9=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Nm={init:l9,forward:c9,inverse:h9,names:u9};function M3(n){var t=Math.exp(n);return t=(t-1/t)/2,t}function Ui(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 f9(n){var t=1+n,e=t-1;return e===0?n:n*Math.log(t)/e}function d9(n){var t=Math.abs(n);return t=f9(t*(1+t/(Ui(1,t)+1))),n<0?-t:t}function gM(n,t){for(var e=2*Math.cos(2*t),i=n.length-1,s=n[i],r=0,a;--i>=0;)a=-r+e*s+n[i],r=s,s=a;return t+a*Math.sin(2*t)}function p9(n,t){for(var e=2*Math.cos(t),i=n.length-1,s=n[i],r=0,a;--i>=0;)a=-r+e*s+n[i],r=s,s=a;return Math.sin(t)*a}function m9(n){var t=Math.exp(n);return t=(t+1/t)/2,t}function b3(n,t,e){for(var i=Math.sin(t),s=Math.cos(t),r=M3(e),a=m9(e),o=2*s*a,l=-2*i*r,c=n.length-1,h=n[c],u=0,p=0,m=0,g,x;--c>=0;)g=p,x=u,p=h,u=m,h=-g+o*p-l*u+n[c],m=-x+l*p+o*u;return o=i*a,l=s*r,[o*h-l*m,o*m+l*h]}function g9(){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=gM(this.cbg,this.lat0);this.Zb=-this.Qn*(i+p9(this.gtu,2*i))}function y9(n){var t=$t(n.x-this.long0),e=n.y;e=gM(this.cbg,e);var i=Math.sin(e),s=Math.cos(e),r=Math.sin(t),a=Math.cos(t);e=Math.atan2(i,a*s),t=Math.atan2(r*s,Ui(i,s*a)),t=d9(Math.tan(t));var o=b3(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 _9(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,s;if(Math.abs(t)<=2.623395162778){var r=b3(this.utg,2*e,2*t);e=e+r[0],t=t+r[1],t=Math.atan(M3(t));var a=Math.sin(e),o=Math.cos(e),l=Math.sin(t),c=Math.cos(t);e=Math.atan2(a*c,Ui(l,c*o)),t=Math.atan2(l,c*o),i=$t(t+this.long0),s=gM(this.cgb,e)}else i=1/0,s=1/0;return n.x=i,n.y=s,n}var x9=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Om={init:g9,forward:y9,inverse:_9,names:x9};function v9(n,t){if(n===void 0){if(n=Math.floor(($t(t)+Math.PI)*30/Math.PI)+1,n<0)return 0;if(n>60)return 60}return n}var M9="etmerc";function b9(){var n=v9(this.zone,this.long0);if(n===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(n)-183)*Xn,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 w9=["Universal Transverse Mercator System","utm"];const S9={init:b9,names:w9,dependsOn:M9};function yM(n,t){return Math.pow((1-n)/(1+n),t)}var E9=20;function A9(){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+$e)/(Math.pow(Math.tan(.5*this.lat0+$e),this.C)*yM(this.e*n,this.ratexp))}function T9(n){var t=n.x,e=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+$e),this.C)*yM(this.e*Math.sin(e),this.ratexp))-Dt,n.x=this.C*t,n}function C9(n){for(var t=1e-14,e=n.x/this.C,i=n.y,s=Math.pow(Math.tan(.5*i+$e)/this.K,1/this.C),r=E9;r>0&&(i=2*Math.atan(s*yM(this.e*Math.sin(n.y),-.5*this.e))-Dt,!(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)<=qt&&Math.abs(Math.cos(this.lat_ts))>qt&&(this.k0=.5*this.cons*Pr(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ws(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Pr(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Dt,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function U9(n){var t=n.x,e=n.y,i=Math.sin(e),s=Math.cos(e),r,a,o,l,c,h,u=$t(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=qt&&Math.abs(e+this.lat0)<=qt?(n.x=NaN,n.y=NaN,n):this.sphere?(r=2*this.k0/(1+this.sinlat0*i+this.coslat0*s*Math.cos(u)),n.x=this.a*r*s*Math.sin(u)+this.x0,n.y=this.a*r*(this.coslat0*i-this.sinlat0*s*Math.cos(u))+this.y0,n):(a=2*Math.atan(this.ssfn_(e,i,this.e))-Dt,l=Math.cos(a),o=Math.sin(a),Math.abs(this.coslat0)<=qt?(c=Ws(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=$t(this.long0+Math.atan2(n.x,-1*n.y)):t=$t(this.long0+Math.atan2(n.x,n.y)):t=$t(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)<=qt){if(a<=qt)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*lf(this.e,i),t=this.con*$t(this.con*this.long0+Math.atan2(n.x,-1*n.y))}else s=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=qt?r=this.X0:(r=Math.asin(Math.cos(s)*this.sinX0+n.y*Math.sin(s)*this.cosX0/a),t=$t(this.long0+Math.atan2(n.x*Math.sin(s),a*this.cosX0*Math.cos(s)-n.y*this.sinX0*Math.sin(s)))),e=-1*lf(this.e,Math.tan(.5*(Dt+r)));return n.x=t,n.y=e,n}var z9=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const B9={init:F9,forward:U9,inverse:k9,names:z9,ssfn_:O9};function H9(){var n=this.lat0;this.lambda0=this.long0;var t=Math.sin(n),e=this.a,i=this.rf,s=1/i,r=2*s-Math.pow(s,2),a=this.e=Math.sqrt(r);this.R=this.k0*e*Math.sqrt(1-r)/(1-r*Math.pow(t,2)),this.alpha=Math.sqrt(1+r/(1-r)*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 G9(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,s=2*(Math.atan(Math.exp(i))-Math.PI/4),r=this.alpha*(n.x-this.lambda0),a=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(r))),o=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(r));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 V9(n){for(var t=n.x-this.x0,e=n.y-this.y0,i=t/this.R,s=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(i)),a=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(s))),o=this.lambda0+a/this.alpha,l=0,c=r,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+r/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 W9=["somerc"];const j9={init:H9,forward:G9,inverse:V9,names:W9};var Ac=1e-7;function X9(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 q9(){var n,t,e,i,s,r,a,o,l,c,h=0,u,p=0,m=0,g=0,x=0,y=0,_=0;this.no_off=X9(this),this.no_rot="no_rot"in this;var b=!1;"alpha"in this&&(b=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),b&&(_=this.alpha),S&&(h=this.rectified_grid_angle*Xn),b||S)p=this.longc;else if(m=this.long1,x=this.lat1,g=this.long2,y=this.lat2,Math.abs(x-y)<=Ac||(n=Math.abs(x))<=Ac||Math.abs(n-Dt)<=Ac||Math.abs(Math.abs(this.lat0)-Dt)<=Ac||Math.abs(Math.abs(y)-Dt)<=Ac)throw new Error;var w=1-this.es;t=Math.sqrt(w),Math.abs(this.lat0)>qt?(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/w),this.A=this.B*this.k0*t/n,i=this.B*t/(e*Math.sqrt(n)),s=i*i-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=i,this.E*=Math.pow(Ws(this.e,this.lat0,o),this.B)):(this.B=1/t,this.A=this.k0,this.E=i=s=1),b||S?(b?(u=Math.asin(Math.sin(_)/i),S||(h=_)):(u=h,_=Math.asin(i*Math.sin(u))),this.lam0=p-Math.asin(.5*(s-1/s)*Math.tan(u))/this.B):(r=Math.pow(Ws(this.e,x,Math.sin(x)),this.B),a=Math.pow(Ws(this.e,y,Math.sin(y)),this.B),s=this.E/r,l=(a-r)/(a+r),c=this.E*this.E,c=(c-a*r)/(c+a*r),n=m-g,n<-Math.pi?g-=af:n>Math.pi&&(g+=af),this.lam0=$t(.5*(m+g)-Math.atan(c*Math.tan(.5*this.B*(m-g))/l)/this.B),u=Math.atan(2*Math.sin(this.B*$t(m-this.lam0))/(s-1/s)),h=_=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(_))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan($e-s)),this.v_pole_s=this.ArB*Math.log(Math.tan($e+s))}function Y9(n){var t={},e,i,s,r,a,o,l,c;if(n.x=n.x-this.lam0,Math.abs(Math.abs(n.y)-Dt)>qt){if(a=this.E/Math.pow(Ws(this.e,n.y,Math.sin(n.y)),this.B),o=1/a,e=.5*(a-o),i=.5*(a+o),r=Math.sin(this.B*n.x),s=(e*this.singam-r*this.cosgam)/i,Math.abs(Math.abs(s)-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 $9(n){var t,e,i,s,r,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),s=.5*(i-1/i),r=.5*(i+1/i),a=Math.sin(this.BrA*t),o=(a*this.cosgam+s*this.singam)/r,Math.abs(Math.abs(o)-1)qt?this.ns=Math.log(i/o)/Math.log(s/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=i/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Q9(n){var t=n.x,e=n.y;Math.abs(2*Math.abs(e)-Math.PI)<=qt&&(e=Gf(e)*(Dt-2*qt));var i=Math.abs(Math.abs(e)-Dt),s,r;if(i>qt)s=Ws(this.e,e,Math.sin(e)),r=this.a*this.f0*Math.pow(s,this.ns);else{if(i=e*this.ns,i<=0)return null;r=0}var a=this.ns*$t(t-this.long0);return n.x=this.k0*(r*Math.sin(a))+this.x0,n.y=this.k0*(this.rh-r*Math.cos(a))+this.y0,n}function t7(n){var t,e,i,s,r,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),s=lf(this.e,i),s===-9999)return null}else s=-Dt;return r=$t(l/this.ns+this.long0),n.x=r,n.y=s,n}var e7=["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 n7={init:J9,forward:Q9,inverse:t7,names:e7};function i7(){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 s7(n){var t,e,i,s,r,a,o,l=n.x,c=n.y,h=$t(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,s=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(i)),r=Math.asin(Math.cos(e)*Math.sin(i)/Math.cos(s)),a=this.n*r,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/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 r7(n){var t,e,i,s,r,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),r=Math.atan2(n.y,n.x),s=r/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(s)),e=Math.asin(Math.cos(i)*Math.sin(s)/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 a7=["Krovak","krovak"];const o7={init:i7,forward:s7,inverse:r7,names:a7};function bi(n,t,e,i,s){return n*s-t*Math.sin(2*s)+e*Math.sin(4*s)-i*Math.sin(6*s)}function Vf(n){return 1-.25*n*(1+n/16*(3+1.25*n))}function Wf(n){return .375*n*(1+.25*n*(1+.46875*n))}function jf(n){return .05859375*n*n*(1+.75*n)}function Xf(n){return n*n*n*(35/3072)}function rh(n,t,e){var i=t*e;return n/Math.sqrt(1-i*i)}function lo(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 d7=1,p7=2,m7=3,g7=4;function y7(){var n=Math.abs(this.lat0);if(Math.abs(n-Dt)0){var t;switch(this.qp=Wa(this.e,1),this.mmf=.5/(1-this.es),this.apa=A7(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=Wa(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 _7(n){var t,e,i,s,r,a,o,l,c,h,u=n.x,p=n.y;if(u=$t(u-this.long0),this.sphere){if(r=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*r+this.cosph0*h*i,e<=qt)return null;e=Math.sqrt(2/e),t=e*h*Math.sin(u),e*=this.mode===this.EQUIT?r:this.cosph0*r-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))*s,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 x7(n){n.x-=this.x0,n.y-=this.y0;var t=n.x/this.a,e=n.y/this.a,i,s,r,a,o,l,c;if(this.sphere){var h=0,u,p=0;if(u=Math.sqrt(t*t+e*e),s=u*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(p=Math.sin(s),h=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(u)<=qt?0:Math.asin(e*p/u),t*=p,e=h*u;break;case this.OBLIQ:s=Math.abs(u)<=qt?this.lat0:Math.asin(h*this.sinph0+e*p*this.cosph0/u),t*=p*this.cosph0,e=(h-Math.sin(s)*this.sinph0)*u;break;case this.N_POLE:e=-e,s=Dt-s;break;case this.S_POLE:s-=Dt;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 P7(){Math.abs(this.lat1+this.lat2)qt?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 I7(n){var t=n.x,e=n.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var i=Wa(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,r=this.ns0*$t(t-this.long0),a=s*Math.sin(r)+this.x0,o=this.rh-s*Math.cos(r)+this.y0;return n.x=a,n.y=o,n}function L7(n){var t,e,i,s,r,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),s=0,t!==0&&(s=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)),r=$t(s/this.ns0+this.long0),n.x=r,n.y=a,n}function D7(n,t){var e,i,s,r,a,o=Ja(.5*t);if(n0||Math.abs(a)<=qt?(o=this.x0+this.a*r*e*Math.sin(i)/a,l=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*e*s)/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*s)),n.x=o,n.y=l,n}function k7(n){var t,e,i,s,r,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))?(s=Math.atan2(t,this.rc),e=Math.sin(s),i=Math.cos(s),a=Ja(i*this.sin_p14+n.y*e*this.cos_p14/t),r=Math.atan2(n.x*e,t*this.cos_p14*i-n.y*this.sin_p14*e),r=$t(this.long0+r)):(a=this.phic0,r=0),n.x=r,n.y=a,n}var z7=["gnom"];const B7={init:F7,forward:U7,inverse:k7,names:z7};function H7(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*Dt:Dt;for(var i=Math.asin(.5*t),s,r,a,o,l=0;l<30;l++)if(r=Math.sin(i),a=Math.cos(i),o=n*r,s=Math.pow(1-o*o,2)/(2*a)*(t/(1-n*n)-r/(1-o*o)+.5/n*Math.log((1-o)/(1+o))),i+=s,Math.abs(s)<=1e-10)return i;return NaN}function G7(){this.sphere||(this.k0=Pr(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function V7(n){var t=n.x,e=n.y,i,s,r=$t(t-this.long0);if(this.sphere)i=this.x0+this.a*r*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var a=Wa(this.e,Math.sin(e));i=this.x0+this.a*this.k0*r,s=this.y0+this.a*a*.5/this.k0}return n.x=i,n.y=s,n}function W7(n){n.x-=this.x0,n.y-=this.y0;var t,e;return this.sphere?(t=$t(this.long0+n.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(n.y/this.a*Math.cos(this.lat_ts))):(e=H7(this.e,2*n.y*this.k0/this.a),t=$t(this.long0+n.x/(this.a*this.k0))),n.x=t,n.y=e,n}var j7=["cea"];const X7={init:G7,forward:V7,inverse:W7,names:j7};function q7(){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 Y7(n){var t=n.x,e=n.y,i=$t(t-this.long0),s=lo(e-this.lat0);return n.x=this.x0+this.a*i*this.rc,n.y=this.y0+this.a*s,n}function $7(n){var t=n.x,e=n.y;return n.x=$t(this.long0+(t-this.x0)/(this.a*this.rc)),n.y=lo(this.lat0+(e-this.y0)/this.a),n}var Z7=["Equirectangular","Equidistant_Cylindrical","eqc"];const K7={init:q7,forward:Y7,inverse:$7,names:Z7};var LA=20;function J7(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Vf(this.es),this.e1=Wf(this.es),this.e2=jf(this.es),this.e3=Xf(this.es),this.ml0=this.a*bi(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Q7(n){var t=n.x,e=n.y,i,s,r,a=$t(t-this.long0);if(r=a*Math.sin(e),this.sphere)Math.abs(e)<=qt?(i=this.a*a,s=-1*this.a*this.lat0):(i=this.a*Math.sin(r)/Math.tan(e),s=this.a*(lo(e-this.lat0)+(1-Math.cos(r))/Math.tan(e)));else if(Math.abs(e)<=qt)i=this.a*a,s=-1*this.ml0;else{var o=rh(this.a,this.e,Math.sin(e))/Math.tan(e);i=o*Math.sin(r),s=this.a*bi(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+o*(1-Math.cos(r))}return n.x=i+this.x0,n.y=s+this.y0,n}function tW(n){var t,e,i,s,r,a,o,l,c;if(i=n.x-this.x0,s=n.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=qt)t=$t(i/this.a+this.long0),e=0;else{a=this.lat0+s/this.a,o=i*i/this.a/this.a+a*a,l=a;var h;for(r=LA;r;--r)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)<=qt){e=l;break}t=$t(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(e))}else if(Math.abs(s+this.ml0)<=qt)e=0,t=$t(this.long0+i/this.a);else{a=(this.ml0+s)/this.a,o=i*i/this.a/this.a+a*a,l=a;var u,p,m,g,x;for(r=LA;r;--r)if(x=this.e*Math.sin(l),u=Math.sqrt(1-x*x)*Math.tan(l),p=this.a*bi(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)<=qt){e=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=$t(this.long0+Math.asin(i*u/this.a)/Math.sin(e))}return n.x=t,n.y=e,n}var eW=["Polyconic","poly"];const nW={init:J7,forward:Q7,inverse:tW,names:eW};function iW(){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 sW(n){var t,e=n.x,i=n.y,s=i-this.lat0,r=e-this.long0,a=s/Du*1e-5,o=r,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,x,y=0,_=0;for(t=1;t<=6;t++)g=p*h-m*u,x=m*h+p*u,p=g,m=x,y=y+this.B_re[t]*p-this.B_im[t]*m,_=_+this.B_im[t]*p+this.B_re[t]*m;return n.x=_*this.a+this.x0,n.y=y*this.a+this.y0,n}function rW(n){var t,e=n.x,i=n.y,s=e-this.x0,r=i-this.y0,a=r/this.a,o=s/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=$t(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 s=Math.asin(e);return n.x=i,n.y=s,n}var bW=["Mollweide","moll"];const wW={init:xW,forward:vW,inverse:MW,names:bW};function SW(){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 r=0;if(e!==0&&(r=Math.atan2(t*n.x,t*n.y)),this.sphere)return s=$t(this.long0+r/this.ns),i=lo(this.g-e/this.a),n.x=s,n.y=i,n;var a=this.g-e/this.a;return i=P0(a,this.e0,this.e1,this.e2,this.e3),s=$t(this.long0+r/this.ns),n.x=s,n.y=i,n}var TW=["Equidistant_Conic","eqdc"];const CW={init:SW,forward:EW,inverse:AW,names:TW};function RW(){this.R=this.a}function PW(n){var t=n.x,e=n.y,i=$t(t-this.long0),s,r;Math.abs(e)<=qt&&(s=this.x0+this.R*i,r=this.y0);var a=Ja(2*Math.abs(e/Math.PI));(Math.abs(i)<=qt||Math.abs(Math.abs(e)-Dt)<=qt)&&(s=this.x0,e>=0?r=this.y0+Math.PI*this.R*Math.tan(.5*a):r=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,x=Math.PI*this.R*(o*(u-g)+Math.sqrt(l*(u-g)*(u-g)-(g+l)*(p-g)))/(g+l);i<0&&(x=-x),s=this.x0+x;var y=l+u;return x=Math.PI*this.R*(m*y-o*Math.sqrt((g+l)*(l+1)-y*y))/(g+l),e>=0?r=this.y0+x:r=this.y0-x,n.x=s,n.y=r,n}function IW(n){var t,e,i,s,r,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,s=n.y/u,r=i*i+s*s,a=-Math.abs(s)*(1+r),o=a-2*s*s+i*i,l=-2*a+1+2*s*s+r*r,m=s*s/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*Dt*this.a?void 0:(e=t/this.a,i=Math.sin(e),s=Math.cos(e),r=this.long0,Math.abs(t)<=qt?a=this.lat0:(a=Ja(s*this.sin_p12+n.y*i*this.cos_p12/t),o=Math.abs(this.lat0)-Dt,Math.abs(o)<=qt?this.lat0>=0?r=$t(this.long0+Math.atan2(n.x,-n.y)):r=$t(this.long0-Math.atan2(-n.x,n.y)):r=$t(this.long0+Math.atan2(n.x*i,t*this.cos_p12*s-n.y*this.sin_p12*i))),n.x=r,n.y=a,n)):(l=Vf(this.es),c=Wf(this.es),h=jf(this.es),u=Xf(this.es),Math.abs(this.sin_p12-1)<=qt?(p=this.a*bi(l,c,h,u,Dt),t=Math.sqrt(n.x*n.x+n.y*n.y),m=p-t,a=P0(m/this.a,l,c,h,u),r=$t(this.long0+Math.atan2(n.x,-1*n.y)),n.x=r,n.y=a,n):Math.abs(this.sin_p12+1)<=qt?(p=this.a*bi(l,c,h,u,Dt),t=Math.sqrt(n.x*n.x+n.y*n.y),m=t-p,a=P0(m/this.a,l,c,h,u),r=$t(this.long0+Math.atan2(n.x,n.y)),n.x=r,n.y=a,n):(t=Math.sqrt(n.x*n.x+n.y*n.y),y=Math.atan2(n.x,n.y),g=rh(this.a,this.e,this.sin_p12),_=Math.cos(y),b=this.e*this.cos_p12*_,S=-b*b/(1-this.es),w=3*this.es*(1-S)*this.sin_p12*this.cos_p12*_/(1-this.es),R=t/g,T=R-S*(1+S)*Math.pow(R,3)/6-w*(1+3*S)*Math.pow(R,4)/24,C=1-S*T*T/2-R*T*T*T/6,x=Math.asin(this.sin_p12*Math.cos(T)+this.cos_p12*Math.sin(T)*_),r=$t(this.long0+Math.asin(Math.sin(y)*Math.sin(T)/Math.cos(x))),L=Math.sin(x),a=Math.atan2((L-this.es*C*this.sin_p12)*Math.tan(x),L*(1-this.es)),n.x=r,n.y=a,n))}var UW=["Azimuthal_Equidistant","aeqd"];const kW={init:NW,forward:OW,inverse:FW,names:UW};function zW(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function BW(n){var t,e,i,s,r,a,o,l,c=n.x,h=n.y;return i=$t(c-this.long0),t=Math.sin(h),e=Math.cos(h),s=Math.cos(i),a=this.sin_p14*t+this.cos_p14*e*s,r=1,(a>0||Math.abs(a)<=qt)&&(o=this.a*r*e*Math.sin(i),l=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*e*s)),n.x=o,n.y=l,n}function HW(n){var t,e,i,s,r,a,o;return n.x-=this.x0,n.y-=this.y0,t=Math.sqrt(n.x*n.x+n.y*n.y),e=Ja(t/this.a),i=Math.sin(e),s=Math.cos(e),a=this.long0,Math.abs(t)<=qt?(o=this.lat0,n.x=a,n.y=o,n):(o=Ja(s*this.sin_p14+n.y*i*this.cos_p14/t),r=Math.abs(this.lat0)-Dt,Math.abs(r)<=qt?(this.lat0>=0?a=$t(this.long0+Math.atan2(n.x,-n.y)):a=$t(this.long0-Math.atan2(-n.x,n.y)),n.x=a,n.y=o,n):(a=$t(this.long0+Math.atan2(n.x*i,t*this.cos_p14*s-n.y*this.sin_p14*i)),n.x=a,n.y=o,n))}var GW=["ortho"];const VW={init:zW,forward:BW,inverse:HW,names:GW};var un={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Ze={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function WW(){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>=Dt-$e/2?this.face=un.TOP:this.lat0<=-(Dt-$e/2)?this.face=un.BOTTOM:Math.abs(this.long0)<=$e?this.face=un.FRONT:Math.abs(this.long0)<=Dt+$e?this.face=this.long0>0?un.RIGHT:un.LEFT:this.face=un.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 jW(n){var t={x:0,y:0},e,i,s,r,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===un.TOP)r=Dt-e,i>=$e&&i<=Dt+$e?(l.value=Ze.AREA_0,s=i-Dt):i>Dt+$e||i<=-(Dt+$e)?(l.value=Ze.AREA_1,s=i>0?i-vn:i+vn):i>-(Dt+$e)&&i<=-$e?(l.value=Ze.AREA_2,s=i+Dt):(l.value=Ze.AREA_3,s=i);else if(this.face===un.BOTTOM)r=Dt+e,i>=$e&&i<=Dt+$e?(l.value=Ze.AREA_0,s=-i+Dt):i<$e&&i>=-$e?(l.value=Ze.AREA_1,s=-i):i<-$e&&i>=-(Dt+$e)?(l.value=Ze.AREA_2,s=-i-Dt):(l.value=Ze.AREA_3,s=i>0?-i+vn:-i-vn);else{var c,h,u,p,m,g,x;this.face===un.RIGHT?i=Hc(i,+Dt):this.face===un.BACK?i=Hc(i,+vn):this.face===un.LEFT&&(i=Hc(i,-Dt)),p=Math.sin(e),m=Math.cos(e),g=Math.sin(i),x=Math.cos(i),c=m*x,h=m*g,u=p,this.face===un.FRONT?(r=Math.acos(c),s=mm(r,u,h,l)):this.face===un.RIGHT?(r=Math.acos(h),s=mm(r,u,-c,l)):this.face===un.BACK?(r=Math.acos(-c),s=mm(r,u,-h,l)):this.face===un.LEFT?(r=Math.acos(-h),s=mm(r,u,c,l)):(r=s=0,l.value=Ze.AREA_0)}return o=Math.atan(12/vn*(s+Math.acos(Math.sin(s)*Math.cos($e))-Dt)),a=Math.sqrt((1-Math.cos(r))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(s))))),l.value===Ze.AREA_1?o+=Dt:l.value===Ze.AREA_2?o+=vn:l.value===Ze.AREA_3&&(o+=1.5*vn),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 XW(n){var t={lam:0,phi:0},e,i,s,r,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=Ze.AREA_0:n.y>=0&&n.y>=Math.abs(n.x)?(u.value=Ze.AREA_1,e-=Dt):n.x<0&&-n.x>=Math.abs(n.y)?(u.value=Ze.AREA_2,e=e<0?e+vn:e-vn):(u.value=Ze.AREA_3,e+=Dt),h=vn/12*Math.tan(e),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),o=Math.atan(a),s=Math.cos(e),r=Math.tan(i),l=1-s*s*r*r*(1-Math.cos(Math.atan(1/Math.cos(o)))),l<-1?l=-1:l>1&&(l=1),this.face===un.TOP)c=Math.acos(l),t.phi=Dt-c,u.value===Ze.AREA_0?t.lam=o+Dt:u.value===Ze.AREA_1?t.lam=o<0?o+vn:o-vn:u.value===Ze.AREA_2?t.lam=o-Dt:t.lam=o;else if(this.face===un.BOTTOM)c=Math.acos(l),t.phi=c-Dt,u.value===Ze.AREA_0?t.lam=-o+Dt:u.value===Ze.AREA_1?t.lam=-o:u.value===Ze.AREA_2?t.lam=-o-Dt:t.lam=o<0?-o-vn:-o+vn;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===Ze.AREA_1?(h=m,m=-g,g=h):u.value===Ze.AREA_2?(m=-m,g=-g):u.value===Ze.AREA_3&&(h=m,m=g,g=-h),this.face===un.RIGHT?(h=p,p=-m,m=h):this.face===un.BACK?(p=-p,m=-m):this.face===un.LEFT&&(h=p,p=m,m=-h),t.phi=Math.acos(-g)-Dt,t.lam=Math.atan2(m,p),this.face===un.RIGHT?t.lam=Hc(t.lam,-Dt):this.face===un.BACK?t.lam=Hc(t.lam,-vn):this.face===un.LEFT&&(t.lam=Hc(t.lam,+Dt))}if(this.es!==0){var x,y,_;x=t.phi<0?1:0,y=Math.tan(t.phi),_=this.b/Math.sqrt(y*y+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-_*_)/(this.one_minus_f*_)),x&&(t.phi=-t.phi)}return t.lam+=this.long0,n.x=t.lam,n.y=t.phi,n}function mm(n,t,e,i){var s;return n$e&&s<=Dt+$e?(i.value=Ze.AREA_1,s-=Dt):s>Dt+$e||s<=-(Dt+$e)?(i.value=Ze.AREA_2,s=s>=0?s-vn:s+vn):(i.value=Ze.AREA_3,s+=Dt)),s}function Hc(n,t){var e=n+t;return e<-vn?e+=af:e>+vn&&(e-=af),e}var qW=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const YW={init:WW,forward:jW,inverse:XW,names:qW};var xv=[[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]],yu=[[-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]],w3=.8487,S3=1.3523,E3=Mr/5,$W=1/E3,Nc=18,I0=function(n,t){return n[0]+t*(n[1]+t*(n[2]+t*n[3]))},ZW=function(n,t){return n[1]+t*(2*n[2]+t*3*n[3])};function KW(n,t,e,i){for(var s=t;i;--i){var r=n(s);if(s-=r,Math.abs(r)=Nc&&(i=Nc-1),e=Mr*(e-$W*i);var s={x:I0(xv[i],e)*t,y:I0(yu[i],e)};return n.y<0&&(s.y=-s.y),s.x=s.x*this.a*w3+this.x0,s.y=s.y*this.a*S3+this.y0,s}function tj(n){var t={x:(n.x-this.x0)/(this.a*w3),y:Math.abs(n.y-this.y0)/(this.a*S3)};if(t.y>=1)t.x/=xv[Nc][0],t.y=n.y<0?-Dt:Dt;else{var e=Math.floor(t.y*Nc);for(e<0?e=0:e>=Nc&&(e=Nc-1);;)if(yu[e][0]>t.y)--e;else if(yu[e+1][0]<=t.y)++e;else break;var i=yu[e],s=5*(t.y-i[0])/(yu[e+1][0]-i[0]);s=KW(function(r){return(I0(i,r)-t.y)/ZW(i,r)},s,qt,100),t.x/=I0(xv[e],s),t.y=(5*e+s)*Xn,n.y<0&&(t.y=-t.y)}return t.x=$t(t.x+this.long0),t}var ej=["Robinson","robin"];const nj={init:JW,forward:QW,inverse:tj,names:ej};function ij(){this.name="geocent"}function sj(n){var t=f3(n,this.es,this.a);return t}function rj(n){var t=d3(n,this.es,this.a,this.b);return t}var aj=["Geocentric","geocentric","geocent","Geocent"];const oj={init:ij,forward:sj,inverse:rj,names:aj};var ui={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},lu={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 lj(){if(Object.keys(lu).forEach((function(e){if(typeof this[e]>"u")this[e]=lu[e].def;else{if(lu[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);lu[e].num&&(this[e]=parseFloat(this[e]))}lu[e].degrees&&(this[e]=this[e]*Xn)}).bind(this)),Math.abs(Math.abs(this.lat0)-Dt)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 cj(n){n.x-=this.long0;var t=Math.sin(n.y),e=Math.cos(n.y),i=Math.cos(n.x),s,r;switch(this.mode){case ui.OBLIQ:r=this.sinph0*t+this.cosph0*e*i;break;case ui.EQUIT:r=e*i;break;case ui.S_POLE:r=-t;break;case ui.N_POLE:r=t;break}switch(r=this.pn1/(this.p-r),s=r*e*Math.sin(n.x),this.mode){case ui.OBLIQ:r*=this.cosph0*t-this.sinph0*e*i;break;case ui.EQUIT:r*=t;break;case ui.N_POLE:r*=-(e*i);break;case ui.S_POLE:r*=e*i;break}var a,o;return a=r*this.cg+s*this.sg,o=1/(a*this.sw*this.h1+this.cw),s=(s*this.cg-r*this.sg)*this.cw*o,r=a*o,n.x=s*this.a,n.y=r*this.a,n}function hj(n){n.x/=this.a,n.y/=this.a;var t={x:n.x,y:n.y},e,i,s;s=1/(this.pn1-n.y*this.sw),e=this.pn1*n.x*s,i=this.pn1*n.y*this.cw*s,n.x=e*this.cg+i*this.sg,n.y=i*this.cg-e*this.sg;var r=Ui(n.x,n.y);if(Math.abs(r)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 pj(n){var t=n.x,e=n.y,i,s,r,a;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var o=this.radius_p/Ui(this.radius_p*Math.cos(e),Math.sin(e));if(s=o*Math.cos(t)*Math.cos(e),r=o*Math.sin(t)*Math.cos(e),a=o*Math.sin(e),(this.radius_g-s)*s-r*r-a*a*this.radius_p_inv2<0)return n.x=Number.NaN,n.y=Number.NaN,n;i=this.radius_g-s,this.flip_axis?(n.x=this.radius_g_1*Math.atan(r/Ui(a,i)),n.y=this.radius_g_1*Math.atan(a/i)):(n.x=this.radius_g_1*Math.atan(r/i),n.y=this.radius_g_1*Math.atan(a/Ui(r,i)))}else this.shape==="sphere"&&(i=Math.cos(e),s=Math.cos(t)*i,r=Math.sin(t)*i,a=Math.sin(e),i=this.radius_g-s,this.flip_axis?(n.x=this.radius_g_1*Math.atan(r/Ui(a,i)),n.y=this.radius_g_1*Math.atan(a/i)):(n.x=this.radius_g_1*Math.atan(r/i),n.y=this.radius_g_1*Math.atan(a/Ui(r,i))));return n.x=n.x*this.a,n.y=n.y*this.a,n}function mj(n){var t=-1,e=0,i=0,s,r,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)*Ui(1,i)):(e=Math.tan(n.x/this.radius_g_1),i=Math.tan(n.y/this.radius_g_1)*Ui(1,e));var l=i/this.radius_p;if(s=e*e+l*l+t*t,r=2*this.radius_g*t,a=r*r-4*s*this.C,a<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-r-Math.sqrt(a))/(2*s),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)),s=e*e+i*i+t*t,r=2*this.radius_g*t,a=r*r-4*s*this.C,a<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-r-Math.sqrt(a))/(2*s),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 gj=["Geostationary Satellite View","Geostationary_Satellite","geos"];const yj={init:dj,forward:pj,inverse:mj,names:gj};var Nu=1.340264,Ou=-.081106,Fu=893e-6,Uu=.003796,L0=Math.sqrt(3)/2;function _j(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function xj(n){var t=$t(n.x-this.long0),e=n.y,i=Math.asin(L0*Math.sin(e)),s=i*i,r=s*s*s;return n.x=t*Math.cos(i)/(L0*(Nu+3*Ou*s+r*(7*Fu+9*Uu*s))),n.y=i*(Nu+Ou*s+r*(Fu+Uu*s)),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function vj(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,s,r,a,o,l,c;for(c=0;c=Dt?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Tj,this.forward=Aj)}function Sj(n){var t=$t(n.x-(this.long0||0)),e=n.y,i,s,r;return i=this.am1+this.m1-xh(e,s=Math.sin(e),r=Math.cos(e),this.en),s=r*t/(i*Math.sqrt(1-this.es*s*s)),n.x=i*Math.sin(s),n.y=this.am1-i*Math.cos(s),n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function Ej(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var t,e,i,s;if(e=Ui(n.x,n.y=this.am1-n.y),s=mM(this.am1+this.m1-e,this.es,this.en),(t=Math.abs(s))cf?(n.x=s*Math.sin(i=t*Math.cos(e)/s),n.y=this.cphi1-s*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 Tj(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var t,e,i=Ui(n.x,n.y=this.cphi1-n.y);if(e=this.cphi1+this.phi1-i,Math.abs(e)>Dt)throw new Error;return Math.abs(Math.abs(e)-Dt)<=cf?t=0:t=i*Math.atan2(n.x,n.y)/Math.cos(e),n.x=$t(t+(this.long0||0)),n.y=lo(e),n}var Cj=["bonne","Bonne (Werner lat_1=90)"];const Rj={init:wj,names:Cj};function Pj(n){n.Proj.projections.add(Nm),n.Proj.projections.add(Om),n.Proj.projections.add(S9),n.Proj.projections.add(N9),n.Proj.projections.add(B9),n.Proj.projections.add(j9),n.Proj.projections.add(K9),n.Proj.projections.add(n7),n.Proj.projections.add(o7),n.Proj.projections.add(f7),n.Proj.projections.add(R7),n.Proj.projections.add(O7),n.Proj.projections.add(B7),n.Proj.projections.add(X7),n.Proj.projections.add(K7),n.Proj.projections.add(nW),n.Proj.projections.add(oW),n.Proj.projections.add(fW),n.Proj.projections.add(_W),n.Proj.projections.add(wW),n.Proj.projections.add(CW),n.Proj.projections.add(DW),n.Proj.projections.add(kW),n.Proj.projections.add(VW),n.Proj.projections.add(YW),n.Proj.projections.add(nj),n.Proj.projections.add(oj),n.Proj.projections.add(fj),n.Proj.projections.add(yj),n.Proj.projections.add(bj),n.Proj.projections.add(Rj)}Ts.defaultDatum="WGS84";Ts.Proj=Ar;Ts.WGS84=new Ts.Proj("WGS84");Ts.Point=sh;Ts.toPoint=p3;Ts.defs=vi;Ts.nadgrid=AV;Ts.transform=R0;Ts.mgrs=GV;Ts.version="__VERSION__";Pj(Ts);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Ij=4,DA=0,NA=1,Lj=2;function vh(n){let t=n.length;for(;--t>=0;)n[t]=0}const Dj=0,A3=1,Nj=2,Oj=3,Fj=258,xM=29,qf=256,hf=qf+1+xM,Gc=30,vM=19,T3=2*hf+1,Yo=15,_x=16,Uj=7,MM=256,C3=16,R3=17,P3=18,vv=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]),kj=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),I3=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zj=512,Kr=new Array((hf+2)*2);vh(Kr);const ku=new Array(Gc*2);vh(ku);const uf=new Array(zj);vh(uf);const ff=new Array(Fj-Oj+1);vh(ff);const bM=new Array(xM);vh(bM);const D0=new Array(Gc);vh(D0);function xx(n,t,e,i,s){this.static_tree=n,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=s,this.has_stree=n&&n.length}let L3,D3,N3;function vx(n,t){this.dyn_tree=n,this.max_code=0,this.stat_desc=t}const O3=n=>n<256?uf[n]:uf[256+(n>>>7)],df=(n,t)=>{n.pending_buf[n.pending++]=t&255,n.pending_buf[n.pending++]=t>>>8&255},zi=(n,t,e)=>{n.bi_valid>_x-e?(n.bi_buf|=t<>_x-n.bi_valid,n.bi_valid+=e-_x):(n.bi_buf|=t<{zi(n,e[t*2],e[t*2+1])},F3=(n,t)=>{let e=0;do e|=n&1,n>>>=1,e<<=1;while(--t>0);return e>>>1},Bj=n=>{n.bi_valid===16?(df(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)},Hj=(n,t)=>{const e=t.dyn_tree,i=t.max_code,s=t.stat_desc.static_tree,r=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,x=0;for(p=0;p<=Yo;p++)n.bl_count[p]=0;for(e[n.heap[n.heap_max]*2+1]=0,c=n.heap_max+1;cl&&(p=l,x++),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),r&&(n.static_len+=g*(s[h*2+1]+m)));if(x!==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]--,x-=2}while(x>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--)}},U3=(n,t,e)=>{const i=new Array(Yo+1);let s=0,r,a;for(r=1;r<=Yo;r++)s=s+e[r-1]<<1,i[r]=s;for(a=0;a<=t;a++){let o=n[a*2+1];o!==0&&(n[a*2]=F3(i[o]++,o))}},Gj=()=>{let n,t,e,i,s;const r=new Array(Yo+1);for(e=0,i=0;i>=7;i{let t;for(t=0;t{n.bi_valid>8?df(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},OA=(n,t,e,i)=>{const s=t*2,r=e*2;return n[s]{const i=n.heap[e];let s=e<<1;for(;s<=n.heap_len&&(s{let i,s,r=0,a,o;if(n.sym_next!==0)do i=n.pending_buf[n.sym_buf+r++]&255,i+=(n.pending_buf[n.sym_buf+r++]&255)<<8,s=n.pending_buf[n.sym_buf+r++],i===0?xr(n,s,t):(a=ff[s],xr(n,a+qf+1,t),o=vv[a],o!==0&&(s-=bM[a],zi(n,s,o)),i--,a=O3(i),xr(n,a,e),o=Fm[a],o!==0&&(i-=D0[a],zi(n,i,o)));while(r{const e=t.dyn_tree,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,r=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--)Mx(n,e,a);c=r;do a=n.heap[1],n.heap[1]=n.heap[n.heap_len--],Mx(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++,Mx(n,e,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],Hj(n,t),U3(e,l,n.bl_count)},UA=(n,t,e)=>{let i,s=-1,r,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++)r=a,a=t[(i+1)*2+1],!(++o{let i,s=-1,r,a=t[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),i=0;i<=e;i++)if(r=a,a=t[(i+1)*2+1],!(++o{let t;for(UA(n,n.dyn_ltree,n.l_desc.max_code),UA(n,n.dyn_dtree,n.d_desc.max_code),Mv(n,n.bl_desc),t=vM-1;t>=3&&n.bl_tree[I3[t]*2+1]===0;t--);return n.opt_len+=3*(t+1)+5+5+4,t},Wj=(n,t,e,i)=>{let s;for(zi(n,t-257,5),zi(n,e-1,5),zi(n,i-4,4),s=0;s{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&n.dyn_ltree[e*2]!==0)return DA;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return NA;for(e=32;e{zA||(Gj(),zA=!0),n.l_desc=new vx(n.dyn_ltree,L3),n.d_desc=new vx(n.dyn_dtree,D3),n.bl_desc=new vx(n.bl_tree,N3),n.bi_buf=0,n.bi_valid=0,k3(n)},B3=(n,t,e,i)=>{zi(n,(Dj<<1)+(i?1:0),3),z3(n),df(n,e),df(n,~e),e&&n.pending_buf.set(n.window.subarray(t,t+e),n.pending),n.pending+=e},qj=n=>{zi(n,A3<<1,3),xr(n,MM,Kr),Bj(n)},Yj=(n,t,e,i)=>{let s,r,a=0;n.level>0?(n.strm.data_type===Lj&&(n.strm.data_type=jj(n)),Mv(n,n.l_desc),Mv(n,n.d_desc),a=Vj(n),s=n.opt_len+3+7>>>3,r=n.static_len+3+7>>>3,r<=s&&(s=r)):s=r=e+5,e+4<=s&&t!==-1?B3(n,t,e,i):n.strategy===Ij||r===s?(zi(n,(A3<<1)+(i?1:0),3),FA(n,Kr,ku)):(zi(n,(Nj<<1)+(i?1:0),3),Wj(n,n.l_desc.max_code+1,n.d_desc.max_code+1,a+1),FA(n,n.dyn_ltree,n.dyn_dtree)),k3(n),i&&z3(n)},$j=(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[(ff[e]+qf+1)*2]++,n.dyn_dtree[O3(t)*2]++),n.sym_next===n.sym_end);var Zj=Xj,Kj=B3,Jj=Yj,Qj=$j,tX=qj,eX={_tr_init:Zj,_tr_stored_block:Kj,_tr_flush_block:Jj,_tr_tally:Qj,_tr_align:tX};const nX=(n,t,e,i)=>{let s=n&65535|0,r=n>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do s=s+t[i++]|0,r=r+s|0;while(--a);s%=65521,r%=65521}return s|r<<16|0};var pf=nX;const iX=()=>{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},sX=new Uint32Array(iX()),rX=(n,t,e,i)=>{const s=sX,r=i+e;n^=-1;for(let a=i;a>>8^s[(n^t[a])&255];return n^-1};var Hn=rX,ah={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"},Yf={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:aX,_tr_stored_block:bv,_tr_flush_block:oX,_tr_tally:ja,_tr_align:lX}=eX,{Z_NO_FLUSH:Xa,Z_PARTIAL_FLUSH:cX,Z_FULL_FLUSH:hX,Z_FINISH:bs,Z_BLOCK:BA,Z_OK:jn,Z_STREAM_END:HA,Z_STREAM_ERROR:Tr,Z_DATA_ERROR:uX,Z_BUF_ERROR:bx,Z_DEFAULT_COMPRESSION:fX,Z_FILTERED:dX,Z_HUFFMAN_ONLY:gm,Z_RLE:pX,Z_FIXED:mX,Z_DEFAULT_STRATEGY:gX,Z_UNKNOWN:yX,Z_DEFLATED:Rg}=Yf,_X=9,xX=15,vX=8,MX=29,bX=256,wv=bX+1+MX,wX=30,SX=19,EX=2*wv+1,AX=15,ze=3,Ba=258,Cr=Ba+ze+1,TX=32,oh=42,wM=57,Sv=69,Ev=73,Av=91,Tv=103,$o=113,_u=666,wi=1,Mh=2,yl=3,bh=4,CX=3,Zo=(n,t)=>(n.msg=ah[t],t),GA=n=>n*2-(n>4?9:0),za=n=>{let t=n.length;for(;--t>=0;)n[t]=0},RX=n=>{let t,e,i,s=n.w_size;t=n.hash_size,i=t;do e=n.head[--i],n.head[i]=e>=s?e-s:0;while(--t);t=s,i=t;do e=n.prev[--i],n.prev[i]=e>=s?e-s:0;while(--t)};let PX=(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))},is=(n,t)=>{oX(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,t),n.block_start=n.strstart,Qi(n.strm)},Xe=(n,t)=>{n.pending_buf[n.pending++]=t},cu=(n,t)=>{n.pending_buf[n.pending++]=t>>>8&255,n.pending_buf[n.pending++]=t&255},Cv=(n,t,e,i)=>{let s=n.avail_in;return s>i&&(s=i),s===0?0:(n.avail_in-=s,t.set(n.input.subarray(n.next_in,n.next_in+s),e),n.state.wrap===1?n.adler=pf(n.adler,t,s,e):n.state.wrap===2&&(n.adler=Hn(n.adler,t,s,e)),n.next_in+=s,n.total_in+=s,s)},H3=(n,t)=>{let e=n.max_chain_length,i=n.strstart,s,r,a=n.prev_length,o=n.nice_match;const l=n.strstart>n.w_size-Cr?n.strstart-(n.w_size-Cr):0,c=n.window,h=n.w_mask,u=n.prev,p=n.strstart+Ba;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(s=t,!(c[s+a]!==g||c[s+a-1]!==m||c[s]!==c[i]||c[++s]!==c[i+1])){i+=2,s++;do;while(c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&ia){if(n.match_start=t,a=r,r>=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},lh=n=>{const t=n.w_size;let e,i,s;do{if(i=n.window_size-n.lookahead-n.strstart,n.strstart>=t+(t-Cr)&&(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),RX(n),i+=t),n.strm.avail_in===0)break;if(e=Cv(n.strm,n.window,n.strstart+n.lookahead,i),n.lookahead+=e,n.lookahead+n.insert>=ze)for(s=n.strstart-n.insert,n.ins_h=n.window[s],n.ins_h=qa(n,n.ins_h,n.window[s+1]);n.insert&&(n.ins_h=qa(n,n.ins_h,n.window[s+ze-1]),n.prev[s&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=s,s++,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,s,r,a=0,o=n.strm.avail_in;do{if(i=65535,r=n.bi_valid+42>>3,n.strm.avail_outs+n.strm.avail_in&&(i=s+n.strm.avail_in),i>r&&(i=r),i>8,n.pending_buf[n.pending-2]=~i,n.pending_buf[n.pending-1]=~i>>8,Qi(n.strm),s&&(s>i&&(s=i),n.strm.output.set(n.window.subarray(n.block_start,n.block_start+s),n.strm.next_out),n.strm.next_out+=s,n.strm.avail_out-=s,n.strm.total_out+=s,n.block_start+=s,i-=s),i&&(Cv(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_waterr&&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++,r+=n.w_size,n.insert>n.strstart&&(n.insert=n.strstart)),r>n.strm.avail_in&&(r=n.strm.avail_in),r&&(Cv(n.strm,n.window,n.strstart,r),n.strstart+=r,n.insert+=r>n.w_size-n.insert?n.w_size-n.insert:r),n.high_water>3,r=n.pending_buf_size-r>65535?65535:n.pending_buf_size-r,e=r>n.w_size?n.w_size:r,s=n.strstart-n.block_start,(s>=e||(s||t===bs)&&t!==Xa&&n.strm.avail_in===0&&s<=r)&&(i=s>r?r:s,a=t===bs&&n.strm.avail_in===0&&i===s?1:0,bv(n,n.block_start,i,a),n.block_start+=i,Qi(n.strm)),a?yl:wi)},wx=(n,t)=>{let e,i;for(;;){if(n.lookahead=ze&&(n.ins_h=qa(n,n.ins_h,n.window[n.strstart+ze-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-Cr&&(n.match_length=H3(n,e)),n.match_length>=ze)if(i=ja(n,n.strstart-n.match_start,n.match_length-ze),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=ze){n.match_length--;do n.strstart++,n.ins_h=qa(n,n.ins_h,n.window[n.strstart+ze-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=qa(n,n.ins_h,n.window[n.strstart+1]);else i=ja(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&(is(n,!1),n.strm.avail_out===0))return wi}return n.insert=n.strstart{let e,i,s;for(;;){if(n.lookahead=ze&&(n.ins_h=qa(n,n.ins_h,n.window[n.strstart+ze-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=ze-1,e!==0&&n.prev_length4096)&&(n.match_length=ze-1)),n.prev_length>=ze&&n.match_length<=n.prev_length){s=n.strstart+n.lookahead-ze,i=ja(n,n.strstart-1-n.prev_match,n.prev_length-ze),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=s&&(n.ins_h=qa(n,n.ins_h,n.window[n.strstart+ze-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=ze-1,n.strstart++,i&&(is(n,!1),n.strm.avail_out===0))return wi}else if(n.match_available){if(i=ja(n,0,n.window[n.strstart-1]),i&&is(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return wi}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=ja(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart{let e,i,s,r;const a=n.window;for(;;){if(n.lookahead<=Ba){if(lh(n),n.lookahead<=Ba&&t===Xa)return wi;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=ze&&n.strstart>0&&(s=n.strstart-1,i=a[s],i===a[++s]&&i===a[++s]&&i===a[++s])){r=n.strstart+Ba;do;while(i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&sn.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=ze?(e=ja(n,1,n.match_length-ze),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(e=ja(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),e&&(is(n,!1),n.strm.avail_out===0))return wi}return n.insert=0,t===bs?(is(n,!0),n.strm.avail_out===0?yl:bh):n.sym_next&&(is(n,!1),n.strm.avail_out===0)?wi:Mh},LX=(n,t)=>{let e;for(;;){if(n.lookahead===0&&(lh(n),n.lookahead===0)){if(t===Xa)return wi;break}if(n.match_length=0,e=ja(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,e&&(is(n,!1),n.strm.avail_out===0))return wi}return n.insert=0,t===bs?(is(n,!0),n.strm.avail_out===0?yl:bh):n.sym_next&&(is(n,!1),n.strm.avail_out===0)?wi:Mh};function dr(n,t,e,i,s){this.good_length=n,this.max_lazy=t,this.nice_length=e,this.max_chain=i,this.func=s}const xu=[new dr(0,0,0,0,G3),new dr(4,4,8,4,wx),new dr(4,5,16,8,wx),new dr(4,6,32,32,wx),new dr(4,4,16,16,vc),new dr(8,16,32,32,vc),new dr(8,16,128,128,vc),new dr(8,32,128,256,vc),new dr(32,128,258,1024,vc),new dr(32,258,258,4096,vc)],DX=n=>{n.window_size=2*n.w_size,za(n.head),n.max_lazy_match=xu[n.level].max_lazy,n.good_match=xu[n.level].good_length,n.nice_match=xu[n.level].nice_length,n.max_chain_length=xu[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=ze-1,n.match_available=0,n.ins_h=0};function NX(){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=Rg,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(EX*2),this.dyn_dtree=new Uint16Array((2*wX+1)*2),this.bl_tree=new Uint16Array((2*SX+1)*2),za(this.dyn_ltree),za(this.dyn_dtree),za(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(AX+1),this.heap=new Uint16Array(2*wv+1),za(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*wv+1),za(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 $f=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.status!==oh&&t.status!==wM&&t.status!==Sv&&t.status!==Ev&&t.status!==Av&&t.status!==Tv&&t.status!==$o&&t.status!==_u?1:0},V3=n=>{if($f(n))return Zo(n,Tr);n.total_in=n.total_out=0,n.data_type=yX;const t=n.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?wM:t.wrap?oh:$o,n.adler=t.wrap===2?0:1,t.last_flush=-2,aX(t),jn},W3=n=>{const t=V3(n);return t===jn&&DX(n.state),t},OX=(n,t)=>$f(n)||n.state.wrap!==2?Tr:(n.state.gzhead=t,jn),j3=(n,t,e,i,s,r)=>{if(!n)return Tr;let a=1;if(t===fX&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),s<1||s>_X||e!==Rg||i<8||i>15||t<0||t>9||r<0||r>mX||i===8&&a!==1)return Zo(n,Tr);i===8&&(i=9);const o=new NX;return n.state=o,o.strm=n,o.status=oh,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<j3(n,t,Rg,xX,vX,gX),UX=(n,t)=>{if($f(n)||t>BA||t<0)return n?Zo(n,Tr):Tr;const e=n.state;if(!n.output||n.avail_in!==0&&!n.input||e.status===_u&&t!==bs)return Zo(n,n.avail_out===0?bx:Tr);const i=e.last_flush;if(e.last_flush=t,e.pending!==0){if(Qi(n),n.avail_out===0)return e.last_flush=-1,jn}else if(n.avail_in===0&&GA(t)<=GA(i)&&t!==bs)return Zo(n,bx);if(e.status===_u&&n.avail_in!==0)return Zo(n,bx);if(e.status===oh&&e.wrap===0&&(e.status=$o),e.status===oh){let s=Rg+(e.w_bits-8<<4)<<8,r=-1;if(e.strategy>=gm||e.level<2?r=0:e.level<6?r=1:e.level===6?r=2:r=3,s|=r<<6,e.strstart!==0&&(s|=TX),s+=31-s%31,cu(e,s),e.strstart!==0&&(cu(e,n.adler>>>16),cu(e,n.adler&65535)),n.adler=1,e.status=$o,Qi(n),e.pending!==0)return e.last_flush=-1,jn}if(e.status===wM){if(n.adler=0,Xe(e,31),Xe(e,139),Xe(e,8),e.gzhead)Xe(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)),Xe(e,e.gzhead.time&255),Xe(e,e.gzhead.time>>8&255),Xe(e,e.gzhead.time>>16&255),Xe(e,e.gzhead.time>>24&255),Xe(e,e.level===9?2:e.strategy>=gm||e.level<2?4:0),Xe(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(Xe(e,e.gzhead.extra.length&255),Xe(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(n.adler=Hn(n.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=Sv;else if(Xe(e,0),Xe(e,0),Xe(e,0),Xe(e,0),Xe(e,0),Xe(e,e.level===9?2:e.strategy>=gm||e.level<2?4:0),Xe(e,CX),e.status=$o,Qi(n),e.pending!==0)return e.last_flush=-1,jn}if(e.status===Sv){if(e.gzhead.extra){let s=e.pending,r=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+r>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>s&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s)),e.gzindex+=o,Qi(n),e.pending!==0)return e.last_flush=-1,jn;s=0,r-=o}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+r),e.pending),e.pending+=r,e.gzhead.hcrc&&e.pending>s&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s)),e.gzindex=0}e.status=Ev}if(e.status===Ev){if(e.gzhead.name){let s=e.pending,r;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>s&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s)),Qi(n),e.pending!==0)return e.last_flush=-1,jn;s=0}e.gzindexs&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s)),e.gzindex=0}e.status=Av}if(e.status===Av){if(e.gzhead.comment){let s=e.pending,r;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>s&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s)),Qi(n),e.pending!==0)return e.last_flush=-1,jn;s=0}e.gzindexs&&(n.adler=Hn(n.adler,e.pending_buf,e.pending-s,s))}e.status=Tv}if(e.status===Tv){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(Qi(n),e.pending!==0))return e.last_flush=-1,jn;Xe(e,n.adler&255),Xe(e,n.adler>>8&255),n.adler=0}if(e.status=$o,Qi(n),e.pending!==0)return e.last_flush=-1,jn}if(n.avail_in!==0||e.lookahead!==0||t!==Xa&&e.status!==_u){let s=e.level===0?G3(e,t):e.strategy===gm?LX(e,t):e.strategy===pX?IX(e,t):xu[e.level].func(e,t);if((s===yl||s===bh)&&(e.status=_u),s===wi||s===yl)return n.avail_out===0&&(e.last_flush=-1),jn;if(s===Mh&&(t===cX?lX(e):t!==BA&&(bv(e,0,0,!1),t===hX&&(za(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),Qi(n),n.avail_out===0))return e.last_flush=-1,jn}return t!==bs?jn:e.wrap<=0?HA:(e.wrap===2?(Xe(e,n.adler&255),Xe(e,n.adler>>8&255),Xe(e,n.adler>>16&255),Xe(e,n.adler>>24&255),Xe(e,n.total_in&255),Xe(e,n.total_in>>8&255),Xe(e,n.total_in>>16&255),Xe(e,n.total_in>>24&255)):(cu(e,n.adler>>>16),cu(e,n.adler&65535)),Qi(n),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?jn:HA)},kX=n=>{if($f(n))return Tr;const t=n.state.status;return n.state=null,t===$o?Zo(n,uX):jn},zX=(n,t)=>{let e=t.length;if($f(n))return Tr;const i=n.state,s=i.wrap;if(s===2||s===1&&i.status!==oh||i.lookahead)return Tr;if(s===1&&(n.adler=pf(n.adler,t,e,0)),i.wrap=0,e>=i.w_size){s===0&&(za(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 r=n.avail_in,a=n.next_in,o=n.input;for(n.avail_in=e,n.next_in=0,n.input=t,lh(i);i.lookahead>=ze;){let l=i.strstart,c=i.lookahead-(ze-1);do i.ins_h=qa(i,i.ins_h,i.window[l+ze-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=ze-1,lh(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=ze-1,i.match_available=0,n.next_in=a,n.input=o,n.avail_in=r,i.wrap=s,jn};var BX=FX,HX=j3,GX=W3,VX=V3,WX=OX,jX=UX,XX=kX,qX=zX,YX="pako deflate (from Nodeca project)",zu={deflateInit:BX,deflateInit2:HX,deflateReset:GX,deflateResetKeep:VX,deflateSetHeader:WX,deflate:jX,deflateEnd:XX,deflateSetDictionary:qX,deflateInfo:YX};const $X=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);var ZX=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)$X(e,i)&&(n[i]=e[i])}}return n},KX=n=>{let t=0;for(let i=0,s=n.length;i=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;mf[254]=mf[254]=1;var JX=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let t,e,i,s,r,a=n.length,o=0;for(s=0;s>>6,t[r++]=128|e&63):e<65536?(t[r++]=224|e>>>12,t[r++]=128|e>>>6&63,t[r++]=128|e&63):(t[r++]=240|e>>>18,t[r++]=128|e>>>12&63,t[r++]=128|e>>>6&63,t[r++]=128|e&63);return t};const QX=(n,t)=>{if(t<65534&&n.subarray&&X3)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,s;const r=new Array(e*2);for(s=0,i=0;i4){r[s++]=65533,i+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&i1){r[s++]=65533;continue}a<65536?r[s++]=a:(a-=65536,r[s++]=55296|a>>10&1023,r[s++]=56320|a&1023)}return QX(r,s)},eq=(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+mf[n[e]]>t?e:t},gf={string2buf:JX,buf2string:tq,utf8border:eq};function nq(){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 q3=nq;const Y3=Object.prototype.toString,{Z_NO_FLUSH:iq,Z_SYNC_FLUSH:sq,Z_FULL_FLUSH:rq,Z_FINISH:aq,Z_OK:N0,Z_STREAM_END:oq,Z_DEFAULT_COMPRESSION:lq,Z_DEFAULT_STRATEGY:cq,Z_DEFLATED:hq}=Yf;function SM(n){this.options=Pg.assign({level:lq,method:hq,chunkSize:16384,windowBits:15,memLevel:8,strategy:cq},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 q3,this.strm.avail_out=0;let e=zu.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==N0)throw new Error(ah[e]);if(t.header&&zu.deflateSetHeader(this.strm,t.header),t.dictionary){let i;if(typeof t.dictionary=="string"?i=gf.string2buf(t.dictionary):Y3.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,e=zu.deflateSetDictionary(this.strm,i),e!==N0)throw new Error(ah[e]);this._dict_set=!0}}SM.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize;let s,r;if(this.ended)return!1;for(t===~~t?r=t:r=t===!0?aq:iq,typeof n=="string"?e.input=gf.string2buf(n):Y3.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),(r===sq||r===rq)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(s=zu.deflate(e,r),s===oq)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),s=zu.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===N0;if(e.avail_out===0){this.onData(e.output);continue}if(r>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};SM.prototype.onData=function(n){this.chunks.push(n)};SM.prototype.onEnd=function(n){n===N0&&(this.result=Pg.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};const ym=16209,uq=16191;var fq=function(t,e){let i,s,r,a,o,l,c,h,u,p,m,g,x,y,_,b,S,w,R,T,C,L,P,E;const D=t.state;i=t.next_in,P=t.input,s=i+(t.avail_in-5),r=t.next_out,E=t.output,a=r-(e-t.avail_out),o=r+(t.avail_out-257),l=D.dmax,c=D.wsize,h=D.whave,u=D.wnext,p=D.window,m=D.hold,g=D.bits,x=D.lencode,y=D.distcode,_=(1<>>24,m>>>=w,g-=w,w=S>>>16&255,w===0)E[r++]=S&65535;else if(w&16){R=S&65535,w&=15,w&&(g>>=w,g-=w),g<15&&(m+=P[i++]<>>24,m>>>=w,g-=w,w=S>>>16&255,w&16){if(T=S&65535,w&=15,gl){t.msg="invalid distance too far back",D.mode=ym;break t}if(m>>>=w,g-=w,w=r-a,T>w){if(w=T-w,w>h&&D.sane){t.msg="invalid distance too far back",D.mode=ym;break t}if(C=0,L=p,u===0){if(C+=c-w,w2;)E[r++]=L[C++],E[r++]=L[C++],E[r++]=L[C++],R-=3;R&&(E[r++]=L[C++],R>1&&(E[r++]=L[C++]))}else{C=r-T;do E[r++]=E[C++],E[r++]=E[C++],E[r++]=E[C++],R-=3;while(R>2);R&&(E[r++]=E[C++],R>1&&(E[r++]=E[C++]))}}else if(w&64){t.msg="invalid distance code",D.mode=ym;break t}else{S=y[(S&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,x=0,y=0,_=0,b=0,S,w,R,T,C,L=null,P;const E=new Uint16Array(Mc+1),D=new Uint16Array(Mc+1);let z=null,G,W,Q;for(c=0;c<=Mc;c++)E[c]=0;for(h=0;h=1&&E[p]===0;p--);if(m>p&&(m=p),p===0)return s[r++]=1<<24|64<<16|0,s[r++]=1<<24|64<<16|0,o.bits=1,0;for(u=1;u0&&(n===jA||p!==1))return-1;for(D[1]=0,c=1;cVA||n===XA&&_>WA)return 1;for(;;){G=c-x,a[h]+1=P?(W=z[a[h]-P],Q=L[a[h]-P]):(W=96,Q=0),S=1<>x)+w]=G<<24|W<<16|Q|0;while(w!==0);for(S=1<>=1;if(S!==0?(b&=S-1,b+=S):b=0,h++,--E[c]===0){if(c===p)break;c=t[e+a[h]]}if(c>m&&(b&T)!==R){for(x===0&&(x=m),C+=u,g=c-x,y=1<VA||n===XA&&_>WA)return 1;R=b&T,s[R]=m<<24|g<<16|C-r|0}}return b!==0&&(s[C+b]=c-x<<24|64<<16|0),o.bits=m,0};var Bu=yq;const _q=0,$3=1,Z3=2,{Z_FINISH:qA,Z_BLOCK:xq,Z_TREES:_m,Z_OK:_l,Z_STREAM_END:vq,Z_NEED_DICT:Mq,Z_STREAM_ERROR:Cs,Z_DATA_ERROR:K3,Z_MEM_ERROR:J3,Z_BUF_ERROR:bq,Z_DEFLATED:YA}=Yf,Ig=16180,$A=16181,ZA=16182,KA=16183,JA=16184,QA=16185,tT=16186,eT=16187,nT=16188,iT=16189,O0=16190,$r=16191,Ex=16192,sT=16193,Ax=16194,rT=16195,aT=16196,oT=16197,lT=16198,xm=16199,vm=16200,cT=16201,hT=16202,uT=16203,fT=16204,dT=16205,Tx=16206,pT=16207,mT=16208,ln=16209,Q3=16210,tP=16211,wq=852,Sq=592,Eq=15,Aq=Eq,gT=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function Tq(){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 wl=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.modetP?1:0},eP=n=>{if(wl(n))return Cs;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=Ig,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(wq),t.distcode=t.distdyn=new Int32Array(Sq),t.sane=1,t.back=-1,_l},nP=n=>{if(wl(n))return Cs;const t=n.state;return t.wsize=0,t.whave=0,t.wnext=0,eP(n)},iP=(n,t)=>{let e;if(wl(n))return Cs;const i=n.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Cs:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=e,i.wbits=t,nP(n))},sP=(n,t)=>{if(!n)return Cs;const e=new Tq;n.state=e,e.strm=n,e.window=null,e.mode=Ig;const i=iP(n,t);return i!==_l&&(n.state=null),i},Cq=n=>sP(n,Aq);let yT=!0,Cx,Rx;const Rq=n=>{if(yT){Cx=new Int32Array(512),Rx=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(Bu($3,n.lens,0,288,Cx,0,n.work,{bits:9}),t=0;t<32;)n.lens[t++]=5;Bu(Z3,n.lens,0,32,Rx,0,n.work,{bits:5}),yT=!1}n.lencode=Cx,n.lenbits=9,n.distcode=Rx,n.distbits=5},rP=(n,t,e,i)=>{let s;const r=n.state;return r.window===null&&(r.wsize=1<=r.wsize?(r.window.set(t.subarray(e-r.wsize,e),0),r.wnext=0,r.whave=r.wsize):(s=r.wsize-r.wnext,s>i&&(s=i),r.window.set(t.subarray(e-i,e-i+s),r.wnext),i-=s,i?(r.window.set(t.subarray(e-i,e),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=s,r.wnext===r.wsize&&(r.wnext=0),r.whave{let e,i,s,r,a,o,l,c,h,u,p,m,g,x,y=0,_,b,S,w,R,T,C,L;const P=new Uint8Array(4);let E,D;const z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(wl(n)||!n.output||!n.input&&n.avail_in!==0)return Cs;e=n.state,e.mode===$r&&(e.mode=Ex),a=n.next_out,s=n.output,l=n.avail_out,r=n.next_in,i=n.input,o=n.avail_in,c=e.hold,h=e.bits,u=o,p=l,L=_l;t:for(;;)switch(e.mode){case Ig:if(e.wrap===0){e.mode=Ex;break}for(;h<16;){if(o===0)break t;o--,c+=i[r++]<>>8&255,e.check=Hn(e.check,P,2,0),c=0,h=0,e.mode=$A;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((c&255)<<8)+(c>>8))%31){n.msg="incorrect header check",e.mode=ln;break}if((c&15)!==YA){n.msg="unknown compression method",e.mode=ln;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=ln;break}e.dmax=1<>8&1),e.flags&512&&e.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,e.check=Hn(e.check,P,2,0)),c=0,h=0,e.mode=ZA;case ZA:for(;h<32;){if(o===0)break t;o--,c+=i[r++]<>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,e.check=Hn(e.check,P,4,0)),c=0,h=0,e.mode=KA;case KA:for(;h<16;){if(o===0)break t;o--,c+=i[r++]<>8),e.flags&512&&e.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,e.check=Hn(e.check,P,2,0)),c=0,h=0,e.mode=JA;case JA:if(e.flags&1024){for(;h<16;){if(o===0)break t;o--,c+=i[r++]<>>8&255,e.check=Hn(e.check,P,2,0)),c=0,h=0}else e.head&&(e.head.extra=null);e.mode=QA;case QA: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(r,r+m),C)),e.flags&512&&e.wrap&4&&(e.check=Hn(e.check,i,m,r)),o-=m,r+=m,e.length-=m),e.length))break t;e.length=0,e.mode=tT;case tT:if(e.flags&2048){if(o===0)break t;m=0;do C=i[r+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=$r;break;case iT:for(;h<32;){if(o===0)break t;o--,c+=i[r++]<>>=h&7,h-=h&7,e.mode=Tx;break}for(;h<3;){if(o===0)break t;o--,c+=i[r++]<>>=1,h-=1,c&3){case 0:e.mode=sT;break;case 1:if(Rq(e),e.mode=xm,t===_m){c>>>=2,h-=2;break t}break;case 2:e.mode=aT;break;case 3:n.msg="invalid block type",e.mode=ln}c>>>=2,h-=2;break;case sT:for(c>>>=h&7,h-=h&7;h<32;){if(o===0)break t;o--,c+=i[r++]<>>16^65535)){n.msg="invalid stored block lengths",e.mode=ln;break}if(e.length=c&65535,c=0,h=0,e.mode=Ax,t===_m)break t;case Ax:e.mode=rT;case rT:if(m=e.length,m){if(m>o&&(m=o),m>l&&(m=l),m===0)break t;s.set(i.subarray(r,r+m),a),o-=m,r+=m,l-=m,a+=m,e.length-=m;break}e.mode=$r;break;case aT:for(;h<14;){if(o===0)break t;o--,c+=i[r++]<>>=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=ln;break}e.have=0,e.mode=oT;case oT:for(;e.have>>=3,h-=3}for(;e.have<19;)e.lens[z[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,E={bits:e.lenbits},L=Bu(_q,e.lens,0,19,e.lencode,0,e.work,E),e.lenbits=E.bits,L){n.msg="invalid code lengths set",e.mode=ln;break}e.have=0,e.mode=lT;case lT:for(;e.have>>24,b=y>>>16&255,S=y&65535,!(_<=h);){if(o===0)break t;o--,c+=i[r++]<>>=_,h-=_,e.lens[e.have++]=S;else{if(S===16){for(D=_+2;h>>=_,h-=_,e.have===0){n.msg="invalid bit length repeat",e.mode=ln;break}C=e.lens[e.have-1],m=3+(c&3),c>>>=2,h-=2}else if(S===17){for(D=_+3;h>>=_,h-=_,C=0,m=3+(c&7),c>>>=3,h-=3}else{for(D=_+7;h>>=_,h-=_,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=ln;break}for(;m--;)e.lens[e.have++]=C}}if(e.mode===ln)break;if(e.lens[256]===0){n.msg="invalid code -- missing end-of-block",e.mode=ln;break}if(e.lenbits=9,E={bits:e.lenbits},L=Bu($3,e.lens,0,e.nlen,e.lencode,0,e.work,E),e.lenbits=E.bits,L){n.msg="invalid literal/lengths set",e.mode=ln;break}if(e.distbits=6,e.distcode=e.distdyn,E={bits:e.distbits},L=Bu(Z3,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,E),e.distbits=E.bits,L){n.msg="invalid distances set",e.mode=ln;break}if(e.mode=xm,t===_m)break t;case xm:e.mode=vm;case vm:if(o>=6&&l>=258){n.next_out=a,n.avail_out=l,n.next_in=r,n.avail_in=o,e.hold=c,e.bits=h,fq(n,p),a=n.next_out,s=n.output,l=n.avail_out,r=n.next_in,i=n.input,o=n.avail_in,c=e.hold,h=e.bits,e.mode===$r&&(e.back=-1);break}for(e.back=0;y=e.lencode[c&(1<>>24,b=y>>>16&255,S=y&65535,!(_<=h);){if(o===0)break t;o--,c+=i[r++]<>w)],_=y>>>24,b=y>>>16&255,S=y&65535,!(w+_<=h);){if(o===0)break t;o--,c+=i[r++]<>>=w,h-=w,e.back+=w}if(c>>>=_,h-=_,e.back+=_,e.length=S,b===0){e.mode=dT;break}if(b&32){e.back=-1,e.mode=$r;break}if(b&64){n.msg="invalid literal/length code",e.mode=ln;break}e.extra=b&15,e.mode=cT;case cT:if(e.extra){for(D=e.extra;h>>=e.extra,h-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=hT;case hT:for(;y=e.distcode[c&(1<>>24,b=y>>>16&255,S=y&65535,!(_<=h);){if(o===0)break t;o--,c+=i[r++]<>w)],_=y>>>24,b=y>>>16&255,S=y&65535,!(w+_<=h);){if(o===0)break t;o--,c+=i[r++]<>>=w,h-=w,e.back+=w}if(c>>>=_,h-=_,e.back+=_,b&64){n.msg="invalid distance code",e.mode=ln;break}e.offset=S,e.extra=b&15,e.mode=uT;case uT:if(e.extra){for(D=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=ln;break}e.mode=fT;case fT: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=ln;break}m>e.wnext?(m-=e.wnext,g=e.wsize-m):g=e.wnext-m,m>e.length&&(m=e.length),x=e.window}else x=s,g=a-e.offset,m=e.length;m>l&&(m=l),l-=m,e.length-=m;do s[a++]=x[g++];while(--m);e.length===0&&(e.mode=vm);break;case dT:if(l===0)break t;s[a++]=e.length,l--,e.mode=vm;break;case Tx:if(e.wrap){for(;h<32;){if(o===0)break t;o--,c|=i[r++]<{if(wl(n))return Cs;let t=n.state;return t.window&&(t.window=null),n.state=null,_l},Lq=(n,t)=>{if(wl(n))return Cs;const e=n.state;return e.wrap&2?(e.head=t,t.done=!1,_l):Cs},Dq=(n,t)=>{const e=t.length;let i,s,r;return wl(n)||(i=n.state,i.wrap!==0&&i.mode!==O0)?Cs:i.mode===O0&&(s=1,s=pf(s,t,e,0),s!==i.check)?K3:(r=rP(n,t,e,e),r?(i.mode=Q3,J3):(i.havedict=1,_l))};var Nq=nP,Oq=iP,Fq=eP,Uq=Cq,kq=sP,zq=Pq,Bq=Iq,Hq=Lq,Gq=Dq,Vq="pako inflate (from Nodeca project)",Jr={inflateReset:Nq,inflateReset2:Oq,inflateResetKeep:Fq,inflateInit:Uq,inflateInit2:kq,inflate:zq,inflateEnd:Bq,inflateGetHeader:Hq,inflateSetDictionary:Gq,inflateInfo:Vq};function Wq(){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 jq=Wq;const aP=Object.prototype.toString,{Z_NO_FLUSH:Xq,Z_FINISH:qq,Z_OK:yf,Z_STREAM_END:Px,Z_NEED_DICT:Ix,Z_STREAM_ERROR:Yq,Z_DATA_ERROR:_T,Z_MEM_ERROR:$q}=Yf;function Zf(n){this.options=Pg.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 q3,this.strm.avail_out=0;let e=Jr.inflateInit2(this.strm,t.windowBits);if(e!==yf)throw new Error(ah[e]);if(this.header=new jq,Jr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=gf.string2buf(t.dictionary):aP.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=Jr.inflateSetDictionary(this.strm,t.dictionary),e!==yf)))throw new Error(ah[e])}Zf.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let r,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?qq:Xq,aP.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),r=Jr.inflate(e,a),r===Ix&&s&&(r=Jr.inflateSetDictionary(e,s),r===yf?r=Jr.inflate(e,a):r===_T&&(r=Ix));e.avail_in>0&&r===Px&&e.state.wrap>0&&n[e.next_in]!==0;)Jr.inflateReset(e),r=Jr.inflate(e,a);switch(r){case Yq:case _T:case Ix:case $q:return this.onEnd(r),this.ended=!0,!1}if(o=e.avail_out,e.next_out&&(e.avail_out===0||r===Px))if(this.options.to==="string"){let l=gf.utf8border(e.output,e.next_out),c=e.next_out-l,h=gf.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(!(r===yf&&o===0)){if(r===Px)return r=Jr.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};Zf.prototype.onData=function(n){this.chunks.push(n)};Zf.prototype.onEnd=function(n){n===yf&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Pg.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function EM(n,t){const e=new Zf(t);if(e.push(n),e.err)throw e.msg||ah[e.err];return e.result}function Zq(n,t){return t=t||{},t.raw=!0,EM(n,t)}var Kq=Zf,Jq=EM,Qq=Zq,tY=EM,eY=Yf,nY={Inflate:Kq,inflate:Jq,inflateRaw:Qq,ungzip:tY,constants:eY};const{Inflate:Y$,inflate:iY,inflateRaw:$$,ungzip:Z$}=nY;var K$=iY;const Lx=new WeakMap;class sY extends mi{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,s){const r=new as(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(t,a=>{this.parse(a,e,s)},i,s)}parse(t,e,i=()=>{}){this.decodeDracoFile(t,e,null,null,fn,i).catch(i)}decodeDracoFile(t,e,i,s,r=$n,a=()=>{}){const o={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:r};return this.decodeGeometry(t,o).then(e).catch(a)}decodeGeometry(t,e){const i=JSON.stringify(e);if(Lx.has(t)){const l=Lx.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 s;const r=this.workerNextTaskID++,a=t.byteLength,o=this._getWorker(r,a).then(l=>(s=l,new Promise((c,h)=>{s._callbacks[r]={resolve:c,reject:h},s.postMessage({type:"decode",id:r,taskConfig:e,buffer:t},[t])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{s&&r&&this._releaseTask(s,r)}),Lx.set(t,{key:i,promise:o}),o}_createGeometry(t){const e=new ve;t.index&&e.setIndex(new De(t.index.array,1));for(let i=0;i{i.load(t,s,void 0,r)})}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 s=i[0];t||(this.decoderConfig.wasmBinary=i[1]);const r=rY.toString(),a=["/* draco decoder */",s,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(t,e){return this._initDecoder().then(()=>{if(this.workerPool.lengthr._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(x=>x.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 x={index:null,attributes:[]};for(const y in h){const _=self[u[y]];let b,S;if(c.useUniqueIDs)S=h[y],b=o.GetAttributeByUniqueId(p,S);else{if(S=o.GetAttributeId(p,a[h[y]]),S===-1)continue;b=o.GetAttribute(p,S)}const w=s(a,o,p,y,_,b);y==="color"&&(w.vertexColorSpace=c.vertexColorSpace),x.attributes.push(w)}return g===a.TRIANGULAR_MESH&&(x.index=i(a,o,p)),a.destroy(p),x}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 s(a,o,l,c,h,u){const p=u.num_components(),g=l.num_points()*p,x=g*h.BYTES_PER_ELEMENT,y=r(a,h),_=a._malloc(x);o.GetAttributeDataArrayForAllPoints(l,u,y,x,_);const b=new h(a.HEAPF32.buffer,_,g).slice();return a._free(_),{name:c,array:b,itemSize:p}}function r(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 aY extends mi{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new uY(e)}),this.register(function(e){return new fY(e)}),this.register(function(e){return new MY(e)}),this.register(function(e){return new bY(e)}),this.register(function(e){return new wY(e)}),this.register(function(e){return new pY(e)}),this.register(function(e){return new mY(e)}),this.register(function(e){return new gY(e)}),this.register(function(e){return new yY(e)}),this.register(function(e){return new hY(e)}),this.register(function(e){return new _Y(e)}),this.register(function(e){return new dY(e)}),this.register(function(e){return new vY(e)}),this.register(function(e){return new xY(e)}),this.register(function(e){return new lY(e)}),this.register(function(e){return new SY(e)}),this.register(function(e){return new EY(e)})}load(t,e,i,s){const r=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const c=Ga.extractUrlBase(t);a=Ga.resolveURL(c,this.path)}else a=Ga.extractUrlBase(t);this.manager.itemStart(t);const o=function(c){s?s(c):console.error(c),r.manager.itemError(t),r.manager.itemEnd(t)},l=new as(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(t,function(c){try{r.parse(c,a,function(h){e(h),r.manager.itemEnd(t)},o)}catch(h){o(h)}},i,o)}setDRACOLoader(t){return this.dracoLoader=t,this}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,s){let r;const a={},o={},l=new TextDecoder;if(typeof t=="string")r=JSON.parse(t);else if(t instanceof ArrayBuffer)if(l.decode(new Uint8Array(t,0,4))===oP){try{a[ke.KHR_BINARY_GLTF]=new AY(t)}catch(u){s&&s(u);return}r=JSON.parse(a[ke.KHR_BINARY_GLTF].content)}else r=JSON.parse(l.decode(t));else r=t;if(r.asset===void 0||r.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new zY(r,{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,s)}parseAsync(t,e){const i=this;return new Promise(function(s,r){i.parse(t,e,s,r)})}}function oY(){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 ke={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 lY{constructor(t){this.parser=t,this.name=ke.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,s=e.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,r.source,a)}}class bY{constructor(t){this.parser=t,this.name=ke.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,s=i.json,r=s.textures[t];if(!r.extensions||!r.extensions[e])return null;const a=r.extensions[e],o=s.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(s.extensionsRequired&&s.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 wY{constructor(t){this.parser=t,this.name=ke.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,s=i.json,r=s.textures[t];if(!r.extensions||!r.extensions[e])return null;const a=r.extensions[e],o=s.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(s.extensionsRequired&&s.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 SY{constructor(t){this.name=ke.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 s=i.extensions[this.name],r=this.parser.getDependency("buffer",s.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 r.then(function(o){const l=s.byteOffset||0,c=s.byteLength||0,h=s.count,u=s.byteStride,p=new Uint8Array(o,l,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(h,u,p,s.mode,s.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,s.mode,s.filter),m})})}else return null}}class EY{constructor(t){this.name=ke.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 s=e.meshes[i.mesh];for(const c of s.primitives)if(c.mode!==vs.TRIANGLES&&c.mode!==vs.TRIANGLE_STRIP&&c.mode!==vs.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 x=new ye,y=new O,_=new Cn,b=new O(1,1,1),S=new m1(g.geometry,g.material,p);for(let w=0;w0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":n.search(/\.ktx2($|\?)/i)>0||n.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const kY=new ye;class zY{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new oY,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,s=-1,r=!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+)/);s=i&&l?parseInt(l[1],10):-1,r=o.indexOf("Firefox")>-1,a=r?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&s<17||r&&a<98?this.textureLoader=new I1(this.options.manager):this.textureLoader=new WC(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new as(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,s=this.json,r=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][s.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:s.asset,parser:i,userData:{}};return Fo(r,o,s),Zr(o,s),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 s=0,r=e.length;s{const l=this.associations.get(a);l!=null&&this.associations.set(o,l);for(const[c,h]of a.children.entries())r(h,o.children[c])};return r(i,s),s.name+="_instance_"+t.uses[e]++,s}_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.")}y.normalized=g}return y})}loadTexture(t){const e=this.json,i=this.options,r=e.textures[t].source,a=e.images[r];let o=this.textureLoader;if(a.uri){const l=i.manager.getHandler(a.uri);l!==null&&(o=l)}return this.loadTextureImage(t,r,o)}loadTextureImage(t,e,i){const s=this,r=this.json,a=r.textures[t],o=r.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=(r.samplers||{})[a.sampler]||{};return h.magFilter=vT[p.magFilter]||yn,h.minFilter=vT[p.minFilter]||ws,h.wrapS=MT[p.wrapS]||$a,h.wrapT=MT[p.wrapT]||$a,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==Dn&&h.minFilter!==yn,s.associations.set(h,{textures:t}),h}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(t,e){const i=this,s=this.json,r=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(u=>u.clone());const a=s.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(x){const y=new bn(x);y.needsUpdate=!0,p(y)}),e.load(Ga.resolveURL(u,r.path),g,void 0,m)})}).then(function(u){return c===!0&&o.revokeObjectURL(l),Zr(u,a),u.userData.mimeType=a.mimeType||UY(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,s){const r=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),r.extensions[ke.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[ke.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(a);a=r.extensions[ke.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),r.associations.set(a,l)}}return s!==void 0&&(a.colorSpace=s),t[e]=a,a})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const s=e.attributes.tangent===void 0,r=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 Lf,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 Zn,Rn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(o,l)),i=l}if(s||r||a){let o="ClonedMaterial:"+i.uuid+":";s&&(o+="derivative-tangents:"),r&&(o+="vertex-colors:"),a&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=i.clone(),r&&(l.vertexColors=!0),a&&(l.flatShading=!0),s&&(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 dh}loadMaterial(t){const e=this,i=this.json,s=this.extensions,r=i.materials[t];let a;const o={},l=r.extensions||{},c=[];if(l[ke.KHR_MATERIALS_UNLIT]){const u=s[ke.KHR_MATERIALS_UNLIT];a=u.getMaterialType(),c.push(u.extendParams(o,r,e))}else{const u=r.pbrMetallicRoughness||{};if(o.color=new kt(1,1,1),o.opacity=1,Array.isArray(u.baseColorFactor)){const p=u.baseColorFactor;o.color.setRGB(p[0],p[1],p[2],$n),o.opacity=p[3]}u.baseColorTexture!==void 0&&c.push(e.assignTexture(o,"map",u.baseColorTexture,fn)),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)})))}r.doubleSided===!0&&(o.side=fi);const h=r.alphaMode||Nx.OPAQUE;if(h===Nx.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,h===Nx.MASK&&(o.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&a!==ns&&(c.push(e.assignTexture(o,"normalMap",r.normalTexture)),o.normalScale=new xt(1,1),r.normalTexture.scale!==void 0)){const u=r.normalTexture.scale;o.normalScale.set(u,u)}if(r.occlusionTexture!==void 0&&a!==ns&&(c.push(e.assignTexture(o,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&a!==ns){const u=r.emissiveFactor;o.emissive=new kt().setRGB(u[0],u[1],u[2],$n)}return r.emissiveTexture!==void 0&&a!==ns&&c.push(e.assignTexture(o,"emissiveMap",r.emissiveTexture,fn)),Promise.all(c).then(function(){const u=new a(o);return r.name&&(u.name=r.name),Zr(u,r),e.associations.set(u,{materials:t}),r.extensions&&Fo(s,u,r),u})}createUniqueName(t){const e=He.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,s=this.primitiveCache;function r(o){return i[ke.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,e).then(function(l){return bT(l,o,e)})}const a=[];for(let o=0,l=t.length;o0&&OY(_,r),_.name=e.createUniqueName(r.name||"mesh_"+t),Zr(_,r),y.extensions&&Fo(s,_,y),e.assignFinalMaterial(_),u.push(_)}for(let m=0,g=u.length;m1?h=new na:c.length===1?h=c[0]:h=new qe,h!==c[0])for(let u=0,p=c.length;u{const u=new Map;for(const[p,m]of s.associations)(p instanceof Rn||p instanceof bn)&&u.set(p,m);return h.traverse(p=>{const m=s.associations.get(p);m!=null&&u.set(p,m)}),u};return s.associations=c(r),r})}_createAnimationTracks(t,e,i,s,r){const a=[],o=t.name?t.name:t.uuid,l=[];Ua[r.path]===Ua.weights?t.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(o);let c;switch(Ua[r.path]){case Ua.weights:c=fl;break;case Ua.rotation:c=dl;break;case Ua.position:case Ua.scale:c=pl;break;default:switch(i.itemSize){case 1:c=fl;break;case 2:case 3:default:c=pl;break}break}const h=s.interpolation!==void 0?LY[s.interpolation]:Kc,u=this._getArrayFromAccessor(i);for(let p=0,m=l.length;pWY(s));return(await Promise.all(e)).flat()}async function WY(n){const{tile:t,center:e}=n,i=`https://maps.heidler.info/germany-draco/15-${t.x}-${t.y}.glb`;try{const s=await hP.loadAsync(i);let r=[];for(let l of s.scenes)for(let c of l.children){let h=c.geometry;const u=new ye;u.makeScale(1/8192,1/8192,1);const p=new ye;p.makeTranslation(t.x-e.x,t.y-e.y,0);const m=new ye;m.makeScale(wT(),-wT(),1);const g=m;g.multiply(p),g.multiply(u),h.applyMatrix4(g),h=h.toNonIndexed();let x={};const y=h.attributes.position.array,_=h.attributes.normal.array,b=h.attributes._feature_id_0.array;for(let S=0;Sp.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 XY(n){return!n||!n.bbox||!n.data?(console.error("Invalid heightmap data, missing bbox or data"),null):{...n,data:new Float32Array(n.data)}}function qY(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 s={surrounding:[],background:[]};n.bbox;const[r,a]=km,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),x=n.bbox[3]+(n.bbox[1]-n.bbox[3])*(u/n.height),y=(g-r)*F0(),_=(x-a)*F0();p%100+u%100==0&&console.log(y,_);const b=(y-c)*(y-c)+(_-h)*(_-h);if(b<=l){const S=YY(y,_,m);b<=o?s.surrounding.push(S):s.background.push(S)}}}return console.log("Vegetation processing complete."),console.log("Surrounding geometries:",s.surrounding.length),console.log("Background geometries:",s.background.length),s}function YY(n,t,e){const r=new io(1,1,20).toNonIndexed().deleteAttribute("uv");return r.translate(n,t,e-10),r}const fP=[0,0,.2],dP=[1,.2,.1],pP=[1,1,.1];async function $Y(n){if(window.setAttribution)for(let t of Object.values(window.setAttribution))t(!1);if(typeof n<"u"&&n!=null){let r=function(l,c){return window.setSimulationProgress(l*100/c)};const t=await VY(n);let e=uP(t,new O(0,0,0),80);if(window.setGeometries(e),e.simulation.length==0)return window.setFrontendState("ErrorAdress"),{simulationMesh:void 0};const i=new i3(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(uM.interpolateThreeColors({c0:fP,c1:dP,c2:pP})),HY()=="BY"){const[l,c]=km;console.log("coordinatesWebMercator:"+km);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 jY(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=XY(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=qY(m,new O(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(x=>{i.addShadingGeometry(x)}),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 s=window.numSimulations||80;const a=await i.calculate({numberSimulations:s,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:r});let o=new O;return a.geometry.computeBoundingBox(),a.geometry.boundingBox.getCenter(o),a.middle=o,{simulationMesh:a}}}async function ZY(n){let t=ER(n.selectedMesh.map(m=>m.geometry));t.computeBoundingBox(),t.computeBoundingSphere();let e=new O;t.boundingBox.getCenter(e),console.log(n.geometries);const i=t.boundingSphere.radius+80,s=[...n.geometries.surrounding,...n.geometries.background,...n.geometries.simulation],r=uP(s,e,i),a=new i3(parseFloat(n.geoLocation.lat),parseFloat(n.geoLocation.lon));a.addColorMap(uM.interpolateThreeColors({c0:fP,c1:dP,c2:pP})),a.addSimulationGeometry(t),r.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 ph({vertexColors:!0,side:fi});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([])}const KY=({selectedMesh:n,setSelectedMesh:t,simulationMeshes:e,setSimulationMeshes:i,geometries:s,geoLocation:r})=>{const{isOpen:a,onClose:o,onOpen:l}=sl(),[c,h]=J.useState(!1),{t:u}=Qa();J.useEffect(()=>{n.length>0&&l()},[n]);const p=()=>{o(),t([])};if(!a)return null;const m=async()=>{h(!0);try{await ZY({selectedMesh:n,setSelectedMesh:t,simulationMeshes:e,setSimulationMeshes:i,geometries:s,geoLocation:r})}finally{h(!1),o()}};return V.jsx(ca,{position:"fixed",bottom:4,left:"50%",transform:"translateX(-50%)",width:"300px",zIndex:9999,children:V.jsxs(TT,{alignItems:"start",boxShadow:"md",rounded:"md",colorScheme:"gray",children:[V.jsx(ca,{width:"100%",children:V.jsx($v,{spacing:2,justify:"start",children:V.jsx(yr,{isLoading:c,colorScheme:"teal",onClick:m,children:u("button.simulateBuilding")})})}),V.jsx(CT,{position:"absolute",right:1,top:1,onClick:p})]})})};function JY({selectedPVSystem:n,setSelectedPVSystem:t,onCloseAlert:e}){const{isOpen:i,onOpen:s,onClose:r}=sl({defaultIsOpen:!1}),{isOpen:a,onToggle:o}=sl({defaultIsOpen:!1}),{t:l}=Qa(),[c,h]=J.useState("3000"),[u,p]=J.useState("0"),[m,g]=J.useState("30"),[x,y]=J.useState(0),[_,b]=J.useState(0),S=L=>L.replace(",","."),w=L=>P=>{const E=P.target.value;(E===""||/^[0-9]*[.,]?[0-9]*$/.test(E))&&L(E)};let R;n.length>0&&(R=Math.round(n.reduce((L,P)=>L+P.annualYield,0)));async function T(){async function L({pvProduction:P,consumptionHousehold:E,storageCapacity:D,electricityPrice:z,setSelfConsumption:G,setAnnualSavings:W}){const Y=await(await fetch("https://www.openpv.de/data/savings_calculation/cons_prod.json")).json(),ot=Y.Consumption,H=Y.Production,Z={};let it=0;for(const lt in ot){const _t=ot[lt]*E/1e3,q=H[lt]*P/1e3;let rt=0,St=0;if(q>_t){rt=_t,St=q-_t;const dt=D-it,It=Math.min(St,dt);it+=It}else{const dt=_t-q,It=Math.min(dt,it);it-=It,rt=q+It}Z[lt]=rt}let $=Object.values(Z).reduce((lt,_t)=>lt+_t,0);G(Math.round($)),W(Math.round($*z/100))}await L({pvProduction:R,consumptionHousehold:parseFloat(S(c)),storageCapacity:parseFloat(S(u)),electricityPrice:parseFloat(S(m)),setSelfConsumption:y,setAnnualSavings:b})}const C=z0.useRef(null);return V.jsxs(V.Fragment,{children:[n.length>0&&V.jsx(yr,{colorScheme:"teal",onClick:()=>{s()},children:l("savingsCalculation.button")}),V.jsxs(Fv,{isOpen:i,onClose:()=>{r(),e(),t([])},size:"xl",children:[V.jsx(Uv,{}),V.jsxs(RT,{children:[V.jsx(kv,{children:l("savingsCalculation.button")}),V.jsx(zv,{}),V.jsx(Bv,{children:V.jsxs(V.Fragment,{children:[V.jsxs(Gy,{children:[V.jsxs(vu,{children:[l("savingsCalculation.consumptionTitle"),V.jsx(Sf,{label:l("savingsCalculation.consumptionHelperInfo"),children:V.jsx(Bo,{color:"teal",fontSize:"xs",children:l("savingsCalculation.consumptionHelperLabel")})})]}),V.jsx(Vy,{ref:C,value:c,onChange:w(h)})]}),V.jsx("br",{}),V.jsxs(Gy,{children:[V.jsx(vu,{children:l("savingsCalculation.storageTitle")}),V.jsx(Vy,{value:u,onChange:w(p)})]}),V.jsx("br",{}),V.jsxs(Gy,{children:[V.jsx(vu,{children:l("savingsCalculation.electricityPriceTitle")}),V.jsx(Vy,{placeholder:l("savingsCalculation.electricityPricePlaceholder"),value:m,onChange:w(g)})]}),V.jsx(zT,{in:a,animateOpacity:!0,children:V.jsxs(ca,{p:"40px",color:"white",mt:"4",bg:"teal",rounded:"md",shadow:"md",children:[V.jsx(Bo,{children:l("savingsCalculation.disclaimer")}),V.jsxs(PT,{children:[V.jsxs(Go,{children:[l("savingsCalculation.results.production"),V.jsxs(Bo,{as:"b",color:"white",children:[R," kWh"]})]}),V.jsxs(Go,{children:[l("savingsCalculation.results.consumption"),V.jsxs(Bo,{as:"b",color:"white",children:[x," kWh"]})]}),V.jsxs(Go,{children:[l("savingsCalculation.results.savings"),V.jsxs(Bo,{as:"b",color:"white",children:[_,"€"]})]})]})]})}),V.jsx("br",{})]})}),V.jsx(TI,{children:V.jsx(yr,{mr:3,onClick:()=>{T(),a||o()},children:l("savingsCalculation.calculate")})})]})]})]})}const QY=({selectedPVSystem:n,setSelectedPVSystem:t,setPVSystems:e})=>{const{isOpen:i,onClose:s,onOpen:r}=sl(),{t:a}=Qa();J.useEffect(()=>{n.length>0&&r()},[n]);const o=()=>{s(),t([])};return i?V.jsx(ca,{position:"fixed",bottom:4,left:"50%",transform:"translateX(-50%)",width:"300px",zIndex:9999,children:V.jsxs(TT,{alignItems:"start",boxShadow:"md",rounded:"md",colorScheme:"gray",children:[V.jsxs(ca,{width:"100%",children:[V.jsx(uI,{display:"block",mb:2,children:a("savingsCalculation.notificationLabel")}),V.jsxs($v,{spacing:2,justify:"start",children:[V.jsx(JY,{selectedPVSystem:n,setSelectedPVSystem:t,onCloseAlert:s}),V.jsx(yr,{colorScheme:"teal",onClick:()=>{e([]),t([]),s()},children:a("delete")})]})]}),V.jsx(CT,{position:"absolute",right:1,top:1,onClick:o})]})}):null};function t$({frontendState:n,setFrontendState:t,showTerrain:e,setShowTerrain:i,selectedMesh:s,setSelectedMesh:r,selectedPVSystem:a,setSelectedPVSystem:o,geometries:l,geoLocation:c,pvSystems:h,setPVSystems:u,pvPoints:p,setPVPoints:m,simulationMeshes:g,setSimulationMeshes:x}){const{isOpen:y,onOpen:_,onClose:b}=sl(),{isOpen:S,onOpen:w,onClose:R}=sl(),{t:T}=Qa(),C=z0.useRef(),L=()=>{k6({setPVSystems:u,setSelectedPVSystem:o,pvPoints:p,setPVPoints:m,simulationMeshes:g}),t("Results")},P=()=>{t("Results")};return V.jsxs(V.Fragment,{children:[V.jsxs(e$,{children:[V.jsx(QY,{selectedPVSystem:a,setSelectedPVSystem:o,setPVSystems:u}),V.jsx(KY,{selectedMesh:s,setSelectedMesh:r,simulationMeshes:g,setSimulationMeshes:x,geometries:l,geoLocation:c}),n=="Results"&&V.jsx(V.Fragment,{children:V.jsx(yr,{ref:C,colorScheme:"teal",onClick:_,variant:"link",zIndex:100,children:T("button.options")})}),V.jsx(yr,{onClick:w,colorScheme:"teal",variant:"link",children:T("mapControlHelp.button")}),V.jsx(s$,{isOpen:S,onClose:R}),V.jsx(i$,{isOpen:y,onClose:b,showTerrain:e,setShowTerrain:i})]}),V.jsxs(n$,{children:[n=="Results"&&V.jsx(J6,{buttonLabel:T("button.drawPVSystem"),onClick:()=>{t("DrawPV"),b()},className:h.length==0?"button-high-prio":"",hoverText:T("button.drawPVSystemHover")}),n=="DrawPV"&&V.jsxs(V.Fragment,{children:[p.length>0&&V.jsxs(V.Fragment,{children:[V.jsx(yr,{className:"button-high-prio",onClick:L,children:T("button.createPVSystem")}),V.jsx(yr,{onClick:()=>{m(p.slice(0,-1))},children:T("button.deleteLastPoint")})]}),V.jsx(yr,{onClick:P,children:T("button.cancel")})]})]})]})}const e$=({children:n})=>V.jsx(V.Fragment,{children:V.jsx(ca,{display:"flex",flexDirection:"row",justifyContent:"flex-start",pointerEvents:"none",zIndex:100,minWidth:0,minHeight:0,overflow:"hidden",sx:{"> *":{pointerEvents:"auto"}},children:V.jsx(ca,{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})})}),n$=({children:n})=>V.jsx(V.Fragment,{children:V.jsx(ca,{display:"flex",flexDirection:"column",justifyContent:"space-between",pointerEvents:"none",zIndex:100,minWidth:0,minHeight:0,overflow:"hidden",sx:{"> *":{pointerEvents:"auto"}},children:V.jsx(ca,{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})})}),i$=({isOpen:n,onClose:t,showTerrain:e,setShowTerrain:i})=>{const{t:s}=Qa(),[r,a]=z0.useState(window.numSimulations);return V.jsx(PI,{spacing:"24px",children:V.jsxs(QD,{isOpen:n,placement:"left",onClose:t,size:"xs",children:[V.jsx(Uv,{}),V.jsxs(KT,{height:"100%",children:[V.jsx(zv,{}),V.jsx(kv,{children:s("button.options")}),V.jsx(Bv,{children:V.jsxs(V.Fragment,{children:[V.jsx(Bo,{as:"b",children:s("sidebar.header")}),V.jsx(Bo,{children:s("sidebar.mainText")}),V.jsxs(vu,{children:[s("button.showMap"),V.jsx(i2,{isChecked:e,onChange:()=>i(o=>!o),colorScheme:"teal",margin:"5px"})]}),V.jsx(t8,{sliderProps:{min:1,max:200},label:s("sidebar.numberSimulations"),hoverHelpLabel:s("sidebar.numberSimulationsHover"),sliderValue:r,setSliderValue:o=>{a(o),window.numSimulations=o}})]})})]})]})})},s$=({isOpen:n,onClose:t})=>{const{t:e}=Qa(),i=window.isTouchDevice?"touch.":"";return V.jsxs(Fv,{isOpen:n,onClose:t,children:[V.jsx(Uv,{}),V.jsxs(RT,{children:[V.jsx(kv,{children:e("mapControlHelp.title")}),V.jsx(zv,{}),V.jsx(Bv,{children:V.jsxs(PT,{children:[V.jsx(Go,{children:e(`mapControlHelp.${i}leftMouse`)}),V.jsx(Go,{children:e(`mapControlHelp.${i}rightMouse`)}),V.jsx(Go,{children:e(`mapControlHelp.${i}wheel`)}),V.jsx(Go,{children:e(`mapControlHelp.${i}doubleClick`)})]})})]})]})},r$=({points:n})=>{const t=J.useMemo(()=>{const e=n.map((o,l)=>{const c=new ve().setFromPoints([o.point]),h=new Lf({color:"#333333",size:10,sizeAttenuation:!1});return V.jsx("points",{geometry:c,material:h},`point-${l}`)}),i=new ve,s=[];for(let o=0;o{const t=n.zoom,e=n.x,i=n.y,s=n.divisions,r=`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]=J.useState(null),[l,c]=J.useState(null),[h,u]=J.useState(!1),p=V.jsx(V.Fragment,{children:h&&V.jsx("mesh",{geometry:a,material:l})});return J.useEffect(()=>{async function m(){const g=new I1().loadAsync(r),[x,y,_,b]=RI(e,i,t);let S=[],w=[],R=[],T=0;const C=s+1;for(let W=0;W<=s;W++)for(let Q=0;Q<=s;Q++){const Y=x+Q/s*(_-x),ot=y+W/s*(b-y);S.push(Iv.toPoint3D(Y,ot)),w=w.concat([Q/s,1-W/s]),Q>0&&W>0&&(R=R.concat([T-C-1,T-1,T-C,T-C,T-1,T])),T+=1}S=await Promise.all(S);const L=new Float32Array(S.flatMap(W=>W.point)),P=new Float32Array(S.flatMap(W=>W.normal)),E=new Float32Array(w),D=new Uint32Array(R),z=new ve;z.setAttribute("position",new De(L,3)),z.setAttribute("normal",new De(P,3)),z.setAttribute("uv",new De(E,2)),z.setIndex(new De(D,1)),o(z);const G=await g;G.colorSpace=fn,c(new ph({flatShading:!1,map:await g,side:js})),u(!0)}m()},[]),p},o$=({visible:n})=>{const[t,e]=CI,[i,s]=J.useState([]),r=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)),J.useEffect(()=>{let l=[];const c=h=>{if(hc(h+1),0)}};return c(0),()=>{s([])}},[r,a]),V.jsx("group",{visible:n,children:i})},l$=({frontendState:n,setFrontendState:t,geometries:e,simulationMeshes:i,setSimulationMeshes:s,vegetationGeometries:r,geoLocation:a})=>{const[o,l]=J.useState(!0),[c,h]=J.useState([]),[u,p]=J.useState([]),[m,g]=J.useState([]),[x,y]=J.useState([]);window.setPVPoints=p;const _=[i[0].middle.x,i[0].middle.y-40,i[0].middle.z+80],b=J.useRef();return V.jsxs(V.Fragment,{children:[V.jsx(t$,{frontendState:n,setFrontendState:t,showTerrain:o,setShowTerrain:l,selectedMesh:m,setSelectedMesh:g,geometries:e,geoLocation:a,setPVSystems:h,pvSystems:c,selectedPVSystem:x,setSelectedPVSystem:y,pvPoints:u,setPVPoints:p,simulationMeshes:i,setSimulationMeshes:s}),V.jsxs(f6,{camera:{fov:45,near:1,far:2e4,position:_,up:[0,0,1],ref:b},children:[V.jsx("ambientLight",{intensity:2}),V.jsx("directionalLight",{intensity:1,position:[0,-1,-2]}),V.jsx("directionalLight",{intensity:.5,position:[1,0,-2]}),V.jsx("directionalLight",{intensity:.5,position:[-1,0,-2]}),e.surrounding.length>0&&V.jsx(SE,{geometries:e.surrounding}),e.background.length>0&&V.jsx(SE,{geometries:e.background}),i.length>0&&V.jsx(K6,{meshes:i}),m&&V.jsx(O6,{meshes:m}),x&&V.jsx(N6,{geometries:x}),i.length>0&&n=="Results"&&V.jsx(_6,{middle:i[0].middle,setSelectedMesh:g,setSelectedPVSystem:y}),n=="DrawPV"&&V.jsx(D6,{middle:i[0].middle,setPVPoints:p}),n=="DrawPV"&&V.jsx(r$,{points:u}),c.length>0&&V.jsx(U6,{pvSystems:c}),r&&V.jsxs(V.Fragment,{children:[r.background&&r.background.length>0&&V.jsx(AE,{geometries:r.background}),r.surrounding&&r.surrounding.length>0&&V.jsx(AE,{geometries:r.surrounding})]}),i.length>0&&V.jsx(o$,{visible:o})]})]})};function c$(){const n=fI(),[t,e]=J.useState("Loading"),[i,s]=J.useState(0),[r,a]=J.useState(!1);window.setFederalState=a;const[o,l]=J.useState({simulation:[],surrounding:[],background:[]}),[c,h]=J.useState([]);window.setGeometries=l,window.setFrontendState=e,window.setSimulationProgress=s;const[u,p]=J.useState([]);window.setVegetationGeometries=p;const m=async()=>{const{simulationMesh:g}=await $Y(n);g&&(h([...c,g]),e("Results"))};return J.useEffect(()=>{m()},[]),V.jsx(dI,{description:"Berechne das Potential deiner Solaranlage.",children:V.jsxs("div",{className:"content",children:[t=="ErrorAdress"&&V.jsx(MN,{}),(t=="Results"||t=="DrawPV")&&V.jsx(l$,{frontendState:t,setFrontendState:e,geometries:o,simulationMeshes:c,setSimulationMeshes:h,vegetationGeometries:u,geoLocation:n}),t=="Loading"&&V.jsx(bN,{progress:i}),V.jsx(bI,{federalState:r,frontendState:t})]})})}const J$=Object.freeze(Object.defineProperty({__proto__:null,default:c$},Symbol.toStringTag,{value:"Module"}));export{X$ as L,J$ as S,q$ as a,K$ as i}; diff --git a/assets/deflate-BY1gll4A.js b/assets/deflate-BY1gll4A.js deleted file mode 100644 index 5e32b5b..0000000 --- a/assets/deflate-BY1gll4A.js +++ /dev/null @@ -1 +0,0 @@ -import{i as r}from"./Simulation-x5IYgVeF.js";import{B as o}from"./basedecoder-DvumDe3Y.js";import"./index-CtCGTwpN.js";import"./heading-eSNaMiYV.js";import"./Footer-BC_OGLFm.js";import"./location-Bzn15Ms3.js";import"./stack-DvvG7f8C.js";class c extends o{decodeBlock(e){return r(new Uint8Array(e)).buffer}}export{c as default}; diff --git a/assets/deflate-DVinku8x.js b/assets/deflate-DVinku8x.js new file mode 100644 index 0000000..25af2a0 --- /dev/null +++ b/assets/deflate-DVinku8x.js @@ -0,0 +1 @@ +import{i as r}from"./Simulation-Bjnv8os2.js";import{B as o}from"./basedecoder-DvumDe3Y.js";import"./index-DZP_WaxS.js";import"./heading-D46BZoGw.js";import"./Footer-C3QM0Uoc.js";import"./location-BMuwxVaI.js";import"./stack-D-KFs-Nt.js";class c extends o{decodeBlock(e){return r(new Uint8Array(e)).buffer}}export{c as default}; diff --git a/assets/heading-eSNaMiYV.js b/assets/heading-D46BZoGw.js similarity index 93% rename from assets/heading-eSNaMiYV.js rename to assets/heading-D46BZoGw.js index cc3fb55..4d00512 100644 --- a/assets/heading-eSNaMiYV.js +++ b/assets/heading-D46BZoGw.js @@ -1 +1 @@ -import{a4 as h,f as c,x as m,D as x,j as n,c as d,l as i,w as _}from"./index-CtCGTwpN.js";const[g,u]=h("Card"),H=c(function(s,a){const{className:e,children:r,direction:t="column",justify:y,align:C,...f}=m(s),l=x("Card",s);return n.jsx(d.div,{ref:a,className:i("chakra-card",e),__css:{display:"flex",flexDirection:t,justifyContent:y,alignItems:C,position:"relative",minWidth:0,wordWrap:"break-word",...l.container},...f,children:n.jsx(g,{value:l,children:r})})}),k=c(function(s,a){const{className:e,...r}=s,t=u();return n.jsx(d.div,{ref:a,className:i("chakra-card__body",e),__css:t.body,...r})}),v=c(function(s,a){const{className:e,...r}=s,t=u();return n.jsx(d.div,{ref:a,className:i("chakra-card__header",e),__css:t.header,...r})}),N=c(function(s,a){const e=_("Heading",s),{className:r,...t}=m(s);return n.jsx(d.h2,{ref:a,className:i("chakra-heading",s.className),...t,__css:e})});N.displayName="Heading";export{H as C,N as H,v as a,k as b}; +import{a4 as h,f as c,x as m,D as x,j as n,c as d,l as i,w as _}from"./index-DZP_WaxS.js";const[g,u]=h("Card"),H=c(function(s,a){const{className:e,children:r,direction:t="column",justify:y,align:C,...f}=m(s),l=x("Card",s);return n.jsx(d.div,{ref:a,className:i("chakra-card",e),__css:{display:"flex",flexDirection:t,justifyContent:y,alignItems:C,position:"relative",minWidth:0,wordWrap:"break-word",...l.container},...f,children:n.jsx(g,{value:l,children:r})})}),k=c(function(s,a){const{className:e,...r}=s,t=u();return n.jsx(d.div,{ref:a,className:i("chakra-card__body",e),__css:t.body,...r})}),v=c(function(s,a){const{className:e,...r}=s,t=u();return n.jsx(d.div,{ref:a,className:i("chakra-card__header",e),__css:t.header,...r})}),N=c(function(s,a){const e=_("Heading",s),{className:r,...t}=m(s);return n.jsx(d.h2,{ref:a,className:i("chakra-heading",s.className),...t,__css:e})});N.displayName="Heading";export{H as C,N as H,v as a,k as b}; diff --git a/assets/image-jfUXVBUx.js b/assets/image-x7XY6IFe.js similarity index 91% rename from assets/image-jfUXVBUx.js rename to assets/image-x7XY6IFe.js index d4135b8..5969d98 100644 --- a/assets/image-jfUXVBUx.js +++ b/assets/image-x7XY6IFe.js @@ -1 +1 @@ -import{d as b,n as N,f as v,j as k,o as S,c as j}from"./index-CtCGTwpN.js";function w(c){const{loading:e,src:o,srcSet:s,onLoad:r,onError:t,crossOrigin:i,sizes:g,ignoreFallback:f}=c,[l,u]=b.useState("pending");b.useEffect(()=>{u(o?"loading":"pending")},[o]);const n=b.useRef(),h=b.useCallback(()=>{if(!o)return;d();const a=new Image;a.src=o,i&&(a.crossOrigin=i),s&&(a.srcset=s),g&&(a.sizes=g),e&&(a.loading=e),a.onload=m=>{d(),u("loaded"),r==null||r(m)},a.onerror=m=>{d(),u("failed"),t==null||t(m)},n.current=a},[o,i,s,g,r,t,e]),d=()=>{n.current&&(n.current.onload=null,n.current.onerror=null,n.current=null)};return N(()=>{if(!f)return l==="loading"&&h(),()=>{d()}},[l,h,f]),f?"loaded":l}const O=(c,e)=>c!=="loaded"&&e==="beforeLoadOrError"||c==="failed"&&e==="onError",I=v(function(e,o){const{htmlWidth:s,htmlHeight:r,alt:t,...i}=e;return k.jsx("img",{width:s,height:r,ref:o,alt:t,...i})});I.displayName="NativeImage";const y=v(function(e,o){const{fallbackSrc:s,fallback:r,src:t,srcSet:i,align:g,fit:f,loading:l,ignoreFallback:u,crossOrigin:n,fallbackStrategy:h="beforeLoadOrError",referrerPolicy:d,...a}=e,m=s!==void 0||r!==void 0,p=l!=null||u||!m,x=w({...e,crossOrigin:n,ignoreFallback:p}),E=O(x,h),F={ref:o,objectFit:f,objectPosition:g,...p?a:S(a,["onError","onLoad"])};return E?r||k.jsx(j.img,{as:I,className:"chakra-image__placeholder",src:s,...F}):k.jsx(j.img,{as:I,src:t,srcSet:i,crossOrigin:n,loading:l,referrerPolicy:d,className:"chakra-image",...F})});y.displayName="Image";export{y as I}; +import{d as b,n as N,f as v,j as k,o as S,c as j}from"./index-DZP_WaxS.js";function w(c){const{loading:e,src:o,srcSet:s,onLoad:r,onError:t,crossOrigin:i,sizes:g,ignoreFallback:f}=c,[l,u]=b.useState("pending");b.useEffect(()=>{u(o?"loading":"pending")},[o]);const n=b.useRef(),h=b.useCallback(()=>{if(!o)return;d();const a=new Image;a.src=o,i&&(a.crossOrigin=i),s&&(a.srcset=s),g&&(a.sizes=g),e&&(a.loading=e),a.onload=m=>{d(),u("loaded"),r==null||r(m)},a.onerror=m=>{d(),u("failed"),t==null||t(m)},n.current=a},[o,i,s,g,r,t,e]),d=()=>{n.current&&(n.current.onload=null,n.current.onerror=null,n.current=null)};return N(()=>{if(!f)return l==="loading"&&h(),()=>{d()}},[l,h,f]),f?"loaded":l}const O=(c,e)=>c!=="loaded"&&e==="beforeLoadOrError"||c==="failed"&&e==="onError",I=v(function(e,o){const{htmlWidth:s,htmlHeight:r,alt:t,...i}=e;return k.jsx("img",{width:s,height:r,ref:o,alt:t,...i})});I.displayName="NativeImage";const y=v(function(e,o){const{fallbackSrc:s,fallback:r,src:t,srcSet:i,align:g,fit:f,loading:l,ignoreFallback:u,crossOrigin:n,fallbackStrategy:h="beforeLoadOrError",referrerPolicy:d,...a}=e,m=s!==void 0||r!==void 0,p=l!=null||u||!m,x=w({...e,crossOrigin:n,ignoreFallback:p}),E=O(x,h),F={ref:o,objectFit:f,objectPosition:g,...p?a:S(a,["onError","onLoad"])};return E?r||k.jsx(j.img,{as:I,className:"chakra-image__placeholder",src:s,...F}):k.jsx(j.img,{as:I,src:t,srcSet:i,crossOrigin:n,loading:l,referrerPolicy:d,className:"chakra-image",...F})});y.displayName="Image";export{y as I}; diff --git a/assets/index-CtCGTwpN.js b/assets/index-CtCGTwpN.js deleted file mode 100644 index b5196d5..0000000 --- a/assets/index-CtCGTwpN.js +++ /dev/null @@ -1,377 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Map-CC9rkVA0.js","assets/Footer-BC_OGLFm.js","assets/location-Bzn15Ms3.js","assets/image-jfUXVBUx.js","assets/Map-k4G4I0uA.css","assets/Simulation-x5IYgVeF.js","assets/heading-eSNaMiYV.js","assets/stack-DvvG7f8C.js","assets/Impressum-DBV6waNB.js","assets/Datenschutz-BRFAolcR.js","assets/About--s9Eeedt.js"])))=>i.map(i=>d[i]); -var WC=Object.defineProperty;var HC=(e,t,n)=>t in e?WC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var gn=(e,t,n)=>HC(e,typeof t!="symbol"?t+"":t,n);function Jv(e,t){for(var n=0;nr[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"]'))r(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"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(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 r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const KC="modulepreload",GC=function(e){return"/"+e},Um={},lo=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=GC(l),l in Um)return;Um[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":KC,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};var wn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ei(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var e1={exports:{}},mu={},t1={exports:{}},G={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Gs=Symbol.for("react.element"),qC=Symbol.for("react.portal"),XC=Symbol.for("react.fragment"),YC=Symbol.for("react.strict_mode"),QC=Symbol.for("react.profiler"),ZC=Symbol.for("react.provider"),JC=Symbol.for("react.context"),eT=Symbol.for("react.forward_ref"),tT=Symbol.for("react.suspense"),nT=Symbol.for("react.memo"),rT=Symbol.for("react.lazy"),Wm=Symbol.iterator;function iT(e){return e===null||typeof e!="object"?null:(e=Wm&&e[Wm]||e["@@iterator"],typeof e=="function"?e:null)}var n1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},r1=Object.assign,i1={};function uo(e,t,n){this.props=e,this.context=t,this.refs=i1,this.updater=n||n1}uo.prototype.isReactComponent={};uo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};uo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function o1(){}o1.prototype=uo.prototype;function kh(e,t,n){this.props=e,this.context=t,this.refs=i1,this.updater=n||n1}var Ch=kh.prototype=new o1;Ch.constructor=kh;r1(Ch,uo.prototype);Ch.isPureReactComponent=!0;var Hm=Array.isArray,s1=Object.prototype.hasOwnProperty,Th={current:null},a1={key:!0,ref:!0,__self:!0,__source:!0};function l1(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)s1.call(t,r)&&!a1.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1e?"":void 0,XF=e=>e?!0:void 0;function bT(e){return Array.isArray(e)}function Ht(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!bT(e)}function ST(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function xT(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function zd(e){if(e==null)return e;const{unitless:t}=xT(e);return t||typeof e=="number"?`${e}px`:e}const d1=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,Eh=e=>Object.fromEntries(Object.entries(e).sort(d1));function Gm(e){const t=Eh(e);return Object.assign(Object.values(t),t)}function wT(e){const t=Object.keys(Eh(e));return new Set(t)}function qm(e){if(!e)return e;e=zd(e)??e;const t=-.02;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function Do(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${zd(e)})`),t&&n.push("and",`(max-width: ${zd(t)})`),n.join(" ")}function kT(e){if(!e)return null;e.base=e.base??"0px";const t=Gm(e),n=Object.entries(e).sort(d1).map(([o,s],a,l)=>{let[,u]=l[a+1]??[];return u=parseFloat(u)>0?qm(u):void 0,{_minW:qm(s),breakpoint:o,minW:s,maxW:u,maxWQuery:Do(null,u),minWQuery:Do(s),minMaxQuery:Do(s,u)}}),r=wT(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(o){const s=Object.keys(o);return s.length>0&&s.every(a=>r.has(a))},asObject:Eh(e),asArray:Gm(e),details:n,get(o){return n.find(s=>s.breakpoint===o)},media:[null,...t.map(o=>Do(o)).slice(1)],toArrayValue(o){if(!Ht(o))throw new Error("toArrayValue: value must be an object");const s=i.map(a=>o[a]??null);for(;ST(s)===null;)s.pop();return s},toObjectValue(o){if(!Array.isArray(o))throw new Error("toObjectValue: value must be an array");return o.reduce((s,a,l)=>{const u=i[l];return u!=null&&a!=null&&(s[u]=a),s},{})}}}function Id(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function f1(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function CT(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Xt(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o,defaultValue:s}=e,a=x.createContext(s);a.displayName=t;function l(){var c;const u=x.useContext(a);if(!u&&n){const d=new Error(o??CT(r,i));throw d.name="ContextError",(c=Error.captureStackTrace)==null||c.call(Error,d,l),d}return u}return[a.Provider,l,a]}const Nn=(...e)=>e.filter(Boolean).join(" ");function TT(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,s)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(i))return a.get(i);const l=e(r,i,o,s);return a.set(i,l),l}},h1=PT(TT),ET=e=>e.default||e;function p1(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function _T(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}const $T=e=>typeof e=="function";function sn(e,...t){return $T(e)?e(...t):e}function RT(e,...t){const n=Object.getOwnPropertyDescriptors(e),r=Object.keys(n),i=s=>{const a={};for(let l=0;li(Array.isArray(s)?s:r.filter(s));return t.map(o).concat(i(r))}function Xm(e,t,n={}){const{stop:r,getKey:i}=n;function o(s,a=[]){if(Ht(s)||Array.isArray(s)){const l={};for(const[u,c]of Object.entries(s)){const d=(i==null?void 0:i(u))??u,f=[...a,d];if(r!=null&&r(s,f))return t(s,a);l[d]=o(c,f)}return l}return t(s,a)}return o(e)}var Cl={exports:{}};Cl.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",v="[object GeneratorFunction]",y="[object Map]",S="[object Number]",m="[object Null]",h="[object Object]",g="[object Proxy]",w="[object RegExp]",P="[object Set]",$="[object String]",_="[object Undefined]",A="[object WeakMap]",B="[object ArrayBuffer]",j="[object DataView]",H="[object Float32Array]",ce="[object Float64Array]",Ze="[object Int8Array]",Re="[object Int16Array]",T="[object Int32Array]",M="[object Uint8Array]",L="[object Uint8ClampedArray]",R="[object Uint16Array]",D="[object Uint32Array]",I=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,xe=/^(?:0|[1-9]\d*)$/,K={};K[H]=K[ce]=K[Ze]=K[Re]=K[T]=K[M]=K[L]=K[R]=K[D]=!0,K[a]=K[l]=K[B]=K[c]=K[j]=K[d]=K[f]=K[p]=K[y]=K[S]=K[h]=K[w]=K[P]=K[$]=K[A]=!1;var Je=typeof wn=="object"&&wn&&wn.Object===Object&&wn,go=typeof self=="object"&&self&&self.Object===Object&&self,pt=Je||go||Function("return this")(),kr=t&&!t.nodeType&&t,yo=kr&&!0&&e&&!e.nodeType&&e,wm=yo&&yo.exports===kr,lc=wm&&Je.process,km=function(){try{var b=yo&&yo.require&&yo.require("util").types;return b||lc&&lc.binding&&lc.binding("util")}catch{}}(),Cm=km&&km.isTypedArray;function Ak(b,C,E){switch(E.length){case 0:return b.call(C);case 1:return b.call(C,E[0]);case 2:return b.call(C,E[0],E[1]);case 3:return b.call(C,E[0],E[1],E[2])}return b.apply(C,E)}function Ok(b,C){for(var E=-1,F=Array(b);++E-1}function eC(b,C){var E=this.__data__,F=da(E,b);return F<0?(++this.size,E.push([b,C])):E[F][1]=C,this}mn.prototype.clear=Yk,mn.prototype.delete=Qk,mn.prototype.get=Zk,mn.prototype.has=Jk,mn.prototype.set=eC;function ii(b){var C=-1,E=b==null?0:b.length;for(this.clear();++C1?E[X-1]:void 0,pe=X>2?E[2]:void 0;for(ae=b.length>3&&typeof ae=="function"?(X--,ae):void 0,pe&&$C(E[0],E[1],pe)&&(ae=X<3?void 0:ae,X=1),C=Object(C);++F-1&&b%1==0&&b0){if(++C>=i)return arguments[0]}else C=0;return b.apply(void 0,arguments)}}function DC(b){if(b!=null){try{return la.call(b)}catch{}try{return b+""}catch{}}return""}function pa(b,C){return b===C||b!==b&&C!==C}var pc=Lm(function(){return arguments}())?Lm:function(b){return bo(b)&&Vn.call(b,"callee")&&!Fk.call(b,"callee")},mc=Array.isArray;function gc(b){return b!=null&&jm(b.length)&&!yc(b)}function jC(b){return bo(b)&&gc(b)}var Dm=Vk||UC;function yc(b){if(!Pr(b))return!1;var C=fa(b);return C==p||C==v||C==u||C==g}function jm(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=s}function Pr(b){var C=typeof b;return b!=null&&(C=="object"||C=="function")}function bo(b){return b!=null&&typeof b=="object"}function NC(b){if(!bo(b)||fa(b)!=h)return!1;var C=$m(b);if(C===null)return!0;var E=Vn.call(C,"constructor")&&C.constructor;return typeof E=="function"&&E instanceof E&&la.call(E)==jk}var Nm=Cm?Lk(Cm):mC;function FC(b){return CC(b,Fm(b))}function Fm(b){return gc(b)?dC(b):gC(b)}var BC=TC(function(b,C,E,F){Mm(b,C,E,F)});function VC(b){return function(){return b}}function Bm(b){return b}function UC(){return!1}e.exports=BC})(Cl,Cl.exports);var AT=Cl.exports;const an=ei(AT);function Ya(e,t=[]){const n=x.useRef(e);return x.useEffect(()=>{n.current=e}),x.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function OT(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(f,p)=>f!==p}=e,o=Ya(r),s=Ya(i),[a,l]=x.useState(n),u=t!==void 0,c=u?t:a,d=Ya(f=>{const v=typeof f=="function"?f(c):f;s(c,v)&&(u||l(v),o(v))},[u,o,c,s]);return[c,d]}const Dd=globalThis!=null&&globalThis.document?x.useLayoutEffect:x.useEffect,Ym=(e,t)=>{const n=x.useRef(!1),r=x.useRef(!1);x.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),x.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function LT(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 gu(...e){return t=>{e.forEach(n=>{LT(n,t)})}}function YF(...e){return x.useMemo(()=>gu(...e),e)}function MT(e,t){const n=Ya(e);x.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}const Ae={open:(e,t)=>`${e}[data-open], ${e}[open], ${e}[data-state=open] ${t}`,closed:(e,t)=>`${e}[data-closed], ${e}[data-state=closed] ${t}`,hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},Yt=e=>m1(t=>e(t,"&"),"[role=group]","[data-group]",".group"),yn=e=>m1(t=>e(t,"~ &"),"[data-peer]",".peer"),m1=(e,...t)=>t.map(e).join(", "),zT={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within, &[data-focus-within]",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty, &[data-empty]",_expanded:"&[aria-expanded=true], &[data-expanded], &[data-state=expanded]",_checked:"&[aria-checked=true], &[data-checked], &[data-state=checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate], &[data-state=indeterminate]",_groupOpen:Yt(Ae.open),_groupClosed:Yt(Ae.closed),_groupHover:Yt(Ae.hover),_peerHover:yn(Ae.hover),_groupFocus:Yt(Ae.focus),_peerFocus:yn(Ae.focus),_groupFocusVisible:Yt(Ae.focusVisible),_peerFocusVisible:yn(Ae.focusVisible),_groupActive:Yt(Ae.active),_peerActive:yn(Ae.active),_groupDisabled:Yt(Ae.disabled),_peerDisabled:yn(Ae.disabled),_groupInvalid:Yt(Ae.invalid),_peerInvalid:yn(Ae.invalid),_groupChecked:Yt(Ae.checked),_peerChecked:yn(Ae.checked),_groupFocusWithin:Yt(Ae.focusWithin),_peerFocusWithin:yn(Ae.focusWithin),_peerPlaceholderShown:yn(Ae.placeholderShown),_placeholder:"&::placeholder, &[data-placeholder]",_placeholderShown:"&:placeholder-shown, &[data-placeholder-shown]",_fullScreen:"&:fullscreen, &[data-fullscreen]",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]",_open:"&[data-open], &[open], &[data-state=open]",_closed:"&[data-closed], &[data-state=closed]",_complete:"&[data-complete]",_incomplete:"&[data-incomplete]",_current:"&[data-current]"};function yu(e){const t=e.conditions??{},n=Object.fromEntries(Object.entries(t).map(([r,i])=>[`_${r}`,i]));return{...zT,...n}}function g1(e){return Object.keys(yu(e))}const IT=e=>/!(important)?$/.test(e),Qm=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,DT=(e,t)=>n=>{const r=String(t),i=IT(r),o=Qm(r),s=e?`${e}.${o}`:o;let a=Ht(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return a=Qm(a),i?`${a} !important`:a};function _h(e){const{scale:t,transform:n,compose:r}=e;return(o,s)=>{const a=DT(t,o)(s);let l=(n==null?void 0:n(a,s))??a;return r&&(l=r(l,s)),l}}const ga=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Pt(e,t){return n=>{const r={property:n,scale:e};return r.transform=_h({scale:e,transform:t}),r}}const jT=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function NT(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:jT(t),transform:n?_h({scale:n,compose:r}):r}}const y1=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function FT(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...y1].join(" ")}function BT(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...y1].join(" ")}const VT={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},UT={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function WT(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}const HT={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},jd={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},KT=new Set(Object.values(jd)),Nd=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),GT=e=>e.trim();function qT(e,t){if(e==null||Nd.has(e))return e;if(!(Fd(e)||Nd.has(e)))return`url('${e}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),o=i==null?void 0:i[1],s=i==null?void 0:i[2];if(!o||!s)return e;const a=o.includes("-gradient")?o:`${o}-gradient`,[l,...u]=s.split(",").map(GT).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in jd?jd[l]:l;u.unshift(c);const d=u.map(f=>{if(KT.has(f))return f;const p=f.indexOf(" "),[v,y]=p!==-1?[f.substr(0,p),f.substr(p+1)]:[f],S=Fd(y)?y:y&&y.split(" "),m=`colors.${v}`,h=m in t.__cssMap?t.__cssMap[m].varRef:v;return S?[h,...Array.isArray(S)?S:[S]].join(" "):h});return`${a}(${d.join(", ")})`}const Fd=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),XT=(e,t)=>qT(e,t??{});function YT(e){return/^var\(--.+\)$/.test(e)}const QT=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Qt=e=>t=>`${e}(${t})`,q={filter(e){return e!=="auto"?e:VT},backdropFilter(e){return e!=="auto"?e:UT},ring(e){return WT(q.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?FT():e==="auto-gpu"?BT():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=QT(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(YT(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:XT,blur:Qt("blur"),opacity:Qt("opacity"),brightness:Qt("brightness"),contrast:Qt("contrast"),dropShadow:Qt("drop-shadow"),grayscale:Qt("grayscale"),hueRotate:e=>Qt("hue-rotate")(q.degree(e)),invert:Qt("invert"),saturate:Qt("saturate"),sepia:Qt("sepia"),bgImage(e){return e==null||Fd(e)||Nd.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=HT[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},k={borderWidths:Pt("borderWidths"),borderStyles:Pt("borderStyles"),colors:Pt("colors"),borders:Pt("borders"),gradients:Pt("gradients",q.gradient),radii:Pt("radii",q.px),space:Pt("space",ga(q.vh,q.px)),spaceT:Pt("space",ga(q.vh,q.px)),degreeT(e){return{property:e,transform:q.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:_h({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Pt("sizes",ga(q.vh,q.px)),sizesT:Pt("sizes",ga(q.vh,q.fraction)),shadows:Pt("shadows"),logical:NT,blur:Pt("blur",q.blur)},Qa={background:k.colors("background"),backgroundColor:k.colors("backgroundColor"),backgroundImage:k.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:q.bgClip},bgSize:k.prop("backgroundSize"),bgPosition:k.prop("backgroundPosition"),bg:k.colors("background"),bgColor:k.colors("backgroundColor"),bgPos:k.prop("backgroundPosition"),bgRepeat:k.prop("backgroundRepeat"),bgAttachment:k.prop("backgroundAttachment"),bgGradient:k.gradients("backgroundImage"),bgClip:{transform:q.bgClip}};Object.assign(Qa,{bgImage:Qa.backgroundImage,bgImg:Qa.backgroundImage});const J={border:k.borders("border"),borderWidth:k.borderWidths("borderWidth"),borderStyle:k.borderStyles("borderStyle"),borderColor:k.colors("borderColor"),borderRadius:k.radii("borderRadius"),borderTop:k.borders("borderTop"),borderBlockStart:k.borders("borderBlockStart"),borderTopLeftRadius:k.radii("borderTopLeftRadius"),borderStartStartRadius:k.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:k.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:k.radii("borderTopRightRadius"),borderStartEndRadius:k.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:k.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:k.borders("borderRight"),borderInlineEnd:k.borders("borderInlineEnd"),borderBottom:k.borders("borderBottom"),borderBlockEnd:k.borders("borderBlockEnd"),borderBottomLeftRadius:k.radii("borderBottomLeftRadius"),borderBottomRightRadius:k.radii("borderBottomRightRadius"),borderLeft:k.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:k.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:k.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:k.borders(["borderLeft","borderRight"]),borderInline:k.borders("borderInline"),borderY:k.borders(["borderTop","borderBottom"]),borderBlock:k.borders("borderBlock"),borderTopWidth:k.borderWidths("borderTopWidth"),borderBlockStartWidth:k.borderWidths("borderBlockStartWidth"),borderTopColor:k.colors("borderTopColor"),borderBlockStartColor:k.colors("borderBlockStartColor"),borderTopStyle:k.borderStyles("borderTopStyle"),borderBlockStartStyle:k.borderStyles("borderBlockStartStyle"),borderBottomWidth:k.borderWidths("borderBottomWidth"),borderBlockEndWidth:k.borderWidths("borderBlockEndWidth"),borderBottomColor:k.colors("borderBottomColor"),borderBlockEndColor:k.colors("borderBlockEndColor"),borderBottomStyle:k.borderStyles("borderBottomStyle"),borderBlockEndStyle:k.borderStyles("borderBlockEndStyle"),borderLeftWidth:k.borderWidths("borderLeftWidth"),borderInlineStartWidth:k.borderWidths("borderInlineStartWidth"),borderLeftColor:k.colors("borderLeftColor"),borderInlineStartColor:k.colors("borderInlineStartColor"),borderLeftStyle:k.borderStyles("borderLeftStyle"),borderInlineStartStyle:k.borderStyles("borderInlineStartStyle"),borderRightWidth:k.borderWidths("borderRightWidth"),borderInlineEndWidth:k.borderWidths("borderInlineEndWidth"),borderRightColor:k.colors("borderRightColor"),borderInlineEndColor:k.colors("borderInlineEndColor"),borderRightStyle:k.borderStyles("borderRightStyle"),borderInlineEndStyle:k.borderStyles("borderInlineEndStyle"),borderTopRadius:k.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:k.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:k.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:k.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(J,{rounded:J.borderRadius,roundedTop:J.borderTopRadius,roundedTopLeft:J.borderTopLeftRadius,roundedTopRight:J.borderTopRightRadius,roundedTopStart:J.borderStartStartRadius,roundedTopEnd:J.borderStartEndRadius,roundedBottom:J.borderBottomRadius,roundedBottomLeft:J.borderBottomLeftRadius,roundedBottomRight:J.borderBottomRightRadius,roundedBottomStart:J.borderEndStartRadius,roundedBottomEnd:J.borderEndEndRadius,roundedLeft:J.borderLeftRadius,roundedRight:J.borderRightRadius,roundedStart:J.borderInlineStartRadius,roundedEnd:J.borderInlineEndRadius,borderStart:J.borderInlineStart,borderEnd:J.borderInlineEnd,borderTopStartRadius:J.borderStartStartRadius,borderTopEndRadius:J.borderStartEndRadius,borderBottomStartRadius:J.borderEndStartRadius,borderBottomEndRadius:J.borderEndEndRadius,borderStartRadius:J.borderInlineStartRadius,borderEndRadius:J.borderInlineEndRadius,borderStartWidth:J.borderInlineStartWidth,borderEndWidth:J.borderInlineEndWidth,borderStartColor:J.borderInlineStartColor,borderEndColor:J.borderInlineEndColor,borderStartStyle:J.borderInlineStartStyle,borderEndStyle:J.borderInlineEndStyle});const ZT={color:k.colors("color"),textColor:k.colors("color"),fill:k.colors("fill"),stroke:k.colors("stroke"),accentColor:k.colors("accentColor"),textFillColor:k.colors("textFillColor")},Tl={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:q.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:k.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:k.space("gap"),rowGap:k.space("rowGap"),columnGap:k.space("columnGap")};Object.assign(Tl,{flexDir:Tl.flexDirection});const _t={width:k.sizesT("width"),inlineSize:k.sizesT("inlineSize"),height:k.sizes("height"),blockSize:k.sizes("blockSize"),boxSize:k.sizes(["width","height"]),minWidth:k.sizes("minWidth"),minInlineSize:k.sizes("minInlineSize"),minHeight:k.sizes("minHeight"),minBlockSize:k.sizes("minBlockSize"),maxWidth:k.sizes("maxWidth"),maxInlineSize:k.sizes("maxInlineSize"),maxHeight:k.sizes("maxHeight"),maxBlockSize:k.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var i,o;return{[`@media screen and (min-width: ${((o=(i=t.__breakpoints)==null?void 0:i.get(e))==null?void 0:o.minW)??e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var i,o;return{[`@media screen and (max-width: ${((o=(i=t.__breakpoints)==null?void 0:i.get(e))==null?void 0:o._minW)??e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:k.propT("float",q.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(_t,{w:_t.width,h:_t.height,minW:_t.minWidth,maxW:_t.maxWidth,minH:_t.minHeight,maxH:_t.maxHeight,overscroll:_t.overscrollBehavior,overscrollX:_t.overscrollBehaviorX,overscrollY:_t.overscrollBehaviorY});const JT={filter:{transform:q.filter},blur:k.blur("--chakra-blur"),brightness:k.propT("--chakra-brightness",q.brightness),contrast:k.propT("--chakra-contrast",q.contrast),hueRotate:k.propT("--chakra-hue-rotate",q.hueRotate),invert:k.propT("--chakra-invert",q.invert),saturate:k.propT("--chakra-saturate",q.saturate),dropShadow:k.propT("--chakra-drop-shadow",q.dropShadow),backdropFilter:{transform:q.backdropFilter},backdropBlur:k.blur("--chakra-backdrop-blur"),backdropBrightness:k.propT("--chakra-backdrop-brightness",q.brightness),backdropContrast:k.propT("--chakra-backdrop-contrast",q.contrast),backdropHueRotate:k.propT("--chakra-backdrop-hue-rotate",q.hueRotate),backdropInvert:k.propT("--chakra-backdrop-invert",q.invert),backdropSaturate:k.propT("--chakra-backdrop-saturate",q.saturate)},eP={ring:{transform:q.ring},ringColor:k.colors("--chakra-ring-color"),ringOffset:k.prop("--chakra-ring-offset-width"),ringOffsetColor:k.colors("--chakra-ring-offset-color"),ringInset:k.prop("--chakra-ring-inset")},tP={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:q.outline},outlineOffset:!0,outlineColor:k.colors("outlineColor")},v1={gridGap:k.space("gridGap"),gridColumnGap:k.space("gridColumnGap"),gridRowGap:k.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0};function nP(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,s)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(i))return a.get(i);const l=e(r,i,o,s);return a.set(i,l),l}},iP=rP(nP),oP={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},sP={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},xc=(e,t,n)=>{const r={},i=iP(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},aP={srOnly:{transform(e){return e===!0?oP:e==="focusable"?sP:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>xc(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>xc(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>xc(t,e,n)}},qo={position:!0,pos:k.prop("position"),zIndex:k.prop("zIndex","zIndices"),inset:k.spaceT("inset"),insetX:k.spaceT(["left","right"]),insetInline:k.spaceT("insetInline"),insetY:k.spaceT(["top","bottom"]),insetBlock:k.spaceT("insetBlock"),top:k.spaceT("top"),insetBlockStart:k.spaceT("insetBlockStart"),bottom:k.spaceT("bottom"),insetBlockEnd:k.spaceT("insetBlockEnd"),left:k.spaceT("left"),insetInlineStart:k.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:k.spaceT("right"),insetInlineEnd:k.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(qo,{insetStart:qo.insetInlineStart,insetEnd:qo.insetInlineEnd});const Bd={boxShadow:k.shadows("boxShadow"),mixBlendMode:!0,blendMode:k.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:k.prop("backgroundBlendMode"),opacity:!0};Object.assign(Bd,{shadow:Bd.boxShadow});const fe={margin:k.spaceT("margin"),marginTop:k.spaceT("marginTop"),marginBlockStart:k.spaceT("marginBlockStart"),marginRight:k.spaceT("marginRight"),marginInlineEnd:k.spaceT("marginInlineEnd"),marginBottom:k.spaceT("marginBottom"),marginBlockEnd:k.spaceT("marginBlockEnd"),marginLeft:k.spaceT("marginLeft"),marginInlineStart:k.spaceT("marginInlineStart"),marginX:k.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:k.spaceT("marginInline"),marginY:k.spaceT(["marginTop","marginBottom"]),marginBlock:k.spaceT("marginBlock"),padding:k.space("padding"),paddingTop:k.space("paddingTop"),paddingBlockStart:k.space("paddingBlockStart"),paddingRight:k.space("paddingRight"),paddingBottom:k.space("paddingBottom"),paddingBlockEnd:k.space("paddingBlockEnd"),paddingLeft:k.space("paddingLeft"),paddingInlineStart:k.space("paddingInlineStart"),paddingInlineEnd:k.space("paddingInlineEnd"),paddingX:k.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:k.space("paddingInline"),paddingY:k.space(["paddingTop","paddingBottom"]),paddingBlock:k.space("paddingBlock")};Object.assign(fe,{m:fe.margin,mt:fe.marginTop,mr:fe.marginRight,me:fe.marginInlineEnd,marginEnd:fe.marginInlineEnd,mb:fe.marginBottom,ml:fe.marginLeft,ms:fe.marginInlineStart,marginStart:fe.marginInlineStart,mx:fe.marginX,my:fe.marginY,p:fe.padding,pt:fe.paddingTop,py:fe.paddingY,px:fe.paddingX,pb:fe.paddingBottom,pl:fe.paddingLeft,ps:fe.paddingInlineStart,paddingStart:fe.paddingInlineStart,pr:fe.paddingRight,pe:fe.paddingInlineEnd,paddingEnd:fe.paddingInlineEnd});const lP={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:k.spaceT("scrollMargin"),scrollMarginTop:k.spaceT("scrollMarginTop"),scrollMarginBottom:k.spaceT("scrollMarginBottom"),scrollMarginLeft:k.spaceT("scrollMarginLeft"),scrollMarginRight:k.spaceT("scrollMarginRight"),scrollMarginX:k.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:k.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:k.spaceT("scrollPadding"),scrollPaddingTop:k.spaceT("scrollPaddingTop"),scrollPaddingBottom:k.spaceT("scrollPaddingBottom"),scrollPaddingLeft:k.spaceT("scrollPaddingLeft"),scrollPaddingRight:k.spaceT("scrollPaddingRight"),scrollPaddingX:k.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:k.spaceT(["scrollPaddingTop","scrollPaddingBottom"])},uP={fontFamily:k.prop("fontFamily","fonts"),fontSize:k.prop("fontSize","fontSizes",q.px),fontWeight:k.prop("fontWeight","fontWeights"),lineHeight:k.prop("lineHeight","lineHeights"),letterSpacing:k.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},cP={textDecorationColor:k.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:k.shadows("textShadow")},dP={clipPath:!0,transform:k.propT("transform",q.transform),transformOrigin:!0,translateX:k.spaceT("--chakra-translate-x"),translateY:k.spaceT("--chakra-translate-y"),skewX:k.degreeT("--chakra-skew-x"),skewY:k.degreeT("--chakra-skew-y"),scaleX:k.prop("--chakra-scale-x"),scaleY:k.prop("--chakra-scale-y"),scale:k.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:k.degreeT("--chakra-rotate")},fP={listStyleType:!0,listStylePosition:!0,listStylePos:k.prop("listStylePosition"),listStyleImage:!0,listStyleImg:k.prop("listStyleImage")},hP={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:k.prop("transitionDuration","transition.duration"),transitionProperty:k.prop("transitionProperty","transition.property"),transitionTimingFunction:k.prop("transitionTimingFunction","transition.easing")},$h=an({},Qa,J,ZT,Tl,_t,JT,eP,tP,v1,aP,qo,Bd,fe,lP,uP,cP,dP,fP,hP);Object.assign({},fe,_t,Tl,v1,qo);const pP=e=>[...Object.keys($h),...g1(e)],mP=e=>{const t=yu(e);return n=>{const r={...$h,...t};return Object.hasOwnProperty.call(r,n)}},gP=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const s in e){let a=sn(e[s],t);if(a==null)continue;if(a=Ht(a)&&n(a)?r(a):a,!Array.isArray(a)){o[s]=a;continue}const l=a.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!vP(t),SP=(e,t)=>{if(t==null)return t;const n=s=>{var a,l;return(l=(a=e.__cssMap)==null?void 0:a[s])==null?void 0:l.varRef},r=s=>n(s)??s,[i,o]=yP(t);return t=n(i)??r(o)??r(t),t};function xP(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,s=!1)=>{var c;const a=sn(o,r),l=gP(a)(r);let u={};for(let d in l){const f=l[d];let p=sn(f,r);d in n&&(d=n[d]),bP(d,p)&&(p=SP(r,p));let v=t[d];if(v===!0&&(v={property:d}),Ht(p)){u[d]=u[d]??{},u[d]=an({},u[d],i(p,!0));continue}let y=((c=v==null?void 0:v.transform)==null?void 0:c.call(v,p,r,a))??p;y=v!=null&&v.processResult?i(y,!0):y;const S=sn(v==null?void 0:v.property,r);if(!s&&(v!=null&&v.static)){const m=sn(v.static,r);u=an({},u,m)}if(S&&Array.isArray(S)){for(const m of S)u[m]=y;continue}if(S){S==="&"&&Ht(y)?u=an({},u,y):u[S]=y;continue}if(Ht(y)){u=an({},u,y);continue}u[d]=y}return u};return i}const b1=e=>t=>xP({theme:t,pseudos:yu(t),configs:$h})(e);function QF(e){return e}function ue(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function wP(e,t){if(Array.isArray(e))return e;if(Ht(e))return t(e);if(e!=null)return[e]}function kP(e,t){for(let n=t+1;n{an(a,{[g]:c?h[g]:{[m]:h[g]}})});continue}if(!d){c?an(a,h):a[m]=h;continue}a[m]=h}}return a}}function TP(e){return t=>{const{variant:n,size:r,theme:i}=t,o=CP(i);return an({},sn(e.baseStyle??{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function vu(e){return p1(e,["styleConfig","size","variant","colorScheme"])}function S1(e){return Ht(e)&&e.reference?e.reference:String(e)}const bu=(e,...t)=>t.map(S1).join(` ${e} `).replace(/calc/g,""),Zm=(...e)=>`calc(${bu("+",...e)})`,Jm=(...e)=>`calc(${bu("-",...e)})`,Vd=(...e)=>`calc(${bu("*",...e)})`,eg=(...e)=>`calc(${bu("/",...e)})`,tg=e=>{const t=S1(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:Vd(t,-1)},Lr=Object.assign(e=>({add:(...t)=>Lr(Zm(e,...t)),subtract:(...t)=>Lr(Jm(e,...t)),multiply:(...t)=>Lr(Vd(e,...t)),divide:(...t)=>Lr(eg(e,...t)),negate:()=>Lr(tg(e)),toString:()=>e.toString()}),{add:Zm,subtract:Jm,multiply:Vd,divide:eg,negate:tg});function PP(e,t="-"){return e.replace(/\s+/g,t)}function EP(e){const t=PP(e.toString());return $P(_P(t))}function _P(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function $P(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function RP(e,t=""){return[t,e].filter(Boolean).join("-")}function AP(e,t){return`var(${e}${t?`, ${t}`:""})`}function OP(e,t=""){return EP(`--${RP(e,t)}`)}function U(e,t,n){const r=OP(e,n);return{variable:r,reference:AP(r,t)}}function LP(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[i,o]=r;n[i]=U(`${e}-${i}`,o);continue}n[r]=U(`${e}-${r}`)}return n}const MP=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function zP(e){return _T(e,MP)}function IP(e){return e.semanticTokens}function DP(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function jP(e){const t=zP(e),n=IP(e),r=g1(e),i=s=>r.includes(s)||s==="default",o={};return Xm(t,(s,a)=>{s!=null&&(o[a.join(".")]={isSemantic:!1,value:s})}),Xm(n,(s,a)=>{s!=null&&(o[a.join(".")]={isSemantic:!0,value:s})},{stop:s=>Object.keys(s).every(i)}),o}function ng(e,t){return U(String(e).replace(/\./g,"-"),void 0,t)}function NP(e){var a;const t=jP(e),n=(a=e.config)==null?void 0:a.cssVarPrefix,r=yu(e);let i={};const o={};function s(l,u){const d=[String(l).split(".")[0],u].join(".");if(!t[d])return u;const{reference:p}=ng(d,n);return p}for(const[l,u]of Object.entries(t)){const{isSemantic:c,value:d}=u,{variable:f,reference:p}=ng(l,n);if(!c){if(l.startsWith("space")){const y=l.split("."),[S,...m]=y,h=`${S}.-${m.join(".")}`,g=Lr.negate(d),w=Lr.negate(p);o[h]={value:g,var:f,varRef:w}}i[f]=d,o[l]={value:d,var:f,varRef:p};continue}const v=Ht(d)?d:{default:d};i=an(i,Object.entries(v).reduce((y,[S,m])=>{if(!m)return y;const h=s(l,`${m}`);if(S==="default")return y[f]=h,y;const g=(r==null?void 0:r[S])??S;return y[g]={[f]:h},y},{})),o[l]={value:p,var:f,varRef:p}}return{cssVars:i,cssMap:o}}function FP(e){const t=DP(e),{cssMap:n,cssVars:r}=NP(t);return Object.assign(t,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...r},__cssMap:n,__breakpoints:kT(t.breakpoints)}),t}function re(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function i(...c){r();for(const d of c)t[d]=l(d);return re(e,t)}function o(...c){for(const d of c)d in t||(t[d]=l(d));return re(e,t)}function s(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.selector]))}function a(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.className]))}function l(c){const p=`chakra-${(["container","root"].includes(c??"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:p,selector:`.${p}`,toString:()=>c}}return{parts:i,toPart:l,extend:o,selectors:s,classnames:a,get keys(){return Object.keys(t)},__type:{}}}const BP=re("accordion").parts("root","container","button","panel","icon"),VP=re("alert").parts("title","description","container","icon","spinner"),UP=re("avatar").parts("label","badge","container","excessLabel","group"),WP=re("breadcrumb").parts("link","item","container","separator");re("button").parts();const HP=re("checkbox").parts("control","icon","container","label");re("progress").parts("track","filledTrack","label");const KP=re("drawer").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),GP=re("editable").parts("preview","input","textarea"),qP=re("form").parts("container","requiredIndicator","helperText"),XP=re("formError").parts("text","icon"),YP=re("input").parts("addon","field","element","group"),QP=re("list").parts("container","item","icon"),ZP=re("menu").parts("button","list","item","groupTitle","icon","command","divider"),JP=re("modal").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),eE=re("numberinput").parts("root","field","stepperGroup","stepper");re("pininput").parts("field");const tE=re("popover").parts("content","header","body","footer","popper","arrow","closeButton"),nE=re("progress").parts("label","filledTrack","track"),rE=re("radio").parts("container","control","label"),iE=re("select").parts("field","icon"),oE=re("slider").parts("container","track","thumb","filledTrack","mark"),sE=re("stat").parts("container","label","helpText","number","icon"),aE=re("switch").parts("container","track","thumb","label"),lE=re("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),uE=re("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),cE=re("tag").parts("container","label","closeButton"),dE=re("card").parts("container","header","body","footer");re("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");const{definePartsStyle:fE,defineMultiStyleConfig:hE}=ue(BP.keys),pE={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},mE={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},gE={pt:"2",px:"4",pb:"5"},yE={fontSize:"1.25em"},vE=fE({container:pE,button:mE,panel:gE,icon:yE}),bE=hE({baseStyle:vE});function zr(e,t,n){return Math.min(Math.max(e,n),t)}class SE extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var jo=SE;function Rh(e){if(typeof e!="string")throw new jo(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=_E.test(e)?kE(e):e;const n=CE.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(ps(a,2),16)),parseInt(ps(s[3]||"f",2),16)/255]}const r=TE.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const i=PE.exec(t);if(i){const s=Array.from(i).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const o=EE.exec(t);if(o){const[s,a,l,u]=Array.from(o).slice(1).map(parseFloat);if(zr(0,100,a)!==a)throw new jo(e);if(zr(0,100,l)!==l)throw new jo(e);return[...$E(s,a,l),Number.isNaN(u)?1:u]}throw new jo(e)}function xE(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const rg=e=>parseInt(e.replace(/_/g,""),36),wE="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=rg(t.substring(0,3)),r=rg(t.substring(3)).toString(16);let i="";for(let o=0;o<6-r.length;o++)i+="0";return e[n]=`${i}${r}`,e},{});function kE(e){const t=e.toLowerCase().trim(),n=wE[xE(t)];if(!n)throw new jo(e);return`#${n}`}const ps=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),CE=new RegExp(`^#${ps("([a-f0-9])",3)}([a-f0-9])?$`,"i"),TE=new RegExp(`^#${ps("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),PE=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${ps(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),EE=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,_E=/^[a-z]+$/i,ig=e=>Math.round(e*255),$E=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(ig);const i=(e%360+360)%360/60,o=(1-Math.abs(2*r-1))*(t/100),s=o*(1-Math.abs(i%2-1));let a=0,l=0,u=0;i>=0&&i<1?(a=o,l=s):i>=1&&i<2?(a=s,l=o):i>=2&&i<3?(l=o,u=s):i>=3&&i<4?(l=s,u=o):i>=4&&i<5?(a=s,u=o):i>=5&&i<6&&(a=o,u=s);const c=r-o/2,d=a+c,f=l+c,p=u+c;return[d,f,p].map(ig)};function RE(e,t,n,r){return`rgba(${zr(0,255,e).toFixed()}, ${zr(0,255,t).toFixed()}, ${zr(0,255,n).toFixed()}, ${parseFloat(zr(0,1,r).toFixed(3))})`}function AE(e,t){const[n,r,i,o]=Rh(e);return RE(n,r,i,o-t)}function OE(e){const[t,n,r,i]=Rh(e);let o=s=>{const a=zr(0,255,s).toString(16);return a.length===1?`0${a}`:a};return`#${o(t)}${o(n)}${o(r)}${i<1?o(Math.round(i*255)):""}`}const LE=e=>Object.keys(e).length===0;function ME(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r{const r=ME(e,`colors.${t}`,t);try{return OE(r),r}catch{return"#000000"}},zE=e=>{const[t,n,r]=Rh(e);return(t*299+n*587+r*114)/1e3},IE=e=>t=>{const n=tt(t,e);return zE(n)<128?"dark":"light"},DE=e=>t=>IE(e)(t)==="dark",Gi=(e,t)=>n=>{const r=tt(n,e);return AE(r,1-t)};function og(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( - 45deg, - ${t} 25%, - transparent 25%, - transparent 50%, - ${t} 50%, - ${t} 75%, - transparent 75%, - transparent - )`,backgroundSize:`${e} ${e}`}}const jE=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function NE(e){const t=jE();return!e||LE(e)?t:e.string&&e.colors?BE(e.string,e.colors):e.string&&!e.colors?FE(e.string):e.colors&&!e.string?VE(e.colors):t}function FE(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function BE(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function Ah(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function x1(e){return Ht(e)&&e.reference?e.reference:String(e)}const Su=(e,...t)=>t.map(x1).join(` ${e} `).replace(/calc/g,""),sg=(...e)=>`calc(${Su("+",...e)})`,ag=(...e)=>`calc(${Su("-",...e)})`,Ud=(...e)=>`calc(${Su("*",...e)})`,lg=(...e)=>`calc(${Su("/",...e)})`,ug=e=>{const t=x1(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:Ud(t,-1)},Sn=Object.assign(e=>({add:(...t)=>Sn(sg(e,...t)),subtract:(...t)=>Sn(ag(e,...t)),multiply:(...t)=>Sn(Ud(e,...t)),divide:(...t)=>Sn(lg(e,...t)),negate:()=>Sn(ug(e)),toString:()=>e.toString()}),{add:sg,subtract:ag,multiply:Ud,divide:lg,negate:ug});function UE(e){return!Number.isInteger(parseFloat(e.toString()))}function WE(e,t="-"){return e.replace(/\s+/g,t)}function w1(e){const t=WE(e.toString());return t.includes("\\.")?e:UE(e)?t.replace(".","\\."):e}function HE(e,t=""){return[t,w1(e)].filter(Boolean).join("-")}function KE(e,t){return`var(${w1(e)}${t?`, ${t}`:""})`}function GE(e,t=""){return`--${HE(e,t)}`}function Me(e,t){const n=GE(e,t==null?void 0:t.prefix);return{variable:n,reference:KE(n,qE(t==null?void 0:t.fallback))}}function qE(e){return e==null?void 0:e.reference}const{definePartsStyle:qs,defineMultiStyleConfig:XE}=ue(VP.keys),vt=U("alert-fg"),Mn=U("alert-bg"),YE=qs({container:{bg:Mn.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:vt.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:vt.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function Oh(e){const{theme:t,colorScheme:n}=e,r=Gi(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}const QE=qs(e=>{const{colorScheme:t}=e,n=Oh(e);return{container:{[vt.variable]:`colors.${t}.600`,[Mn.variable]:n.light,_dark:{[vt.variable]:`colors.${t}.200`,[Mn.variable]:n.dark}}}}),ZE=qs(e=>{const{colorScheme:t}=e,n=Oh(e);return{container:{[vt.variable]:`colors.${t}.600`,[Mn.variable]:n.light,_dark:{[vt.variable]:`colors.${t}.200`,[Mn.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:vt.reference}}}),JE=qs(e=>{const{colorScheme:t}=e,n=Oh(e);return{container:{[vt.variable]:`colors.${t}.600`,[Mn.variable]:n.light,_dark:{[vt.variable]:`colors.${t}.200`,[Mn.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:vt.reference}}}),e2=qs(e=>{const{colorScheme:t}=e;return{container:{[vt.variable]:"colors.white",[Mn.variable]:`colors.${t}.600`,_dark:{[vt.variable]:"colors.gray.900",[Mn.variable]:`colors.${t}.200`},color:vt.reference}}}),t2={subtle:QE,"left-accent":ZE,"top-accent":JE,solid:e2},n2=XE({baseStyle:YE,variants:t2,defaultProps:{variant:"subtle",colorScheme:"blue"}}),k1={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},r2={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},i2={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},C1={...k1,...r2,container:i2},o2=e=>typeof e=="function";function nt(e,...t){return o2(e)?e(...t):e}const{definePartsStyle:T1,defineMultiStyleConfig:s2}=ue(UP.keys),Mi=U("avatar-border-color"),Xo=U("avatar-bg"),ms=U("avatar-font-size"),qi=U("avatar-size"),a2={borderRadius:"full",border:"0.2em solid",borderColor:Mi.reference,[Mi.variable]:"white",_dark:{[Mi.variable]:"colors.gray.800"}},l2={bg:Xo.reference,fontSize:ms.reference,width:qi.reference,height:qi.reference,lineHeight:"1",[Xo.variable]:"colors.gray.200",_dark:{[Xo.variable]:"colors.whiteAlpha.400"}},u2=e=>{const{name:t,theme:n}=e,r=t?NE({string:t}):"colors.gray.400",i=DE(r)(n);let o="white";return i||(o="gray.800"),{bg:Xo.reference,fontSize:ms.reference,color:o,borderColor:Mi.reference,verticalAlign:"top",width:qi.reference,height:qi.reference,"&:not([data-loaded])":{[Xo.variable]:r},[Mi.variable]:"colors.white",_dark:{[Mi.variable]:"colors.gray.800"}}},c2={fontSize:ms.reference,lineHeight:"1"},d2=T1(e=>({badge:nt(a2,e),excessLabel:nt(l2,e),container:nt(u2,e),label:c2}));function Un(e){const t=e!=="100%"?C1[e]:void 0;return T1({container:{[qi.variable]:t??e,[ms.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[qi.variable]:t??e,[ms.variable]:`calc(${t??e} / 2.5)`}})}const f2={"2xs":Un(4),xs:Un(6),sm:Un(8),md:Un(12),lg:Un(16),xl:Un(24),"2xl":Un(32),full:Un("100%")},h2=s2({baseStyle:d2,sizes:f2,defaultProps:{size:"md"}}),Pe=LP("badge",["bg","color","shadow"]),p2={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:Pe.bg.reference,color:Pe.color.reference,boxShadow:Pe.shadow.reference},m2=e=>{const{colorScheme:t,theme:n}=e,r=Gi(`${t}.500`,.6)(n);return{[Pe.bg.variable]:`colors.${t}.500`,[Pe.color.variable]:"colors.white",_dark:{[Pe.bg.variable]:r,[Pe.color.variable]:"colors.whiteAlpha.800"}}},g2=e=>{const{colorScheme:t,theme:n}=e,r=Gi(`${t}.200`,.16)(n);return{[Pe.bg.variable]:`colors.${t}.100`,[Pe.color.variable]:`colors.${t}.800`,_dark:{[Pe.bg.variable]:r,[Pe.color.variable]:`colors.${t}.200`}}},y2=e=>{const{colorScheme:t,theme:n}=e,r=Gi(`${t}.200`,.8)(n);return{[Pe.color.variable]:`colors.${t}.500`,_dark:{[Pe.color.variable]:r},[Pe.shadow.variable]:`inset 0 0 0px 1px ${Pe.color.reference}`}},v2={solid:m2,subtle:g2,outline:y2},Yo={baseStyle:p2,variants:v2,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:b2,definePartsStyle:S2}=ue(WP.keys),wc=U("breadcrumb-link-decor"),x2={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:wc.reference,[wc.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[wc.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},w2=S2({link:x2}),k2=b2({baseStyle:w2}),C2={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},P1=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:V("gray.800","whiteAlpha.900")(e),_hover:{bg:V("gray.100","whiteAlpha.200")(e)},_active:{bg:V("gray.200","whiteAlpha.300")(e)}};const r=Gi(`${t}.200`,.12)(n),i=Gi(`${t}.200`,.24)(n);return{color:V(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:V(`${t}.50`,r)(e)},_active:{bg:V(`${t}.100`,i)(e)}}},T2=e=>{const{colorScheme:t}=e,n=V("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...nt(P1,e)}},P2={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},E2=e=>{const{colorScheme:t}=e;if(t==="gray"){const a=V("gray.100","whiteAlpha.200")(e);return{bg:a,color:V("gray.800","whiteAlpha.900")(e),_hover:{bg:V("gray.200","whiteAlpha.300")(e),_disabled:{bg:a}},_active:{bg:V("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=P2[t]??{},s=V(n,`${t}.200`)(e);return{bg:s,color:V(r,"gray.800")(e),_hover:{bg:V(i,`${t}.300`)(e),_disabled:{bg:s}},_active:{bg:V(o,`${t}.400`)(e)}}},_2=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:V(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:V(`${t}.700`,`${t}.500`)(e)}}},$2={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},R2={ghost:P1,outline:T2,solid:E2,link:_2,unstyled:$2},A2={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},O2={baseStyle:C2,variants:R2,sizes:A2,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Br,defineMultiStyleConfig:L2}=ue(dE.keys),Pl=U("card-bg"),En=U("card-padding"),E1=U("card-shadow"),Za=U("card-radius"),_1=U("card-border-width","0"),$1=U("card-border-color"),M2=Br({container:{[Pl.variable]:"colors.chakra-body-bg",backgroundColor:Pl.reference,boxShadow:E1.reference,borderRadius:Za.reference,color:"chakra-body-text",borderWidth:_1.reference,borderColor:$1.reference},body:{padding:En.reference,flex:"1 1 0%"},header:{padding:En.reference},footer:{padding:En.reference}}),z2={sm:Br({container:{[Za.variable]:"radii.base",[En.variable]:"space.3"}}),md:Br({container:{[Za.variable]:"radii.md",[En.variable]:"space.5"}}),lg:Br({container:{[Za.variable]:"radii.xl",[En.variable]:"space.7"}})},I2={elevated:Br({container:{[E1.variable]:"shadows.base",_dark:{[Pl.variable]:"colors.gray.700"}}}),outline:Br({container:{[_1.variable]:"1px",[$1.variable]:"colors.chakra-border-color"}}),filled:Br({container:{[Pl.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[En.variable]:0},header:{[En.variable]:0},footer:{[En.variable]:0}}},D2=L2({baseStyle:M2,variants:I2,sizes:z2,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:Ja,defineMultiStyleConfig:j2}=ue(HP.keys),Qo=U("checkbox-size"),N2=e=>{const{colorScheme:t}=e;return{w:Qo.reference,h:Qo.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:V(`${t}.500`,`${t}.200`)(e),borderColor:V(`${t}.500`,`${t}.200`)(e),color:V("white","gray.900")(e),_hover:{bg:V(`${t}.600`,`${t}.300`)(e),borderColor:V(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:V("gray.200","transparent")(e),bg:V("gray.200","whiteAlpha.300")(e),color:V("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:V(`${t}.500`,`${t}.200`)(e),borderColor:V(`${t}.500`,`${t}.200`)(e),color:V("white","gray.900")(e)},_disabled:{bg:V("gray.100","whiteAlpha.100")(e),borderColor:V("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:V("red.500","red.300")(e)}}},F2={_disabled:{cursor:"not-allowed"}},B2={userSelect:"none",_disabled:{opacity:.4}},V2={transitionProperty:"transform",transitionDuration:"normal"},U2=Ja(e=>({icon:V2,container:F2,control:nt(N2,e),label:B2})),W2={sm:Ja({control:{[Qo.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:Ja({control:{[Qo.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:Ja({control:{[Qo.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},qn=j2({baseStyle:U2,sizes:W2,defaultProps:{size:"md",colorScheme:"blue"}}),Zo=Me("close-button-size"),xo=Me("close-button-bg"),H2={w:[Zo.reference],h:[Zo.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[xo.variable]:"colors.blackAlpha.100",_dark:{[xo.variable]:"colors.whiteAlpha.100"}},_active:{[xo.variable]:"colors.blackAlpha.200",_dark:{[xo.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:xo.reference},K2={lg:{[Zo.variable]:"sizes.10",fontSize:"md"},md:{[Zo.variable]:"sizes.8",fontSize:"xs"},sm:{[Zo.variable]:"sizes.6",fontSize:"2xs"}},G2={baseStyle:H2,sizes:K2,defaultProps:{size:"md"}},{variants:q2,defaultProps:X2}=Yo,Y2={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:Pe.bg.reference,color:Pe.color.reference,boxShadow:Pe.shadow.reference},Q2={baseStyle:Y2,variants:q2,defaultProps:X2},Z2={w:"100%",mx:"auto",maxW:"prose",px:"4"},J2={baseStyle:Z2},e_={opacity:.6,borderColor:"inherit"},t_={borderStyle:"solid"},n_={borderStyle:"dashed"},r_={solid:t_,dashed:n_},i_={baseStyle:e_,variants:r_,defaultProps:{variant:"solid"}},{definePartsStyle:Wd,defineMultiStyleConfig:o_}=ue(KP.keys),kc=U("drawer-bg"),Cc=U("drawer-box-shadow");function si(e){return Wd(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}const s_={bg:"blackAlpha.600",zIndex:"modal"},a_={display:"flex",zIndex:"modal",justifyContent:"center"},l_=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[kc.variable]:"colors.white",[Cc.variable]:"shadows.lg",_dark:{[kc.variable]:"colors.gray.700",[Cc.variable]:"shadows.dark-lg"},bg:kc.reference,boxShadow:Cc.reference}},u_={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},c_={position:"absolute",top:"2",insetEnd:"3"},d_={px:"6",py:"2",flex:"1",overflow:"auto"},f_={px:"6",py:"4"},h_=Wd(e=>({overlay:s_,dialogContainer:a_,dialog:nt(l_,e),header:u_,closeButton:c_,body:d_,footer:f_})),p_={xs:si("xs"),sm:si("md"),md:si("lg"),lg:si("2xl"),xl:si("4xl"),full:si("full")},m_=o_({baseStyle:h_,sizes:p_,defaultProps:{size:"xs"}}),{definePartsStyle:g_,defineMultiStyleConfig:y_}=ue(GP.keys),v_={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},b_={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},S_={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},x_=g_({preview:v_,input:b_,textarea:S_}),w_=y_({baseStyle:x_}),{definePartsStyle:k_,defineMultiStyleConfig:C_}=ue(qP.keys),zi=U("form-control-color"),T_={marginStart:"1",[zi.variable]:"colors.red.500",_dark:{[zi.variable]:"colors.red.300"},color:zi.reference},P_={mt:"2",[zi.variable]:"colors.gray.600",_dark:{[zi.variable]:"colors.whiteAlpha.600"},color:zi.reference,lineHeight:"normal",fontSize:"sm"},E_=k_({container:{width:"100%",position:"relative"},requiredIndicator:T_,helperText:P_}),__=C_({baseStyle:E_}),{definePartsStyle:$_,defineMultiStyleConfig:R_}=ue(XP.keys),Ii=U("form-error-color"),A_={[Ii.variable]:"colors.red.500",_dark:{[Ii.variable]:"colors.red.300"},color:Ii.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},O_={marginEnd:"0.5em",[Ii.variable]:"colors.red.500",_dark:{[Ii.variable]:"colors.red.300"},color:Ii.reference},L_=$_({text:A_,icon:O_}),M_=R_({baseStyle:L_}),z_={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},I_={baseStyle:z_},D_={fontFamily:"heading",fontWeight:"bold"},j_={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},N_={baseStyle:D_,sizes:j_,defaultProps:{size:"xl"}},{definePartsStyle:kn,defineMultiStyleConfig:F_}=ue(YP.keys),di=U("input-height"),fi=U("input-font-size"),hi=U("input-padding"),pi=U("input-border-radius"),B_=kn({addon:{height:di.reference,fontSize:fi.reference,px:hi.reference,borderRadius:pi.reference},field:{width:"100%",height:di.reference,fontSize:fi.reference,px:hi.reference,borderRadius:pi.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Wn={lg:{[fi.variable]:"fontSizes.lg",[hi.variable]:"space.4",[pi.variable]:"radii.md",[di.variable]:"sizes.12"},md:{[fi.variable]:"fontSizes.md",[hi.variable]:"space.4",[pi.variable]:"radii.md",[di.variable]:"sizes.10"},sm:{[fi.variable]:"fontSizes.sm",[hi.variable]:"space.3",[pi.variable]:"radii.sm",[di.variable]:"sizes.8"},xs:{[fi.variable]:"fontSizes.xs",[hi.variable]:"space.2",[pi.variable]:"radii.sm",[di.variable]:"sizes.6"}},V_={lg:kn({field:Wn.lg,group:Wn.lg}),md:kn({field:Wn.md,group:Wn.md}),sm:kn({field:Wn.sm,group:Wn.sm}),xs:kn({field:Wn.xs,group:Wn.xs})};function Lh(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||V("blue.500","blue.300")(e),errorBorderColor:n||V("red.500","red.300")(e)}}const U_=kn(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Lh(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:V("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:tt(t,r),boxShadow:`0 0 0 1px ${tt(t,r)}`},_focusVisible:{zIndex:1,borderColor:tt(t,n),boxShadow:`0 0 0 1px ${tt(t,n)}`}},addon:{border:"1px solid",borderColor:V("inherit","whiteAlpha.50")(e),bg:V("gray.100","whiteAlpha.300")(e)}}}),W_=kn(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Lh(e);return{field:{border:"2px solid",borderColor:"transparent",bg:V("gray.100","whiteAlpha.50")(e),_hover:{bg:V("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:tt(t,r)},_focusVisible:{bg:"transparent",borderColor:tt(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:V("gray.100","whiteAlpha.50")(e)}}}),H_=kn(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Lh(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:tt(t,r),boxShadow:`0px 1px 0px 0px ${tt(t,r)}`},_focusVisible:{borderColor:tt(t,n),boxShadow:`0px 1px 0px 0px ${tt(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),K_=kn({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),G_={outline:U_,filled:W_,flushed:H_,unstyled:K_},ne=F_({baseStyle:B_,sizes:V_,variants:G_,defaultProps:{size:"md",variant:"outline"}}),Tc=U("kbd-bg"),q_={[Tc.variable]:"colors.gray.100",_dark:{[Tc.variable]:"colors.whiteAlpha.100"},bg:Tc.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},X_={baseStyle:q_},Y_={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Q_={baseStyle:Y_},{defineMultiStyleConfig:Z_,definePartsStyle:J_}=ue(QP.keys),e$={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},t$=J_({icon:e$}),n$=Z_({baseStyle:t$}),{defineMultiStyleConfig:r$,definePartsStyle:i$}=ue(ZP.keys),en=U("menu-bg"),Pc=U("menu-shadow"),o$={[en.variable]:"#fff",[Pc.variable]:"shadows.sm",_dark:{[en.variable]:"colors.gray.700",[Pc.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:"dropdown",borderRadius:"md",borderWidth:"1px",bg:en.reference,boxShadow:Pc.reference},s$={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[en.variable]:"colors.gray.100",_dark:{[en.variable]:"colors.whiteAlpha.100"}},_active:{[en.variable]:"colors.gray.200",_dark:{[en.variable]:"colors.whiteAlpha.200"}},_expanded:{[en.variable]:"colors.gray.100",_dark:{[en.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:en.reference},a$={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},l$={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},u$={opacity:.6},c$={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},d$={transitionProperty:"common",transitionDuration:"normal"},f$=i$({button:d$,list:o$,item:s$,groupTitle:a$,icon:l$,command:u$,divider:c$}),h$=r$({baseStyle:f$}),{defineMultiStyleConfig:p$,definePartsStyle:Hd}=ue(JP.keys),Ec=U("modal-bg"),_c=U("modal-shadow"),m$={bg:"blackAlpha.600",zIndex:"modal"},g$=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},y$=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[Ec.variable]:"colors.white",[_c.variable]:"shadows.lg",_dark:{[Ec.variable]:"colors.gray.700",[_c.variable]:"shadows.dark-lg"},bg:Ec.reference,boxShadow:_c.reference}},v$={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},b$={position:"absolute",top:"2",insetEnd:"3"},S$=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},x$={px:"6",py:"4"},w$=Hd(e=>({overlay:m$,dialogContainer:nt(g$,e),dialog:nt(y$,e),header:v$,closeButton:b$,body:nt(S$,e),footer:x$}));function jt(e){return Hd(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}const k$={xs:jt("xs"),sm:jt("sm"),md:jt("md"),lg:jt("lg"),xl:jt("xl"),"2xl":jt("2xl"),"3xl":jt("3xl"),"4xl":jt("4xl"),"5xl":jt("5xl"),"6xl":jt("6xl"),full:jt("full")},C$=p$({baseStyle:w$,sizes:k$,defaultProps:{size:"md"}}),R1={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},{defineMultiStyleConfig:T$,definePartsStyle:A1}=ue(eE.keys),Mh=Me("number-input-stepper-width"),O1=Me("number-input-input-padding"),P$=Sn(Mh).add("0.5rem").toString(),$c=Me("number-input-bg"),Rc=Me("number-input-color"),Ac=Me("number-input-border-color"),E$={[Mh.variable]:"sizes.6",[O1.variable]:P$},_$=e=>{var t;return((t=nt(ne.baseStyle,e))==null?void 0:t.field)??{}},$$={width:Mh.reference},R$={borderStart:"1px solid",borderStartColor:Ac.reference,color:Rc.reference,bg:$c.reference,[Rc.variable]:"colors.chakra-body-text",[Ac.variable]:"colors.chakra-border-color",_dark:{[Rc.variable]:"colors.whiteAlpha.800",[Ac.variable]:"colors.whiteAlpha.300"},_active:{[$c.variable]:"colors.gray.200",_dark:{[$c.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},A$=A1(e=>({root:E$,field:nt(_$,e)??{},stepperGroup:$$,stepper:R$}));function ya(e){var o,s;const t=(o=ne.sizes)==null?void 0:o[e],n={lg:"md",md:"md",sm:"sm",xs:"sm"},r=((s=t.field)==null?void 0:s.fontSize)??"md",i=R1.fontSizes[r];return A1({field:{...t.field,paddingInlineEnd:O1.reference,verticalAlign:"top"},stepper:{fontSize:Sn(i).multiply(.75).toString(),_first:{borderTopEndRadius:n[e]},_last:{borderBottomEndRadius:n[e],mt:"-1px",borderTopWidth:1}}})}const O$={xs:ya("xs"),sm:ya("sm"),md:ya("md"),lg:ya("lg")},L$=T$({baseStyle:A$,sizes:O$,variants:ne.variants,defaultProps:ne.defaultProps});var Iv;const M$={...(Iv=ne.baseStyle)==null?void 0:Iv.field,textAlign:"center"},z$={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}};var Dv;const I$={outline:e=>{var t,n;return((n=nt((t=ne.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=nt((t=ne.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=nt((t=ne.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((Dv=ne.variants)==null?void 0:Dv.unstyled.field)??{}},D$={baseStyle:M$,sizes:z$,variants:I$,defaultProps:ne.defaultProps},{defineMultiStyleConfig:j$,definePartsStyle:N$}=ue(tE.keys),va=Me("popper-bg"),F$=Me("popper-arrow-bg"),cg=Me("popper-arrow-shadow-color"),B$={zIndex:10},V$={[va.variable]:"colors.white",bg:va.reference,[F$.variable]:va.reference,[cg.variable]:"colors.gray.200",_dark:{[va.variable]:"colors.gray.700",[cg.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},U$={px:3,py:2,borderBottomWidth:"1px"},W$={px:3,py:2},H$={px:3,py:2,borderTopWidth:"1px"},K$={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},G$=N$({popper:B$,content:V$,header:U$,body:W$,footer:H$,closeButton:K$}),q$=j$({baseStyle:G$}),{defineMultiStyleConfig:X$,definePartsStyle:No}=ue(nE.keys),Y$=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=V(og(),og("1rem","rgba(0,0,0,0.1)"))(e),s=V(`${t}.500`,`${t}.200`)(e),a=`linear-gradient( - to right, - transparent 0%, - ${tt(n,s)} 50%, - transparent 100% - )`;return{...!r&&i&&o,...r?{bgImage:a}:{bgColor:s}}},Q$={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Z$=e=>({bg:V("gray.100","whiteAlpha.300")(e)}),J$=e=>({transitionProperty:"common",transitionDuration:"slow",...Y$(e)}),eR=No(e=>({label:Q$,filledTrack:J$(e),track:Z$(e)})),tR={xs:No({track:{h:"1"}}),sm:No({track:{h:"2"}}),md:No({track:{h:"3"}}),lg:No({track:{h:"4"}})},nR=X$({sizes:tR,baseStyle:eR,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:rR,definePartsStyle:el}=ue(rE.keys),iR=e=>{var n;const t=(n=nt(qn.baseStyle,e))==null?void 0:n.control;return{...t,borderRadius:"full",_checked:{...t==null?void 0:t._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},oR=el(e=>{var t,n;return{label:(t=qn.baseStyle)==null?void 0:t.call(qn,e).label,container:(n=qn.baseStyle)==null?void 0:n.call(qn,e).container,control:iR(e)}}),sR={md:el({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:el({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:el({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},aR=rR({baseStyle:oR,sizes:sR,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:lR,definePartsStyle:uR}=ue(iE.keys),ba=U("select-bg");var jv;const cR={...(jv=ne.baseStyle)==null?void 0:jv.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:ba.reference,[ba.variable]:"colors.white",_dark:{[ba.variable]:"colors.gray.700"},"> option, > optgroup":{bg:ba.reference}},dR={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},fR=uR({field:cR,icon:dR}),Sa={paddingInlineEnd:"8"};var Nv,Fv,Bv,Vv,Uv,Wv,Hv,Kv;const hR={lg:{...(Nv=ne.sizes)==null?void 0:Nv.lg,field:{...(Fv=ne.sizes)==null?void 0:Fv.lg.field,...Sa}},md:{...(Bv=ne.sizes)==null?void 0:Bv.md,field:{...(Vv=ne.sizes)==null?void 0:Vv.md.field,...Sa}},sm:{...(Uv=ne.sizes)==null?void 0:Uv.sm,field:{...(Wv=ne.sizes)==null?void 0:Wv.sm.field,...Sa}},xs:{...(Hv=ne.sizes)==null?void 0:Hv.xs,field:{...(Kv=ne.sizes)==null?void 0:Kv.xs.field,...Sa},icon:{insetEnd:"1"}}},pR=lR({baseStyle:fR,sizes:hR,variants:ne.variants,defaultProps:ne.defaultProps}),Oc=U("skeleton-start-color"),Lc=U("skeleton-end-color"),mR={[Oc.variable]:"colors.gray.100",[Lc.variable]:"colors.gray.400",_dark:{[Oc.variable]:"colors.gray.800",[Lc.variable]:"colors.gray.600"},background:Oc.reference,borderColor:Lc.reference,opacity:.7,borderRadius:"sm"},gR={baseStyle:mR},Mc=U("skip-link-bg"),yR={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[Mc.variable]:"colors.white",_dark:{[Mc.variable]:"colors.gray.700"},bg:Mc.reference}},vR={baseStyle:yR},{defineMultiStyleConfig:bR,definePartsStyle:xu}=ue(oE.keys),gs=U("slider-thumb-size"),ys=U("slider-track-size"),Qn=U("slider-bg"),SR=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...Ah({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},xR=e=>({...Ah({orientation:e.orientation,horizontal:{h:ys.reference},vertical:{w:ys.reference}}),overflow:"hidden",borderRadius:"sm",[Qn.variable]:"colors.gray.200",_dark:{[Qn.variable]:"colors.whiteAlpha.200"},_disabled:{[Qn.variable]:"colors.gray.300",_dark:{[Qn.variable]:"colors.whiteAlpha.300"}},bg:Qn.reference}),wR=e=>{const{orientation:t}=e;return{...Ah({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:gs.reference,h:gs.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},kR=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[Qn.variable]:`colors.${t}.500`,_dark:{[Qn.variable]:`colors.${t}.200`},bg:Qn.reference}},CR=xu(e=>({container:SR(e),track:xR(e),thumb:wR(e),filledTrack:kR(e)})),TR=xu({container:{[gs.variable]:"sizes.4",[ys.variable]:"sizes.1"}}),PR=xu({container:{[gs.variable]:"sizes.3.5",[ys.variable]:"sizes.1"}}),ER=xu({container:{[gs.variable]:"sizes.2.5",[ys.variable]:"sizes.0.5"}}),_R={lg:TR,md:PR,sm:ER},$R=bR({baseStyle:CR,sizes:_R,defaultProps:{size:"md",colorScheme:"blue"}}),Mr=Me("spinner-size"),RR={width:[Mr.reference],height:[Mr.reference]},AR={xs:{[Mr.variable]:"sizes.3"},sm:{[Mr.variable]:"sizes.4"},md:{[Mr.variable]:"sizes.6"},lg:{[Mr.variable]:"sizes.8"},xl:{[Mr.variable]:"sizes.12"}},OR={baseStyle:RR,sizes:AR,defaultProps:{size:"md"}},{defineMultiStyleConfig:LR,definePartsStyle:L1}=ue(sE.keys),MR={fontWeight:"medium"},zR={opacity:.8,marginBottom:"2"},IR={verticalAlign:"baseline",fontWeight:"semibold"},DR={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},jR=L1({container:{},label:MR,helpText:zR,number:IR,icon:DR}),NR={md:L1({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},FR=LR({baseStyle:jR,sizes:NR,defaultProps:{size:"md"}}),{defineMultiStyleConfig:BR,definePartsStyle:Fo}=ue(["stepper","step","title","description","indicator","separator","icon","number"]),xn=U("stepper-indicator-size"),mi=U("stepper-icon-size"),gi=U("stepper-title-font-size"),Bo=U("stepper-description-font-size"),wo=U("stepper-accent-color"),VR=Fo(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[wo.variable]:`colors.${e}.500`,_dark:{[wo.variable]:`colors.${e}.200`}},title:{fontSize:gi.reference,fontWeight:"medium"},description:{fontSize:Bo.reference,color:"chakra-subtle-text"},number:{fontSize:gi.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:mi.reference,height:mi.reference},indicator:{flexShrink:0,borderRadius:"full",width:xn.reference,height:xn.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:wo.reference},"&[data-status=complete]":{bg:wo.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:wo.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${xn.reference} - 8px)`,top:`calc(${xn.reference} + 4px)`,insetStart:`calc(${xn.reference} / 2 - 1px)`}}})),UR=BR({baseStyle:VR,sizes:{xs:Fo({stepper:{[xn.variable]:"sizes.4",[mi.variable]:"sizes.3",[gi.variable]:"fontSizes.xs",[Bo.variable]:"fontSizes.xs"}}),sm:Fo({stepper:{[xn.variable]:"sizes.6",[mi.variable]:"sizes.4",[gi.variable]:"fontSizes.sm",[Bo.variable]:"fontSizes.xs"}}),md:Fo({stepper:{[xn.variable]:"sizes.8",[mi.variable]:"sizes.5",[gi.variable]:"fontSizes.md",[Bo.variable]:"fontSizes.sm"}}),lg:Fo({stepper:{[xn.variable]:"sizes.10",[mi.variable]:"sizes.6",[gi.variable]:"fontSizes.lg",[Bo.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:WR,definePartsStyle:tl}=ue(aE.keys),Jo=Me("switch-track-width"),Vr=Me("switch-track-height"),zc=Me("switch-track-diff"),HR=Sn.subtract(Jo,Vr),Kd=Me("switch-thumb-x"),ko=Me("switch-bg"),KR=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Jo.reference],height:[Vr.reference],transitionProperty:"common",transitionDuration:"fast",[ko.variable]:"colors.gray.300",_dark:{[ko.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[ko.variable]:`colors.${t}.500`,_dark:{[ko.variable]:`colors.${t}.200`}},bg:ko.reference}},GR={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Vr.reference],height:[Vr.reference],_checked:{transform:`translateX(${Kd.reference})`}},qR=tl(e=>({container:{[zc.variable]:HR,[Kd.variable]:zc.reference,_rtl:{[Kd.variable]:Sn(zc).negate().toString()}},track:KR(e),thumb:GR})),XR={sm:tl({container:{[Jo.variable]:"1.375rem",[Vr.variable]:"sizes.3"}}),md:tl({container:{[Jo.variable]:"1.875rem",[Vr.variable]:"sizes.4"}}),lg:tl({container:{[Jo.variable]:"2.875rem",[Vr.variable]:"sizes.6"}})},YR=WR({baseStyle:qR,sizes:XR,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:QR,definePartsStyle:Di}=ue(lE.keys),ZR=Di({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),El={"&[data-is-numeric=true]":{textAlign:"end"}},JR=Di(e=>{const{colorScheme:t}=e;return{th:{color:V("gray.600","gray.400")(e),borderBottom:"1px",borderColor:V(`${t}.100`,`${t}.700`)(e),...El},td:{borderBottom:"1px",borderColor:V(`${t}.100`,`${t}.700`)(e),...El},caption:{color:V("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),eA=Di(e=>{const{colorScheme:t}=e;return{th:{color:V("gray.600","gray.400")(e),borderBottom:"1px",borderColor:V(`${t}.100`,`${t}.700`)(e),...El},td:{borderBottom:"1px",borderColor:V(`${t}.100`,`${t}.700`)(e),...El},caption:{color:V("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:V(`${t}.100`,`${t}.700`)(e)},td:{background:V(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),tA={simple:JR,striped:eA,unstyled:{}},nA={sm:Di({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:Di({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:Di({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},rA=QR({baseStyle:ZR,variants:tA,sizes:nA,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),lt=U("tabs-color"),Ut=U("tabs-bg"),xa=U("tabs-border-color"),{defineMultiStyleConfig:iA,definePartsStyle:un}=ue(uE.keys),oA=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},sA=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},aA=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},lA={p:4},uA=un(e=>({root:oA(e),tab:sA(e),tablist:aA(e),tabpanel:lA})),cA={sm:un({tab:{py:1,px:4,fontSize:"sm"}}),md:un({tab:{fontSize:"md",py:2,px:4}}),lg:un({tab:{fontSize:"lg",py:3,px:4}})},dA=un(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=r?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[lt.variable]:`colors.${t}.600`,_dark:{[lt.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Ut.variable]:"colors.gray.200",_dark:{[Ut.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:lt.reference,bg:Ut.reference}}}),fA=un(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[xa.variable]:"transparent",_selected:{[lt.variable]:`colors.${t}.600`,[xa.variable]:"colors.white",_dark:{[lt.variable]:`colors.${t}.300`,[xa.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:xa.reference},color:lt.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),hA=un(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Ut.variable]:"colors.gray.50",_dark:{[Ut.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Ut.variable]:"colors.white",[lt.variable]:`colors.${t}.600`,_dark:{[Ut.variable]:"colors.gray.800",[lt.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:lt.reference,bg:Ut.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),pA=un(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:tt(n,`${t}.700`),bg:tt(n,`${t}.100`)}}}}),mA=un(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[lt.variable]:"colors.gray.600",_dark:{[lt.variable]:"inherit"},_selected:{[lt.variable]:"colors.white",[Ut.variable]:`colors.${t}.600`,_dark:{[lt.variable]:"colors.gray.800",[Ut.variable]:`colors.${t}.300`}},color:lt.reference,bg:Ut.reference}}}),gA=un({}),yA={line:dA,enclosed:fA,"enclosed-colored":hA,"soft-rounded":pA,"solid-rounded":mA,unstyled:gA},vA=iA({baseStyle:uA,sizes:cA,variants:yA,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:bA,definePartsStyle:Ur}=ue(cE.keys),dg=U("tag-bg"),fg=U("tag-color"),Ic=U("tag-shadow"),nl=U("tag-min-height"),rl=U("tag-min-width"),il=U("tag-font-size"),ol=U("tag-padding-inline"),SA={fontWeight:"medium",lineHeight:1.2,outline:0,[fg.variable]:Pe.color.reference,[dg.variable]:Pe.bg.reference,[Ic.variable]:Pe.shadow.reference,color:fg.reference,bg:dg.reference,boxShadow:Ic.reference,borderRadius:"md",minH:nl.reference,minW:rl.reference,fontSize:il.reference,px:ol.reference,_focusVisible:{[Ic.variable]:"shadows.outline"}},xA={lineHeight:1.2,overflow:"visible"},wA={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},kA=Ur({container:SA,label:xA,closeButton:wA}),CA={sm:Ur({container:{[nl.variable]:"sizes.5",[rl.variable]:"sizes.5",[il.variable]:"fontSizes.xs",[ol.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Ur({container:{[nl.variable]:"sizes.6",[rl.variable]:"sizes.6",[il.variable]:"fontSizes.sm",[ol.variable]:"space.2"}}),lg:Ur({container:{[nl.variable]:"sizes.8",[rl.variable]:"sizes.8",[il.variable]:"fontSizes.md",[ol.variable]:"space.3"}})},TA={subtle:Ur(e=>{var t;return{container:(t=Yo.variants)==null?void 0:t.subtle(e)}}),solid:Ur(e=>{var t;return{container:(t=Yo.variants)==null?void 0:t.solid(e)}}),outline:Ur(e=>{var t;return{container:(t=Yo.variants)==null?void 0:t.outline(e)}})},PA=bA({variants:TA,baseStyle:kA,sizes:CA,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}});var Gv;const EA={...(Gv=ne.baseStyle)==null?void 0:Gv.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"};var qv;const _A={outline:e=>{var t;return((t=ne.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=ne.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=ne.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((qv=ne.variants)==null?void 0:qv.unstyled.field)??{}};var Xv,Yv,Qv,Zv;const $A={xs:((Xv=ne.sizes)==null?void 0:Xv.xs.field)??{},sm:((Yv=ne.sizes)==null?void 0:Yv.sm.field)??{},md:((Qv=ne.sizes)==null?void 0:Qv.md.field)??{},lg:((Zv=ne.sizes)==null?void 0:Zv.lg.field)??{}},RA={baseStyle:EA,sizes:$A,variants:_A,defaultProps:{size:"md",variant:"outline"}},wa=Me("tooltip-bg"),Dc=Me("tooltip-fg"),AA=Me("popper-arrow-bg"),OA={bg:wa.reference,color:Dc.reference,[wa.variable]:"colors.gray.700",[Dc.variable]:"colors.whiteAlpha.900",_dark:{[wa.variable]:"colors.gray.300",[Dc.variable]:"colors.gray.900"},[AA.variable]:wa.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},LA={baseStyle:OA},MA={Accordion:bE,Alert:n2,Avatar:h2,Badge:Yo,Breadcrumb:k2,Button:O2,Checkbox:qn,CloseButton:G2,Code:Q2,Container:J2,Divider:i_,Drawer:m_,Editable:w_,Form:__,FormError:M_,FormLabel:I_,Heading:N_,Input:ne,Kbd:X_,Link:Q_,List:n$,Menu:h$,Modal:C$,NumberInput:L$,PinInput:D$,Popover:q$,Progress:nR,Radio:aR,Select:pR,Skeleton:gR,SkipLink:vR,Slider:$R,Spinner:OR,Stat:FR,Switch:YR,Table:rA,Tabs:vA,Tag:PA,Textarea:RA,Tooltip:LA,Card:D2,Stepper:UR},zA={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},IA={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},DA={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"}},jA={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},NA={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},FA={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},BA={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},VA={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},UA={property:FA,easing:BA,duration:VA},WA={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},HA={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},KA={breakpoints:IA,zIndices:WA,radii:jA,blur:HA,colors:DA,...R1,sizes:C1,shadows:NA,space:k1,borders:zA,transition:UA},GA={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},qA={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},XA="ltr",YA={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},QA={semanticTokens:GA,direction:XA,...KA,components:MA,styles:qA,config:YA};var ZA=!1;function JA(e){if(e.sheet)return e.sheet;for(var t=0;t0?Fe(co,--ht):0,Xi--,Ee===10&&(Xi=1,ku--),Ee}function bt(){return Ee=ht2||bs(Ee)>3?"":" "}function fO(e,t){for(;--t&&bt()&&!(Ee<48||Ee>102||Ee>57&&Ee<65||Ee>70&&Ee<97););return Xs(e,sl()+(t<6&&cn()==32&&bt()==32))}function qd(e){for(;bt();)switch(Ee){case e:return ht;case 34:case 39:e!==34&&e!==39&&qd(Ee);break;case 40:e===41&&qd(e);break;case 92:bt();break}return ht}function hO(e,t){for(;bt()&&e+Ee!==57;)if(e+Ee===84&&cn()===47)break;return"/*"+Xs(t,ht-1)+"*"+wu(e===47?e:bt())}function pO(e){for(;!bs(cn());)bt();return Xs(e,ht)}function mO(e){return N1(ll("",null,null,null,[""],e=j1(e),0,[0],e))}function ll(e,t,n,r,i,o,s,a,l){for(var u=0,c=0,d=s,f=0,p=0,v=0,y=1,S=1,m=1,h=0,g="",w=i,P=o,$=r,_=g;S;)switch(v=h,h=bt()){case 40:if(v!=108&&Fe(_,d-1)==58){Gd(_+=te(al(h),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:_+=al(h);break;case 9:case 10:case 13:case 32:_+=dO(v);break;case 92:_+=fO(sl()-1,7);continue;case 47:switch(cn()){case 42:case 47:ka(gO(hO(bt(),sl()),t,n),l);break;default:_+="/"}break;case 123*y:a[u++]=tn(_)*m;case 125*y:case 59:case 0:switch(h){case 0:case 125:S=0;case 59+c:m==-1&&(_=te(_,/\f/g,"")),p>0&&tn(_)-d&&ka(p>32?pg(_+";",r,n,d-1):pg(te(_," ","")+";",r,n,d-2),l);break;case 59:_+=";";default:if(ka($=hg(_,t,n,u,c,i,a,g,w=[],P=[],d),o),h===123)if(c===0)ll(_,t,$,$,w,o,d,a,P);else switch(f===99&&Fe(_,3)===110?100:f){case 100:case 108:case 109:case 115:ll(e,$,$,r&&ka(hg(e,$,$,0,0,i,a,g,i,w=[],d),P),i,P,d,a,r?w:P);break;default:ll(_,$,$,$,[""],P,0,a,P)}}u=c=p=0,y=m=1,g=_="",d=s;break;case 58:d=1+tn(_),p=v;default:if(y<1){if(h==123)--y;else if(h==125&&y++==0&&cO()==125)continue}switch(_+=wu(h),h*y){case 38:m=c>0?1:(_+="\f",-1);break;case 44:a[u++]=(tn(_)-1)*m,m=1;break;case 64:cn()===45&&(_+=al(bt())),f=cn(),c=d=tn(g=_+=pO(sl())),h++;break;case 45:v===45&&tn(_)==2&&(y=0)}}return o}function hg(e,t,n,r,i,o,s,a,l,u,c){for(var d=i-1,f=i===0?o:[""],p=Dh(f),v=0,y=0,S=0;v0?f[m]+" "+h:te(h,/&\f/g,f[m])))&&(l[S++]=g);return Cu(e,t,n,i===0?zh:a,l,u,c)}function gO(e,t,n){return Cu(e,t,n,M1,wu(uO()),vs(e,2,-2),0)}function pg(e,t,n,r){return Cu(e,t,n,Ih,vs(e,0,r),vs(e,r+1,-1),r)}function ji(e,t){for(var n="",r=Dh(e),i=0;i6)switch(Fe(e,t+1)){case 109:if(Fe(e,t+4)!==45)break;case 102:return te(e,/(.+:)(.+)-([^]+)/,"$1"+ee+"$2-$3$1"+_l+(Fe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Gd(e,"stretch")?B1(te(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Fe(e,t+1)!==115)break;case 6444:switch(Fe(e,tn(e)-3-(~Gd(e,"!important")&&10))){case 107:return te(e,":",":"+ee)+e;case 101:return te(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ee+(Fe(e,14)===45?"inline-":"")+"box$3$1"+ee+"$2$3$1"+He+"$2box$3")+e}break;case 5936:switch(Fe(e,t+11)){case 114:return ee+e+He+te(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ee+e+He+te(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ee+e+He+te(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ee+e+He+e+e}return e}var TO=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Ih:t.return=B1(t.value,t.length);break;case z1:return ji([Co(t,{value:te(t.value,"@","@"+ee)})],i);case zh:if(t.length)return lO(t.props,function(o){switch(aO(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ji([Co(t,{props:[te(o,/:(read-\w+)/,":"+_l+"$1")]})],i);case"::placeholder":return ji([Co(t,{props:[te(o,/:(plac\w+)/,":"+ee+"input-$1")]}),Co(t,{props:[te(o,/:(plac\w+)/,":"+_l+"$1")]}),Co(t,{props:[te(o,/:(plac\w+)/,He+"input-$1")]})],i)}return""})}},PO=[TO],EO=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var S=y.getAttribute("data-emotion");S.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=t.stylisPlugins||PO,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(y){for(var S=y.getAttribute("data-emotion").split(" "),m=1;m=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var jO={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},NO=!1,FO=/[A-Z]|^ms/g,BO=/_EMO_([^_]+?)_([^]*?)_EMO_/g,G1=function(t){return t.charCodeAt(1)===45},yg=function(t){return t!=null&&typeof t!="boolean"},jc=F1(function(e){return G1(e)?e:e.replace(FO,"-$&").toLowerCase()}),vg=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(BO,function(r,i,o){return nn={name:i,styles:o,next:nn},i})}return jO[t]!==1&&!G1(t)&&typeof n=="number"&&n!==0?n+"px":n},VO="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Ss(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return nn={name:i.name,styles:i.styles,next:nn},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)nn={name:s.name,styles:s.styles,next:nn},s=s.next;var a=o.styles+";";return a}return UO(e,t,n)}case"function":{if(e!==void 0){var l=nn,u=n(e);return nn=l,Ss(e,t,u)}break}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function UO(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{const o=t?r.preventTransition():void 0;document.documentElement.dataset.theme=i,document.documentElement.style.colorScheme=i,o==null||o()},setClassName(i){document.body.classList.add(i?Ca.dark:Ca.light),document.body.classList.remove(i?Ca.light:Ca.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(i){return r.query().matches??i==="dark"?"dark":"light"},addListener(i){const o=r.query(),s=a=>{i(a.matches?"dark":"light")};return typeof o.addListener=="function"?o.addListener(s):o.addEventListener("change",s),()=>{typeof o.removeListener=="function"?o.removeListener(s):o.removeEventListener("change",s)}},preventTransition(){const i=document.createElement("style");return i.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),n!==void 0&&(i.nonce=n),document.head.appendChild(i),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(i)})})}}};return r}const nL="chakra-ui-color-mode";function rL(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}const iL=rL(nL),wg=()=>{},oL=mT()?x.useLayoutEffect:x.useEffect;function kg(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}const Q1=Iu(function(t,n){const{value:r,children:i,options:{useSystemColorMode:o,initialColorMode:s,disableTransitionOnChange:a}={},colorModeManager:l=iL}=t,u=s==="dark"?"dark":"light",[c,d]=x.useState(()=>kg(l,u)),[f,p]=x.useState(()=>kg(l)),{getSystemTheme:v,setClassName:y,setDataset:S,addListener:m}=x.useMemo(()=>tL({preventTransition:a,nonce:n==null?void 0:n.nonce}),[a,n==null?void 0:n.nonce]),h=s==="system"&&!c?f:c,g=x.useCallback($=>{const _=$==="system"?v():$;d(_),y(_==="dark"),S(_),l.set(_)},[l,v,y,S]);oL(()=>{s==="system"&&p(v())},[]),x.useEffect(()=>{const $=l.get();if($){g($);return}if(s==="system"){g("system");return}g(u)},[l,u,s,g]);const w=x.useCallback(()=>{g(h==="dark"?"light":"dark")},[h,g]);x.useEffect(()=>{if(o)return m(g)},[o,m,g]);const P=x.useMemo(()=>({colorMode:r??h,toggleColorMode:r?wg:w,setColorMode:r?wg:g,forced:r!==void 0}),[h,w,g,r]);return O.jsx(Wh.Provider,{value:P,children:i})});Q1.displayName="ColorModeProvider";const Z1=String.raw,J1=Z1` - :root, - :host { - --chakra-vh: 100vh; - } - - @supports (height: -webkit-fill-available) { - :root, - :host { - --chakra-vh: -webkit-fill-available; - } - } - - @supports (height: -moz-fill-available) { - :root, - :host { - --chakra-vh: -moz-fill-available; - } - } - - @supports (height: 100dvh) { - :root, - :host { - --chakra-vh: 100dvh; - } - } -`,sL=()=>O.jsx(Du,{styles:J1}),aL=({scope:e=""})=>O.jsx(Du,{styles:Z1` - html { - line-height: 1.5; - -webkit-text-size-adjust: 100%; - font-family: system-ui, sans-serif; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; - -moz-osx-font-smoothing: grayscale; - touch-action: manipulation; - } - - body { - position: relative; - min-height: 100%; - margin: 0; - font-feature-settings: "kern"; - } - - ${e} :where(*, *::before, *::after) { - border-width: 0; - border-style: solid; - box-sizing: border-box; - word-wrap: break-word; - } - - main { - display: block; - } - - ${e} hr { - border-top-width: 1px; - box-sizing: content-box; - height: 0; - overflow: visible; - } - - ${e} :where(pre, code, kbd,samp) { - font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; - font-size: 1em; - } - - ${e} a { - background-color: transparent; - color: inherit; - text-decoration: inherit; - } - - ${e} abbr[title] { - border-bottom: none; - text-decoration: underline; - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; - } - - ${e} :where(b, strong) { - font-weight: bold; - } - - ${e} small { - font-size: 80%; - } - - ${e} :where(sub,sup) { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; - } - - ${e} sub { - bottom: -0.25em; - } - - ${e} sup { - top: -0.5em; - } - - ${e} img { - border-style: none; - } - - ${e} :where(button, input, optgroup, select, textarea) { - font-family: inherit; - font-size: 100%; - line-height: 1.15; - margin: 0; - } - - ${e} :where(button, input) { - overflow: visible; - } - - ${e} :where(button, select) { - text-transform: none; - } - - ${e} :where( - button::-moz-focus-inner, - [type="button"]::-moz-focus-inner, - [type="reset"]::-moz-focus-inner, - [type="submit"]::-moz-focus-inner - ) { - border-style: none; - padding: 0; - } - - ${e} fieldset { - padding: 0.35em 0.75em 0.625em; - } - - ${e} legend { - box-sizing: border-box; - color: inherit; - display: table; - max-width: 100%; - padding: 0; - white-space: normal; - } - - ${e} progress { - vertical-align: baseline; - } - - ${e} textarea { - overflow: auto; - } - - ${e} :where([type="checkbox"], [type="radio"]) { - box-sizing: border-box; - padding: 0; - } - - ${e} input[type="number"]::-webkit-inner-spin-button, - ${e} input[type="number"]::-webkit-outer-spin-button { - -webkit-appearance: none !important; - } - - ${e} input[type="number"] { - -moz-appearance: textfield; - } - - ${e} input[type="search"] { - -webkit-appearance: textfield; - outline-offset: -2px; - } - - ${e} input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none !important; - } - - ${e} ::-webkit-file-upload-button { - -webkit-appearance: button; - font: inherit; - } - - ${e} details { - display: block; - } - - ${e} summary { - display: list-item; - } - - template { - display: none; - } - - [hidden] { - display: none !important; - } - - ${e} :where( - blockquote, - dl, - dd, - h1, - h2, - h3, - h4, - h5, - h6, - hr, - figure, - p, - pre - ) { - margin: 0; - } - - ${e} button { - background: transparent; - padding: 0; - } - - ${e} fieldset { - margin: 0; - padding: 0; - } - - ${e} :where(ol, ul) { - margin: 0; - padding: 0; - } - - ${e} textarea { - resize: vertical; - } - - ${e} :where(button, [role="button"]) { - cursor: pointer; - } - - ${e} button::-moz-focus-inner { - border: 0 !important; - } - - ${e} table { - border-collapse: collapse; - } - - ${e} :where(h1, h2, h3, h4, h5, h6) { - font-size: inherit; - font-weight: inherit; - } - - ${e} :where(button, input, optgroup, select, textarea) { - padding: 0; - line-height: inherit; - color: inherit; - } - - ${e} :where(img, svg, video, canvas, audio, iframe, embed, object) { - display: block; - } - - ${e} :where(img, video) { - max-width: 100%; - height: auto; - } - - [data-js-focus-visible] - :focus:not([data-focus-visible-added]):not( - [data-focus-visible-disabled] - ) { - outline: none; - box-shadow: none; - } - - ${e} select::-ms-expand { - display: none; - } - - ${J1} - `});function lL(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=x.useMemo(()=>FP(n),[n]);return O.jsxs(qO,{theme:i,children:[O.jsx(uL,{root:t}),r]})}function uL({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return O.jsx(Du,{styles:n=>({[t]:n.__cssVars})})}Xt({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function ZF(e){return Xt({name:`${e}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${e} />" `})}function cL(){const{colorMode:e}=Hh();return O.jsx(Du,{styles:t=>{const n=h1(t,"styles.global"),r=sn(n,{theme:t,colorMode:e});return r?b1(r)(t):void 0}})}const[dL,fL]=Xt({strict:!1,name:"PortalManagerContext"});function eb(e){const{children:t,zIndex:n}=e;return O.jsx(dL,{value:{zIndex:n},children:t})}eb.displayName="PortalManager";const tb=x.createContext({getDocument(){return document},getWindow(){return window}});tb.displayName="EnvironmentContext";function nb(e){const{children:t,environment:n,disabled:r}=e,i=x.useRef(null),o=x.useMemo(()=>n||{getDocument:()=>{var a;return((a=i.current)==null?void 0:a.ownerDocument)??document},getWindow:()=>{var a;return((a=i.current)==null?void 0:a.ownerDocument.defaultView)??window}},[n]),s=!r||!n;return O.jsxs(tb.Provider,{value:o,children:[t,s&&O.jsx("span",{id:"__chakra_env",hidden:!0,ref:i})]})}nb.displayName="EnvironmentProvider";const hL=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetScope:i,resetCSS:o=!0,theme:s={},environment:a,cssVarsRoot:l,disableEnvironment:u,disableGlobalStyle:c}=e,d=O.jsx(nb,{environment:a,disabled:u,children:t});return O.jsx(lL,{theme:s,cssVarsRoot:l,children:O.jsxs(Q1,{colorModeManager:n,options:s.config,children:[o?O.jsx(aL,{scope:i}):O.jsx(sL,{}),!c&&O.jsx(cL,{}),r?O.jsx(eb,{zIndex:r,children:d}):d]})})};function pL(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function xs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Yd=e=>Array.isArray(e);function rb(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Kh(e,t,n,r){if(typeof t=="function"){const[i,o]=Cg(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=Cg(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function ju(e,t,n){const r=e.getProps();return Kh(r,t,n!==void 0?n:r.custom,e)}const Gh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qh=["initial",...Gh],Ys=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],yr=new Set(Ys),_n=e=>e*1e3,$n=e=>e/1e3,mL={type:"spring",stiffness:500,damping:25,restSpeed:10},gL=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),yL={type:"keyframes",duration:.8},vL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bL=(e,{keyframes:t})=>t.length>2?yL:yr.has(e)?e.startsWith("scale")?gL(t[1]):mL:vL;function Xh(e,t){return e[t]||e.default||e}const SL={skipAnimations:!1,useManualTiming:!1},xL=e=>e!==null;function Nu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(xL),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const Xe=e=>e;function wL(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(u){o.has(u)&&(l.schedule(u),e()),u(s)}const l={schedule:(u,c=!1,d=!1)=>{const p=d&&r?t:n;return c&&o.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),o.delete(u)},process:u=>{if(s=u,r){i=!0;return}r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,i&&(i=!1,l.process(u))}};return l}const Ta=["read","resolveKeyframes","update","preRender","render","postRender"],kL=40;function ib(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Ta.reduce((m,h)=>(m[h]=wL(o),m),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=s,p=()=>{const m=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(m-i.timestamp,kL),1),i.timestamp=m,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},v=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Ta.reduce((m,h)=>{const g=s[h];return m[h]=(w,P=!1,$=!1)=>(n||v(),g.schedule(w,P,$)),m},{}),cancel:m=>{for(let h=0;h(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,CL=1e-7,TL=12;function PL(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=ob(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>CL&&++aPL(o,0,1,e,n);return o=>o===0||o===1?o:ob(i(o),t,r)}const sb=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ab=e=>t=>1-e(1-t),lb=Qs(.33,1.53,.69,.99),Yh=ab(lb),ub=sb(Yh),cb=e=>(e*=2)<1?.5*Yh(e):.5*(2-Math.pow(2,-10*(e-1))),Qh=e=>1-Math.sin(Math.acos(e)),db=ab(Qh),fb=sb(Qh),hb=e=>/^0[^.\s]+$/u.test(e);function EL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||hb(e):!0}let Qd=Xe;const pb=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),mb=e=>t=>typeof t=="string"&&t.startsWith(e),gb=mb("--"),_L=mb("var(--"),Zh=e=>_L(e)?$L.test(e.split("/*")[0].trim()):!1,$L=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,RL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function AL(e){const t=RL.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function yb(e,t,n=1){const[r,i]=AL(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return pb(s)?parseFloat(s):s}return Zh(i)?yb(i,t,n+1):i}const hr=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},ks={...fo,transform:e=>hr(0,1,e)},Pa={...fo,default:1},Zs=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Kn=Zs("deg"),dn=Zs("%"),W=Zs("px"),OL=Zs("vh"),LL=Zs("vw"),Tg={...dn,parse:e=>dn.parse(e)/100,transform:e=>dn.transform(e*100)},ML=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Pg=e=>e===fo||e===W,Eg=(e,t)=>parseFloat(e.split(", ")[t]),_g=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Eg(i[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?Eg(o[1],e):0}},zL=new Set(["x","y","z"]),IL=Ys.filter(e=>!zL.has(e));function DL(e){const t=[];return IL.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Qi={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:_g(4,13),y:_g(5,14)};Qi.translateX=Qi.x;Qi.translateY=Qi.y;const vb=e=>t=>t.test(e),jL={test:e=>e==="auto",parse:e=>e},bb=[fo,W,dn,Kn,LL,OL,jL],$g=e=>bb.find(vb(e)),Wr=new Set;let Zd=!1,Jd=!1;function Sb(){if(Jd){const e=Array.from(Wr).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=DL(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,s])=>{var a;(a=r.getValue(o))===null||a===void 0||a.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Jd=!1,Zd=!1,Wr.forEach(e=>e.complete()),Wr.clear()}function xb(){Wr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Jd=!0)})}function NL(){xb(),Sb()}class Jh{constructor(t,n,r,i,o,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Wr.add(this),Zd||(Zd=!0,se.read(xb),se.resolveKeyframes(Sb))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let o=0;oMath.round(e*1e5)/1e5,ep=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function FL(e){return e==null}const BL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tp=(e,t)=>n=>!!(typeof n=="string"&&BL.test(n)&&n.startsWith(e)||t&&!FL(n)&&Object.prototype.hasOwnProperty.call(n,t)),wb=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,a]=r.match(ep);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},VL=e=>hr(0,255,e),Fc={...fo,transform:e=>Math.round(VL(e))},Ir={test:tp("rgb","red"),parse:wb("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Fc.transform(e)+", "+Fc.transform(t)+", "+Fc.transform(n)+", "+es(ks.transform(r))+")"};function UL(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const ef={test:tp("#"),parse:UL,transform:Ir.transform},yi={test:tp("hsl","hue"),parse:wb("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+dn.transform(es(t))+", "+dn.transform(es(n))+", "+es(ks.transform(r))+")"},Ke={test:e=>Ir.test(e)||ef.test(e)||yi.test(e),parse:e=>Ir.test(e)?Ir.parse(e):yi.test(e)?yi.parse(e):ef.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ir.transform(e):yi.transform(e)},WL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function HL(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ep))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(WL))===null||n===void 0?void 0:n.length)||0)>0}const kb="number",Cb="color",KL="var",GL="var(",Rg="${}",qL=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Cs(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(qL,l=>(Ke.test(l)?(r.color.push(o),i.push(Cb),n.push(Ke.parse(l))):l.startsWith(GL)?(r.var.push(o),i.push(KL),n.push(l)):(r.number.push(o),i.push(kb),n.push(parseFloat(l))),++o,Rg)).split(Rg);return{values:n,split:a,indexes:r,types:i}}function Tb(e){return Cs(e).values}function Pb(e){const{split:t,types:n}=Cs(e),r=t.length;return i=>{let o="";for(let s=0;stypeof e=="number"?0:e;function YL(e){const t=Tb(e);return Pb(e)(t.map(XL))}const pr={test:HL,parse:Tb,createTransformer:Pb,getAnimatableNone:YL},QL=new Set(["brightness","contrast","saturate","opacity"]);function ZL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ep)||[];if(!r)return e;const i=n.replace(r,"");let o=QL.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const JL=/\b([a-z-]*)\(.*?\)/gu,tf={...pr,getAnimatableNone:e=>{const t=e.match(JL);return t?t.map(ZL).join(" "):e}},e5={borderWidth:W,borderTopWidth:W,borderRightWidth:W,borderBottomWidth:W,borderLeftWidth:W,borderRadius:W,radius:W,borderTopLeftRadius:W,borderTopRightRadius:W,borderBottomRightRadius:W,borderBottomLeftRadius:W,width:W,maxWidth:W,height:W,maxHeight:W,top:W,right:W,bottom:W,left:W,padding:W,paddingTop:W,paddingRight:W,paddingBottom:W,paddingLeft:W,margin:W,marginTop:W,marginRight:W,marginBottom:W,marginLeft:W,backgroundPositionX:W,backgroundPositionY:W},t5={rotate:Kn,rotateX:Kn,rotateY:Kn,rotateZ:Kn,scale:Pa,scaleX:Pa,scaleY:Pa,scaleZ:Pa,skew:Kn,skewX:Kn,skewY:Kn,distance:W,translateX:W,translateY:W,translateZ:W,x:W,y:W,z:W,perspective:W,transformPerspective:W,opacity:ks,originX:Tg,originY:Tg,originZ:W},Ag={...fo,transform:Math.round},np={...e5,...t5,zIndex:Ag,size:W,fillOpacity:ks,strokeOpacity:ks,numOctaves:Ag},n5={...np,color:Ke,backgroundColor:Ke,outlineColor:Ke,fill:Ke,stroke:Ke,borderColor:Ke,borderTopColor:Ke,borderRightColor:Ke,borderBottomColor:Ke,borderLeftColor:Ke,filter:tf,WebkitFilter:tf},rp=e=>n5[e];function Eb(e,t){let n=rp(e);return n!==tf&&(n=pr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const r5=new Set(["auto","none","0"]);function i5(e,t,n){let r=0,i;for(;r{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function ip(e){return typeof e=="function"}let ul;function o5(){ul=void 0}const fn={now:()=>(ul===void 0&&fn.set(Ne.isProcessing||SL.useManualTiming?Ne.timestamp:performance.now()),ul),set:e=>{ul=e,queueMicrotask(o5)}},Og=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(pr.test(e)||e==="0")&&!e.startsWith("url("));function s5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nl5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&NL(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=fn.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:o,delay:s,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!a5(t,r,i,o))if(s)this.options.duration=0;else{l==null||l(Nu(t,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Rb(e,t){return t?e*(1e3/t):0}const u5=5;function Ab(e,t,n){const r=Math.max(t-u5,0);return Rb(n-e(r),t-r)}const Bc=.001,c5=.01,d5=10,f5=.05,h5=1;function p5({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o,s=1-t;s=hr(f5,h5,s),e=hr(c5,d5,$n(e)),s<1?(i=u=>{const c=u*s,d=c*e,f=c-n,p=nf(u,s),v=Math.exp(-d);return Bc-f/p*v},o=u=>{const d=u*s*e,f=d*n+n,p=Math.pow(s,2)*Math.pow(u,2)*e,v=Math.exp(-d),y=nf(Math.pow(u,2),s);return(-i(u)+Bc>0?-1:1)*((f-p)*v)/y}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Bc+c*d},o=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const a=5/e,l=g5(i,o,a);if(e=_n(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}const m5=12;function g5(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function b5(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Lg(e,v5)&&Lg(e,y5)){const n=p5(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function Ob({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],s={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:f}=b5({...r,velocity:-$n(r.velocity||0)}),p=d||0,v=l/(2*Math.sqrt(a*u)),y=o-i,S=$n(Math.sqrt(a/u)),m=Math.abs(y)<5;n||(n=m?.01:2),t||(t=m?.005:.5);let h;if(v<1){const g=nf(S,v);h=w=>{const P=Math.exp(-v*S*w);return o-P*((p+v*S*y)/g*Math.sin(g*w)+y*Math.cos(g*w))}}else if(v===1)h=g=>o-Math.exp(-S*g)*(y+(p+S*y)*g);else{const g=S*Math.sqrt(v*v-1);h=w=>{const P=Math.exp(-v*S*w),$=Math.min(g*w,300);return o-P*((p+v*S*y)*Math.sinh($)+g*y*Math.cosh($))/g}}return{calculatedDuration:f&&c||null,next:g=>{const w=h(g);if(f)s.done=g>=c;else{let P=0;v<1&&(P=g===0?_n(p):Ab(h,g,w));const $=Math.abs(P)<=n,_=Math.abs(o-w)<=t;s.done=$&&_}return s.value=s.done?o:w,s}}}function Mg({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},p=A=>a!==void 0&&Al,v=A=>a===void 0?l:l===void 0||Math.abs(a-A)-y*Math.exp(-A/r),g=A=>m+h(A),w=A=>{const B=h(A),j=g(A);f.done=Math.abs(B)<=u,f.value=f.done?m:j};let P,$;const _=A=>{p(f.value)&&(P=A,$=Ob({keyframes:[f.value,v(f.value)],velocity:Ab(g,A,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return _(0),{calculatedDuration:null,next:A=>{let B=!1;return!$&&P===void 0&&(B=!0,w(A),_(A)),P!==void 0&&A>=P?$.next(A-P):(!B&&w(A),f)}}}const S5=Qs(.42,0,1,1),x5=Qs(0,0,.58,1),Lb=Qs(.42,0,.58,1),w5=e=>Array.isArray(e)&&typeof e[0]!="number",zg={linear:Xe,easeIn:S5,easeInOut:Lb,easeOut:x5,circIn:Qh,circInOut:fb,circOut:db,backIn:Yh,backInOut:ub,backOut:lb,anticipate:cb},Ig=e=>{if(Array.isArray(e)){Qd(e.length===4);const[t,n,r,i]=e;return Qs(t,n,r,i)}else if(typeof e=="string")return Qd(zg[e]!==void 0),zg[e];return e},k5=(e,t)=>n=>t(e(n)),Rn=(...e)=>e.reduce(k5),Zi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},ve=(e,t,n)=>e+(t-e)*n;function Vc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function C5({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Vc(l,a,e+1/3),o=Vc(l,a,e),s=Vc(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function Rl(e,t){return n=>n>0?t:e}const Uc=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},T5=[ef,Ir,yi],P5=e=>T5.find(t=>t.test(e));function Dg(e){const t=P5(e);if(!t)return!1;let n=t.parse(e);return t===yi&&(n=C5(n)),n}const jg=(e,t)=>{const n=Dg(e),r=Dg(t);if(!n||!r)return Rl(e,t);const i={...n};return o=>(i.red=Uc(n.red,r.red,o),i.green=Uc(n.green,r.green,o),i.blue=Uc(n.blue,r.blue,o),i.alpha=ve(n.alpha,r.alpha,o),Ir.transform(i))},rf=new Set(["none","hidden"]);function E5(e,t){return rf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function _5(e,t){return n=>ve(e,t,n)}function op(e){return typeof e=="number"?_5:typeof e=="string"?Zh(e)?Rl:Ke.test(e)?jg:A5:Array.isArray(e)?Mb:typeof e=="object"?Ke.test(e)?jg:$5:Rl}function Mb(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>op(o)(o,t[s]));return o=>{for(let s=0;s{for(const o in r)n[o]=r[o](i);return n}}function R5(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let o=0;o{const n=pr.createTransformer(t),r=Cs(e),i=Cs(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?rf.has(e)&&!i.values.length||rf.has(t)&&!r.values.length?E5(e,t):Rn(Mb(R5(r,i),i.values),n):Rl(e,t)};function zb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ve(e,t,n):op(e)(e,t)}function O5(e,t,n){const r=[],i=n||zb,o=e.length-1;for(let s=0;st[0];if(o===2&&e[0]===e[1])return()=>t[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=O5(t,r,i),a=s.length,l=u=>{let c=0;if(a>1)for(;cl(hr(e[0],e[o-1],u)):l}function M5(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Zi(0,t,r);e.push(ve(n,1,i))}}function z5(e){const t=[0];return M5(t,e.length-1),t}function I5(e,t){return e.map(n=>n*t)}function D5(e,t){return e.map(()=>t||Lb).splice(0,e.length-1)}function Al({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=w5(r)?r.map(Ig):Ig(r),o={done:!1,value:t[0]},s=I5(n&&n.length===t.length?n:z5(t),e),a=L5(s,t,{ease:Array.isArray(i)?i:D5(t,i)});return{calculatedDuration:e,next:l=>(o.value=a(l),o.done=l>=e,o)}}const Ng=2e4;function j5(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=Ng?1/0:t}const N5=e=>{const t=({timestamp:n})=>e(n);return{start:()=>se.update(t,!0),stop:()=>fr(t),now:()=>Ne.isProcessing?Ne.timestamp:fn.now()}},F5={decay:Mg,inertia:Mg,tween:Al,keyframes:Al,spring:Ob},B5=e=>e/100;class sp extends $b{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:o}=this.options,s=(i==null?void 0:i.KeyframeResolver)||Jh,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(o,a,n,r,i),this.resolver.scheduleResolve()}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=this.options,a=ip(n)?n:F5[n]||Al;let l,u;a!==Al&&typeof t[0]!="number"&&(l=Rn(B5,zb(t[0],t[1])),t=[0,100]);const c=a({...this.options,keyframes:t});o==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=j5(c));const{calculatedDuration:d}=c,f=d+i,p=f*(r+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:s,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=r;if(this.startTime===null)return o.next(0);const{delay:f,repeat:p,repeatType:v,repeatDelay:y,onUpdate:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const m=this.currentTime-f*(this.speed>=0?1:-1),h=this.speed>=0?m<0:m>c;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let g=this.currentTime,w=o;if(p){const A=Math.min(this.currentTime,c)/d;let B=Math.floor(A),j=A%1;!j&&A>=1&&(j=1),j===1&&B--,B=Math.min(B,p+1),!!(B%2)&&(v==="reverse"?(j=1-j,y&&(j-=y/d)):v==="mirror"&&(w=s)),g=hr(0,1,j)*d}const P=h?{done:!1,value:l[0]}:w.next(g);a&&(P.value=a(P.value));let{done:$}=P;!h&&u!==null&&($=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return _&&i!==void 0&&(P.value=Nu(l,this.options,i)),S&&S(P.value),_&&this.finish(),P}get duration(){const{resolved:t}=this;return t?$n(t.calculatedDuration):0}get time(){return $n(this.currentTime)}set time(t){t=_n(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=$n(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=N5,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Ib=new Set(["opacity","clipPath","filter","transform"]),Db=e=>Array.isArray(e)&&typeof e[0]=="number",V5=10,U5=(e,t)=>{let n="";const r=Math.max(Math.round(t/V5),2);for(let i=0;i(t===void 0&&(t=e()),t)}const W5={linearEasing:void 0};function H5(e,t){const n=ap(e);return()=>{var r;return(r=W5[t])!==null&&r!==void 0?r:n()}}const Ol=H5(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function jb(e){return!!(typeof e=="function"&&Ol()||!e||typeof e=="string"&&(e in of||Ol())||Db(e)||Array.isArray(e)&&e.every(jb))}const Vo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,of={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vo([0,.65,.55,1]),circOut:Vo([.55,0,1,.45]),backIn:Vo([.31,.01,.66,-.59]),backOut:Vo([.33,1.53,.69,.99])};function Nb(e,t){if(e)return typeof e=="function"&&Ol()?U5(e,t):Db(e)?Vo(e):Array.isArray(e)?e.map(n=>Nb(n,t)||of.easeOut):of[e]}function K5(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=Nb(a,i);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}function Fg(e,t){e.timeline=t,e.onfinish=null}const G5=ap(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ll=10,q5=2e4;function X5(e){return ip(e.type)||e.type==="spring"||!jb(e.ease)}function Y5(e,t){const n=new sp({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let o=0;for(;!r.done&&othis.onKeyframesResolved(s,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:i=300,times:o,ease:s,type:a,motionValue:l,name:u,startTime:c}=this.options;if(!(!((r=l.owner)===null||r===void 0)&&r.current))return!1;if(typeof s=="string"&&Ol()&&Q5(s)&&(s=Fb[s]),X5(this.options)){const{onComplete:f,onUpdate:p,motionValue:v,element:y,...S}=this.options,m=Y5(t,S);t=m.keyframes,t.length===1&&(t[1]=t[0]),i=m.duration,o=m.times,s=m.ease,a="keyframes"}const d=K5(l.owner.current,u,t,{...this.options,duration:i,times:o,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(Fg(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Nu(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:o,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return $n(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return $n(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=_n(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Xe;const{animation:r}=n;Fg(r,t)}return Xe}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:o,ease:s,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:d,element:f,...p}=this.options,v=new sp({...p,keyframes:r,duration:i,type:o,ease:s,times:a,isGenerator:!0}),y=_n(this.time);u.setWithVelocity(v.sample(y-Ll).value,v.sample(y).value,Ll)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:o,damping:s,type:a}=t;return G5()&&r&&Ib.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&o!=="mirror"&&s!==0&&a!=="inertia"}}const Z5=ap(()=>window.ScrollTimeline!==void 0);class J5{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;rZ5()&&i.attachTimeline?i.attachTimeline(t):n(i));return()=>{r.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function eM({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const lp=(e,t,n,r={},i,o)=>s=>{const a=Xh(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-_n(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};eM(a)||(c={...c,...bL(e,c)}),c.duration&&(c.duration=_n(c.duration)),c.repeatDelay&&(c.repeatDelay=_n(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),d&&!o&&t.get()!==void 0){const f=Nu(c.keyframes,a);if(f!==void 0)return se.update(()=>{c.onUpdate(f),c.onComplete()}),new J5([])}return!o&&Bg.supports(c)?new Bg(c):new sp(c)},tM=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),nM=e=>Yd(e)?e[e.length-1]||0:e;function up(e,t){e.indexOf(t)===-1&&e.push(t)}function cp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class dp{constructor(){this.subscriptions=[]}add(t){return up(this.subscriptions,t),()=>cp(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class iM{constructor(t,n={}){this.version="11.11.1",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const o=fn.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=fn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=rM(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new dp);const r=this.events[t].add(n);return t==="change"?()=>{r(),se.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=fn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Vg)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Vg);return Rb(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ts(e,t){return new iM(e,t)}function oM(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ts(n))}function sM(e,t){const n=ju(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=nM(o[s]);oM(e,s,a)}}const Fu=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),aM="framerAppearId",Bb="data-"+Fu(aM);function Vb(e){return e.props[Bb]}const qe=e=>!!(e&&e.getVelocity);function lM(e){return!!(qe(e)&&e.add)}function Ub(e){if(yr.has(e))return"transform";if(Ib.has(e))return Fu(e)}function sf(e,t){var n;if(!e.applyWillChange)return;const r=e.getValue("willChange");if(lM(r))return r.add(t);!(!((n=e.props.style)===null||n===void 0)&&n.willChange)&&Ub(t)&&e.setStaticValue("willChange","transform")}function uM({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Wb(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in l){const f=e.getValue(d,(o=e.latestValues[d])!==null&&o!==void 0?o:null),p=l[d];if(p===void 0||c&&uM(c,d))continue;const v={delay:n,...Xh(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const m=Vb(e);if(m){const h=window.MotionHandoffAnimation(m,d,se);h!==null&&(v.startTime=h,y=!0)}}sf(e,d),f.start(lp(d,f,p,e.shouldReduceMotion&&yr.has(d)?{type:!1}:v,e,y));const S=f.animation;S&&u.push(S)}return a&&Promise.all(u).then(()=>{se.update(()=>{a&&sM(e,a)})}),u}function af(e,t,n={}){var r;const i=ju(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(Wb(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=o;return cM(e,t,c+u,d,f,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,c]=l==="beforeChildren"?[s,a]:[a,s];return u().then(()=>c())}else return Promise.all([s(),a(n.delay)])}function cM(e,t,n=0,r=0,i=1,o){const s=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(dM).forEach((u,c)=>{u.notify("AnimationStart",t),s.push(af(u,t,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function dM(e,t){return e.sortNodePosition(t)}function fM(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>af(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=af(e,t,n);else{const i=typeof t=="function"?ju(e,t,n.custom):t;r=Promise.all(Wb(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const hM=qh.length;function Hb(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Hb(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>fM(e,n,r)))}function yM(e){let t=gM(e),n=Ug(),r=!0;const i=l=>(u,c)=>{var d;const f=ju(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:v,...y}=f;u={...u,...y,...v}}return u};function o(l){t=l(e)}function s(l){const{props:u}=e,c=Hb(e.parent)||{},d=[],f=new Set;let p={},v=1/0;for(let S=0;Sv&&w,B=!1;const j=Array.isArray(g)?g:[g];let H=j.reduce(i(m),{});P===!1&&(H={});const{prevResolvedValues:ce={}}=h,Ze={...ce,...H},Re=L=>{A=!0,f.has(L)&&(B=!0,f.delete(L)),h.needsAnimating[L]=!0;const R=e.getValue(L);R&&(R.liveStyle=!1)};for(const L in Ze){const R=H[L],D=ce[L];if(p.hasOwnProperty(L))continue;let I=!1;Yd(R)&&Yd(D)?I=!rb(R,D):I=R!==D,I?R!=null?Re(L):f.add(L):R!==void 0&&f.has(L)?Re(L):h.protectedKeys[L]=!0}h.prevProp=g,h.prevResolvedValues=H,h.isActive&&(p={...p,...H}),r&&e.blockInitialAnimation&&(A=!1),A&&(!($&&_)||B)&&d.push(...j.map(L=>({animation:L,options:{type:m}})))}if(f.size){const S={};f.forEach(m=>{const h=e.getBaseTarget(m),g=e.getValue(m);g&&(g.liveStyle=!0),S[m]=h??null}),d.push({animation:S})}let y=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(d):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=s(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Ug(),r=!0}}}function vM(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!rb(t,e):!1}function Er(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ug(){return{animate:Er(!0),whileInView:Er(),whileHover:Er(),whileTap:Er(),whileDrag:Er(),whileFocus:Er(),exit:Er()}}class vr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class bM extends vr{constructor(t){super(t),t.animationState||(t.animationState=yM(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let SM=0;class xM extends vr{constructor(){super(...arguments),this.id=SM++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const wM={animation:{Feature:bM},exit:{Feature:xM}},Kb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Bu(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const kM=e=>t=>Kb(t)&&e(t,Bu(t));function Cn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function An(e,t,n,r){return Cn(e,t,kM(n),r)}const Wg=(e,t)=>Math.abs(e-t);function CM(e,t){const n=Wg(e.x,t.x),r=Wg(e.y,t.y);return Math.sqrt(n**2+r**2)}class Gb{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Hc(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=CM(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:v}=d,{timestamp:y}=Ne;this.history.push({...v,timestamp:y});const{onStart:S,onMove:m}=this.handlers;f||(S&&S(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Wc(f,this.transformPagePoint),se.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:v,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=Hc(d.type==="pointercancel"?this.lastMoveEventInfo:Wc(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,S),v&&v(d,S)},!Kb(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=Bu(t),a=Wc(s,this.transformPagePoint),{point:l}=a,{timestamp:u}=Ne;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(t,Hc(a,this.history)),this.removeListeners=Rn(An(this.contextWindow,"pointermove",this.handlePointerMove),An(this.contextWindow,"pointerup",this.handlePointerUp),An(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),fr(this.updatePoint)}}function Wc(e,t){return t?{point:t(e.point)}:e}function Hg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Hc({point:e},t){return{point:e,delta:Hg(e,qb(t)),offset:Hg(e,TM(t)),velocity:PM(t,.1)}}function TM(e){return e[0]}function qb(e){return e[e.length-1]}function PM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=qb(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>_n(t)));)n--;if(!r)return{x:0,y:0};const o=$n(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Xb(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Kg=Xb("dragHorizontal"),Gg=Xb("dragVertical");function Yb(e){let t=!1;if(e==="y")t=Gg();else if(e==="x")t=Kg();else{const n=Kg(),r=Gg();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function Qb(){const e=Yb(!0);return e?(e(),!1):!0}function vi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const Zb=1e-4,EM=1-Zb,_M=1+Zb,Jb=.01,$M=0-Jb,RM=0+Jb;function xt(e){return e.max-e.min}function AM(e,t,n){return Math.abs(e-t)<=n}function qg(e,t,n,r=.5){e.origin=r,e.originPoint=ve(t.min,t.max,e.origin),e.scale=xt(n)/xt(t),e.translate=ve(n.min,n.max,e.origin)-e.originPoint,(e.scale>=EM&&e.scale<=_M||isNaN(e.scale))&&(e.scale=1),(e.translate>=$M&&e.translate<=RM||isNaN(e.translate))&&(e.translate=0)}function ts(e,t,n,r){qg(e.x,t.x,n.x,r?r.originX:void 0),qg(e.y,t.y,n.y,r?r.originY:void 0)}function Xg(e,t,n){e.min=n.min+t.min,e.max=e.min+xt(t)}function OM(e,t,n){Xg(e.x,t.x,n.x),Xg(e.y,t.y,n.y)}function Yg(e,t,n){e.min=t.min-n.min,e.max=e.min+xt(t)}function ns(e,t,n){Yg(e.x,t.x,n.x),Yg(e.y,t.y,n.y)}function LM(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?ve(n,e,r.max):Math.min(e,n)),e}function Qg(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function MM(e,{top:t,left:n,bottom:r,right:i}){return{x:Qg(e.x,n,i),y:Qg(e.y,t,r)}}function Zg(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Zi(t.min,t.max-r,e.min):r>i&&(n=Zi(e.min,e.max-i,t.min)),hr(0,1,n)}function DM(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const lf=.35;function jM(e=lf){return e===!1?e=0:e===!0&&(e=lf),{x:Jg(e,"left","right"),y:Jg(e,"top","bottom")}}function Jg(e,t,n){return{min:ey(e,t),max:ey(e,n)}}function ey(e,t){return typeof e=="number"?e:e[t]||0}const ty=()=>({translate:0,scale:1,origin:0,originPoint:0}),bi=()=>({x:ty(),y:ty()}),ny=()=>({min:0,max:0}),Ce=()=>({x:ny(),y:ny()});function $t(e){return[e("x"),e("y")]}function eS({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function NM({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function FM(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Kc(e){return e===void 0||e===1}function uf({scale:e,scaleX:t,scaleY:n}){return!Kc(e)||!Kc(t)||!Kc(n)}function $r(e){return uf(e)||tS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function tS(e){return ry(e.x)||ry(e.y)}function ry(e){return e&&e!=="0%"}function Ml(e,t,n){const r=e-n,i=t*r;return n+i}function iy(e,t,n,r,i){return i!==void 0&&(e=Ml(e,i,r)),Ml(e,n,r)+t}function cf(e,t=0,n=1,r,i){e.min=iy(e.min,t,n,r,i),e.max=iy(e.max,t,n,r,i)}function nS(e,{x:t,y:n}){cf(e.x,t.translate,t.scale,t.originPoint),cf(e.y,n.translate,n.scale,n.originPoint)}const oy=.999999999999,sy=1.0000000000001;function BM(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;aoy&&(t.x=1),t.yoy&&(t.y=1)}function Si(e,t){e.min=e.min+t,e.max=e.max+t}function ay(e,t,n,r,i=.5){const o=ve(e.min,e.max,i);cf(e,t,n,o,r)}function xi(e,t){ay(e.x,t.x,t.scaleX,t.scale,t.originX),ay(e.y,t.y,t.scaleY,t.scale,t.originY)}function rS(e,t){return eS(FM(e.getBoundingClientRect(),t))}function VM(e,t,n){const r=rS(e,n),{scroll:i}=t;return i&&(Si(r.x,i.offset.x),Si(r.y,i.offset.y)),r}const iS=({current:e})=>e?e.ownerDocument.defaultView:null,UM=new WeakMap;class WM{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ce(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Bu(c,"page").point)},o=(c,d)=>{const{drag:f,dragPropagation:p,onDragStart:v}=this.getProps();if(f&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Yb(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$t(S=>{let m=this.getAxisMotionValue(S).get()||0;if(dn.test(m)){const{projection:h}=this.visualElement;if(h&&h.layout){const g=h.layout.layoutBox[S];g&&(m=xt(g)*(parseFloat(m)/100))}}this.originPoint[S]=m}),v&&se.postRender(()=>v(c,d)),sf(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},s=(c,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:v,onDrag:y}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:S}=d;if(p&&this.currentDirection===null){this.currentDirection=HM(S),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",d.point,S),this.updateAxis("y",d.point,S),this.visualElement.render(),y&&y(c,d)},a=(c,d)=>this.stop(c,d),l=()=>$t(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Gb(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:iS(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&se.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Ea(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=LM(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&vi(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=MM(i.layoutBox,n):this.constraints=!1,this.elastic=jM(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&$t(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=DM(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!vi(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=VM(r,i.root,this.visualElement.getTransformPagePoint());let s=zM(i.layout.layoutBox,o);if(n){const a=n(NM(s));this.hasMutatedConstraints=!!a,a&&(s=eS(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=$t(c=>{if(!Ea(c,n,this.currentDirection))return;let d=l&&l[c]||{};s&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,v={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return sf(this.visualElement,t),r.start(lp(t,r,0,n,this.visualElement,!1))}stopAnimation(){$t(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){$t(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){$t(n=>{const{drag:r}=this.getProps();if(!Ea(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-ve(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!vi(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};$t(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();i[s]=IM({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),$t(s=>{if(!Ea(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];a.set(ve(l,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;UM.set(this.visualElement,this);const t=this.visualElement.current,n=An(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();vi(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),se.read(r);const s=Cn(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&($t(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=lf,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Ea(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function HM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class KM extends vr{constructor(t){super(t),this.removeGroupControls=Xe,this.removeListeners=Xe,this.controls=new WM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xe}unmount(){this.removeGroupControls(),this.removeListeners()}}const ly=e=>(t,n)=>{e&&se.postRender(()=>e(t,n))};class GM extends vr{constructor(){super(...arguments),this.removePointerDownListener=Xe}onPointerDown(t){this.session=new Gb(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:iS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:ly(t),onStart:ly(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&se.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=An(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Js=x.createContext(null);function qM(){const e=x.useContext(Js);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=x.useId();x.useEffect(()=>r(i),[]);const o=x.useCallback(()=>n&&n(i),[i,n]);return!t&&n?[!1,o]:[!0]}function XM(){return YM(x.useContext(Js))}function YM(e){return e===null?!0:e.isPresent}const fp=x.createContext({}),oS=x.createContext({}),cl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const To={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(W.test(e))e=parseFloat(e);else return e;const n=uy(e,t.target.x),r=uy(e,t.target.y);return`${n}% ${r}%`}},QM={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=pr.parse(e);if(i.length>5)return r;const o=pr.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const u=ve(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),o(i)}},zl={};function ZM(e){Object.assign(zl,e)}const{schedule:hp,cancel:JF}=ib(queueMicrotask,!1);class JM extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;ZM(ez),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),cl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||se.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),hp.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function sS(e){const[t,n]=qM(),r=x.useContext(fp);return O.jsx(JM,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(oS),isPresent:t,safeToRemove:n})}const ez={borderRadius:{...To,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:To,borderTopRightRadius:To,borderBottomLeftRadius:To,borderBottomRightRadius:To,boxShadow:QM},aS=["TopLeft","TopRight","BottomLeft","BottomRight"],tz=aS.length,cy=e=>typeof e=="string"?parseFloat(e):e,dy=e=>typeof e=="number"||W.test(e);function nz(e,t,n,r,i,o){i?(e.opacity=ve(0,n.opacity!==void 0?n.opacity:1,rz(r)),e.opacityExit=ve(t.opacity!==void 0?t.opacity:1,0,iz(r))):o&&(e.opacity=ve(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;srt?1:n(Zi(e,t,r))}function hy(e,t){e.min=t.min,e.max=t.max}function Et(e,t){hy(e.x,t.x),hy(e.y,t.y)}function py(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function my(e,t,n,r,i){return e-=t,e=Ml(e,1/n,r),i!==void 0&&(e=Ml(e,1/i,r)),e}function oz(e,t=0,n=1,r=.5,i,o=e,s=e){if(dn.test(t)&&(t=parseFloat(t),t=ve(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=ve(o.min,o.max,r);e===o&&(a-=t),e.min=my(e.min,t,n,a,i),e.max=my(e.max,t,n,a,i)}function gy(e,t,[n,r,i],o,s){oz(e,t[n],t[r],t[i],t.scale,o,s)}const sz=["x","scaleX","originX"],az=["y","scaleY","originY"];function yy(e,t,n,r){gy(e.x,t,sz,n?n.x:void 0,r?r.x:void 0),gy(e.y,t,az,n?n.y:void 0,r?r.y:void 0)}function vy(e){return e.translate===0&&e.scale===1}function uS(e){return vy(e.x)&&vy(e.y)}function by(e,t){return e.min===t.min&&e.max===t.max}function lz(e,t){return by(e.x,t.x)&&by(e.y,t.y)}function Sy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function cS(e,t){return Sy(e.x,t.x)&&Sy(e.y,t.y)}function xy(e){return xt(e.x)/xt(e.y)}function wy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class uz{constructor(){this.members=[]}add(t){up(this.members,t),t.scheduleRender()}remove(t){if(cp(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function cz(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const dz=(e,t)=>e.depth-t.depth;class fz{constructor(){this.children=[],this.isDirty=!1}add(t){up(this.children,t),this.isDirty=!0}remove(t){cp(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(dz),this.isDirty=!1,this.children.forEach(t)}}function dl(e){const t=qe(e)?e.get():e;return tM(t)?t.toValue():t}function hz(e,t){const n=fn.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(fr(r),e(o-t))};return se.read(r,!0),()=>fr(r)}function pz(e){return e instanceof SVGElement&&e.tagName!=="svg"}function mz(e,t,n){const r=qe(e)?e:Ts(e);return r.start(lp("",r,t,n)),r.animation}const Rr={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Uo=typeof window<"u"&&window.MotionDebug!==void 0,Gc=["","X","Y","Z"],gz={visibility:"hidden"},ky=1e3;let yz=0;function qc(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function dS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Vb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",se,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&dS(r)}function fS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=yz++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Uo&&(Rr.totalNodes=Rr.resolvedTargetDeltas=Rr.recalculatedProjection=0),this.nodes.forEach(Sz),this.nodes.forEach(Tz),this.nodes.forEach(Pz),this.nodes.forEach(xz),Uo&&window.MotionDebug.record(Rr)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=hz(f,250),cl.hasAnimatedSinceResize&&(cl.hasAnimatedSinceResize=!1,this.nodes.forEach(Ty))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||Az,{onLayoutAnimationStart:S,onLayoutAnimationComplete:m}=c.getProps(),h=!this.targetLayout||!cS(this.targetLayout,v)||p,g=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,g);const w={...Xh(y,"layout"),onPlay:S,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else f||Ty(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,fr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ez),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&dS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const P=w/1e3;Py(d.x,s.x,P),Py(d.y,s.y,P),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ns(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$z(this.relativeTarget,this.relativeTargetOrigin,f,P),g&&lz(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=Ce()),Et(g,this.relativeTarget)),y&&(this.animationValues=c,nz(c,u,this.latestValues,P,h,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=se.update(()=>{cl.hasAnimatedSinceResize=!0,this.currentAnimation=mz(0,ky,{...s,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ky),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=s;if(!(!a||!l||!u)){if(this!==s&&this.layout&&u&&hS(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ce();const d=xt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=xt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Et(a,l),xi(a,c),ts(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new uz),this.sharedNodes.get(s).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&qc("z",s,u,this.animationValues);for(let c=0;c{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Cy),this.root.sharedNodes.clear()}}}function vz(e){e.updateLayout()}function bz(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?$t(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],p=xt(f);f.min=r[d].min,f.max=f.min+p}):hS(o,n.layoutBox,r)&&$t(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],p=xt(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=bi();ts(a,r,n.layoutBox);const l=bi();s?ts(l,e.applyTransform(i,!0),n.measuredBox):ts(l,r,n.layoutBox);const u=!uS(a);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const v=Ce();ns(v,n.layoutBox,f.layoutBox);const y=Ce();ns(y,r,p.layoutBox),cS(v,y)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Sz(e){Uo&&Rr.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function xz(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function wz(e){e.clearSnapshot()}function Cy(e){e.clearMeasurements()}function kz(e){e.isLayoutDirty=!1}function Cz(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ty(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Tz(e){e.resolveTargetDelta()}function Pz(e){e.calcProjection()}function Ez(e){e.resetSkewAndRotation()}function _z(e){e.removeLeadSnapshot()}function Py(e,t,n){e.translate=ve(t.translate,0,n),e.scale=ve(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ey(e,t,n,r){e.min=ve(t.min,n.min,r),e.max=ve(t.max,n.max,r)}function $z(e,t,n,r){Ey(e.x,t.x,n.x,r),Ey(e.y,t.y,n.y,r)}function Rz(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Az={duration:.45,ease:[.4,0,.1,1]},_y=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),$y=_y("applewebkit/")&&!_y("chrome/")?Math.round:Xe;function Ry(e){e.min=$y(e.min),e.max=$y(e.max)}function Oz(e){Ry(e.x),Ry(e.y)}function hS(e,t,n){return e==="position"||e==="preserve-aspect"&&!AM(xy(t),xy(n),.2)}function Lz(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Mz=fS({attachResizeListener:(e,t)=>Cn(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xc={current:void 0},pS=fS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xc.current){const e=new Mz({});e.mount(window),e.setOptions({layoutScroll:!0}),Xc.current=e}return Xc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zz={pan:{Feature:GM},drag:{Feature:KM,ProjectionNode:pS,MeasureLayout:sS}};function Ay(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd",i=(o,s)=>{if(o.pointerType==="touch"||Qb())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t);const l=a[r];l&&se.postRender(()=>l(o,s))};return An(e.current,n,i,{passive:!e.getProps()[r]})}class Iz extends vr{mount(){this.unmount=Rn(Ay(this.node,!0),Ay(this.node,!1))}unmount(){}}class Dz extends vr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Rn(Cn(this.node.current,"focus",()=>this.onFocus()),Cn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const mS=(e,t)=>t?e===t?!0:mS(e,t.parentElement):!1;function Yc(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Bu(n))}class jz extends vr{constructor(){super(...arguments),this.removeStartListeners=Xe,this.removeEndListeners=Xe,this.removeAccessibleListeners=Xe,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),o=An(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:d}=this.node.getProps(),f=!d&&!mS(this.node.current,a.target)?c:u;f&&se.update(()=>f(a,l))},{passive:!(r.onTap||r.onPointerUp)}),s=An(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=Rn(o,s),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=o=>{if(o.key!=="Enter"||this.isPressing)return;const s=a=>{a.key!=="Enter"||!this.checkPressEnd()||Yc("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&se.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Cn(this.node.current,"keyup",s),Yc("down",(a,l)=>{this.startPress(a,l)})},n=Cn(this.node.current,"keydown",t),r=()=>{this.isPressing&&Yc("cancel",(o,s)=>this.cancelPress(o,s))},i=Cn(this.node.current,"blur",r);this.removeAccessibleListeners=Rn(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&se.postRender(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Qb()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&se.postRender(()=>r(t,n))}mount(){const t=this.node.getProps(),n=An(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Cn(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Rn(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const df=new WeakMap,Qc=new WeakMap,Nz=e=>{const t=df.get(e.target);t&&t(e)},Fz=e=>{e.forEach(Nz)};function Bz({root:e,...t}){const n=e||document;Qc.has(n)||Qc.set(n,{});const r=Qc.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Fz,{root:e,...t})),r[i]}function Vz(e,t,n){const r=Bz(t);return df.set(e,n),r.observe(e),()=>{df.delete(e),r.unobserve(e)}}const Uz={some:0,all:1};class Wz extends vr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Uz[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return Vz(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Hz(t,n))&&this.startObserver()}unmount(){}}function Hz({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Kz={inView:{Feature:Wz},tap:{Feature:jz},focus:{Feature:Dz},hover:{Feature:Iz}},Gz={layout:{ProjectionNode:pS,MeasureLayout:sS}},pp=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Vu=x.createContext({}),mp=typeof window<"u",gS=mp?x.useLayoutEffect:x.useEffect,yS=x.createContext({strict:!1});function qz(e,t,n,r,i){var o,s;const{visualElement:a}=x.useContext(Vu),l=x.useContext(yS),u=x.useContext(Js),c=x.useContext(pp).reducedMotion,d=x.useRef();r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,p=x.useContext(oS);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Xz(d.current,n,i,p),x.useInsertionEffect(()=>{f&&f.update(n,u)});const v=n[Bb],y=x.useRef(!!v&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,v))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,v)));return gS(()=>{f&&(window.MotionIsMounted=!0,f.updateFeatures(),hp.render(f.render),y.current&&f.animationState&&f.animationState.animateChanges())}),x.useEffect(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)===null||S===void 0||S.call(window,v)}),y.current=!1))}),f}function Xz(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:vS(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&vi(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function vS(e){if(e)return e.options.allowProjection!==!1?e.projection:vS(e.parent)}function Yz(e,t,n){return x.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):vi(n)&&(n.current=r))},[t])}function Uu(e){return xs(e.animate)||qh.some(t=>ws(e[t]))}function bS(e){return!!(Uu(e)||e.variants)}function Qz(e,t){if(Uu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ws(n)?n:void 0,animate:ws(r)?r:void 0}}return e.inherit!==!1?t:{}}function Zz(e){const{initial:t,animate:n}=Qz(e,x.useContext(Vu));return x.useMemo(()=>({initial:t,animate:n}),[Oy(t),Oy(n)])}function Oy(e){return Array.isArray(e)?e.join(" "):e}const Ly={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ji={};for(const e in Ly)Ji[e]={isEnabled:t=>Ly[e].some(n=>!!t[n])};function Jz(e){for(const t in e)Ji[t]={...Ji[t],...e[t]}}const eI=Symbol.for("motionComponentSymbol");function tI({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&Jz(e);function o(a,l){let u;const c={...x.useContext(pp),...a,layoutId:nI(a)},{isStatic:d}=c,f=Zz(a),p=r(a,d);if(!d&&mp){rI();const v=iI(c);u=v.MeasureLayout,f.visualElement=qz(i,p,c,t,v.ProjectionNode)}return O.jsxs(Vu.Provider,{value:f,children:[u&&f.visualElement?O.jsx(u,{visualElement:f.visualElement,...c}):null,n(i,a,Yz(p,f.visualElement,l),p,d,f.visualElement)]})}const s=x.forwardRef(o);return s[eI]=i,s}function nI({layoutId:e}){const t=x.useContext(fp).id;return t&&e!==void 0?t+"-"+e:e}function rI(e,t){x.useContext(yS).strict}function iI(e){const{drag:t,layout:n}=Ji;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const oI=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function gp(e){return typeof e!="string"||e.includes("-")?!1:!!(oI.indexOf(e)>-1||/[A-Z]/u.test(e))}function SS(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const xS=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function wS(e,t,n,r){SS(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(xS.has(i)?i:Fu(i),t.attrs[i])}function kS(e,{layout:t,layoutId:n}){return yr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zl[e]||e==="opacity")}function yp(e,t,n){var r;const{style:i}=e,o={};for(const s in i)(qe(i[s])||t.style&&qe(t.style[s])||kS(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[s]=i[s]);return n&&i&&typeof i.willChange=="string"&&(n.applyWillChange=!1),o}function CS(e,t,n){const r=yp(e,t,n);for(const i in e)if(qe(e[i])||qe(t[i])){const o=Ys.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}function vp(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}function sI({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},i,o,s,a){const l={latestValues:aI(i,o,s,a?!1:e,t),renderState:n()};return r&&(l.mount=u=>r(i,u,l)),l}const TS=e=>(t,n)=>{const r=x.useContext(Vu),i=x.useContext(Js),o=()=>sI(e,t,r,i,n);return n?o():vp(o)};function My(e,t,n){const r=Array.isArray(t)?t:[t];for(let i=0;i{for(const m in y){let h=y[m];if(Array.isArray(h)){const g=p?h.length-1:0;h=h[g]}h!==null&&(s[m]=h)}for(const m in S)s[m]=S[m]}),a&&c&&u!==!1&&!xs(c)&&My(e,c,y=>{for(const S in y)if(Ub(S)){s.willChange="transform";return}}),s}const bp=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),PS=()=>({...bp(),attrs:{}}),ES=(e,t)=>t&&typeof e=="number"?t.transform(e):e,lI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},uI=Ys.length;function cI(e,t,n){let r="",i=!0;for(let o=0;otypeof e=="string"&&e.toLowerCase()==="svg",mI={useVisualState:TS({scrapeMotionValuesFromProps:CS,createRenderState:PS,onMount:(e,t,{renderState:n,latestValues:r})=>{se.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),se.render(()=>{xp(n,r,wp(t.tagName),e.transformTemplate),wS(t,n)})}})},gI={useVisualState:TS({applyWillChange:!0,scrapeMotionValuesFromProps:yp,createRenderState:bp})};function _S(e,t,n){for(const r in t)!qe(t[r])&&!kS(r,n)&&(e[r]=t[r])}function yI({transformTemplate:e},t){return x.useMemo(()=>{const n=bp();return Sp(n,t,e),Object.assign({},n.vars,n.style)},[t])}function vI(e,t){const n=e.style||{},r={};return _S(r,n,e),Object.assign(r,yI(e,t)),r}function bI(e,t){const n={},r=vI(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const SI=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Il(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||SI.has(e)}let $S=e=>!Il(e);function xI(e){e&&($S=t=>t.startsWith("on")?!Il(t):e(t))}try{xI(require("@emotion/is-prop-valid").default)}catch{}function wI(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||($S(i)||n===!0&&Il(i)||!t&&!Il(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function kI(e,t,n,r){const i=x.useMemo(()=>{const o=PS();return xp(o,t,wp(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};_S(o,e.style,e),i.style={...o,...i.style}}return i}function CI(e=!1){return(n,r,i,{latestValues:o},s)=>{const l=(gp(n)?kI:bI)(r,o,s,n),u=wI(r,typeof n=="string",e),c=n!==x.Fragment?{...u,...l,ref:i}:{},{children:d}=r,f=x.useMemo(()=>qe(d)?d.get():d,[d]);return x.createElement(n,{...c,children:f})}}function TI(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...gp(r)?mI:gI,preloadedFeatures:e,useRender:CI(i),createVisualElement:t,Component:r};return tI(s)}}const ff={current:null},RS={current:!1};function PI(){if(RS.current=!0,!!mp)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ff.current=e.matches;e.addListener(t),t()}else ff.current=!1}function EI(e,t,n){for(const r in t){const i=t[r],o=n[r];if(qe(i))e.addValue(r,i);else if(qe(o))e.addValue(r,Ts(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Ts(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Iy=new WeakMap,_I=[...bb,Ke,pr],$I=e=>_I.find(vb(e)),Dy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class RI{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Jh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=fn.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),RS.current||PI(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ff.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Iy.delete(this.current),this.projection&&this.projection.unmount(),fr(this.notifyUpdate),fr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=yr.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&se.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ji){const n=Ji[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ce()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ts(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(pb(i)||hb(i))?i=parseFloat(i):!$I(i)&&pr.test(n)&&(i=Eb(t,n)),this.setBaseTarget(t,qe(i)?i.get():i)),qe(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=Kh(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!qe(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new dp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class AS extends RI{constructor(){super(...arguments),this.KeyframeResolver=_b}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}}function AI(e){return window.getComputedStyle(e)}class OI extends AS{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=SS}readValueFromInstance(t,n){if(yr.has(n)){const r=rp(n);return r&&r.default||0}else{const r=AI(t),i=(gb(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return rS(t,n)}build(t,n,r){Sp(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return yp(t,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;qe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class LI extends AS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ce}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(yr.has(n)){const r=rp(n);return r&&r.default||0}return n=xS.has(n)?n:Fu(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return CS(t,n,r)}build(t,n,r){xp(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){wS(t,n,r,i)}mount(t){this.isSVGTag=wp(t.tagName),super.mount(t)}}const MI=(e,t)=>gp(e)?new LI(t):new OI(t,{allowProjection:e!==x.Fragment}),zI=TI({...wM,...Kz,...zz,...Gz},MI),II=pL(zI);class DI extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function jI({children:e,isPresent:t}){const n=x.useId(),r=x.useRef(null),i=x.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=x.useContext(pp);return x.useInsertionEffect(()=>{const{width:s,height:a,top:l,left:u}=i.current;if(t||!r.current||!s||!a)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return o&&(c.nonce=o),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` - [data-motion-pop-id="${n}"] { - position: absolute !important; - width: ${s}px !important; - height: ${a}px !important; - top: ${l}px !important; - left: ${u}px !important; - } - `),()=>{document.head.removeChild(c)}},[t]),O.jsx(DI,{isPresent:t,childRef:r,sizeRef:i,children:x.cloneElement(e,{ref:r})})}const NI=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const a=vp(FI),l=x.useId(),u=x.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c=>{a.set(c,!0);for(const d of a.values())if(!d)return;r&&r()},register:c=>(a.set(c,!1),()=>a.delete(c))}),o?[Math.random()]:[n]);return x.useMemo(()=>{a.forEach((c,d)=>a.set(d,!1))},[n]),x.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),s==="popLayout"&&(e=O.jsx(jI,{isPresent:n,children:e})),O.jsx(Js.Provider,{value:u,children:e})};function FI(){return new Map}const _a=e=>e.key||"";function jy(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const BI=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:s="sync"})=>{const a=x.useMemo(()=>jy(e),[e]),l=a.map(_a),u=x.useRef(!0),c=x.useRef(a),d=vp(()=>new Map),[f,p]=x.useState(a),[v,y]=x.useState(a);gS(()=>{u.current=!1,c.current=a;for(let h=0;h{const g=_a(h),w=a===v||l.includes(g),P=()=>{if(d.has(g))d.set(g,!0);else return;let $=!0;d.forEach(_=>{_||($=!1)}),$&&(m==null||m(),y(c.current),i&&i())};return O.jsx(NI,{isPresent:w,initial:!u.current||r?void 0:!1,custom:w?void 0:n,presenceAffectsLayout:o,mode:s,onExitComplete:w?void 0:P,children:h},g)})})},VI=(e,t)=>e.find(n=>n.id===t);function Ny(e,t){const n=OS(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function OS(e,t){for(const[n,r]of Object.entries(e))if(VI(r,t))return n}function UI(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function WI(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",s=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:s}}var HI=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,KI=F1(function(e){return HI.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),GI=!1,qI=KI,XI=function(t){return t!=="theme"},Fy=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?qI:XI},By=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(s){return t.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},YI=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Bh(n,r,i),X1(function(){return Vh(n,r,i)}),null},QI=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,s;n!==void 0&&(o=n.label,s=n.target);var a=By(t,n,r),l=a||Fy(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{var f=c[0];d.push(f[0]);for(var p=c.length,v=1;vt=>{const{theme:n,css:r,__css:i,sx:o,...s}=t,a=mP(n),[l]=RT(s,a),u=sn(e,t),c=yT({},i,u,f1(l),o),d=b1(c)(t.theme);return r?[d,r]:d};function Zc(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=t3);const i=r3({baseStyle:n}),o=n3(e,r)(i);return x.forwardRef(function(l,u){const{children:c,...d}=l,{colorMode:f,forced:p}=Hh(),v=p?f:void 0;return x.createElement(o,{ref:u,"data-theme":v,...d},c)})}function i3(){const e=new Map;return new Proxy(Zc,{apply(t,n,r){return Zc(...r)},get(t,n){return e.has(n)||e.set(n,Zc(n)),e.get(n)}})}const it=i3(),o3={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},LS=x.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:s="bottom",duration:a=5e3,containerStyle:l,motionVariants:u=o3,toastSpacing:c="0.5rem"}=e,[d,f]=x.useState(a),p=XM();Ym(()=>{p||r==null||r()},[p]),Ym(()=>{f(a)},[a]);const v=()=>f(null),y=()=>f(a),S=()=>{p&&i()};x.useEffect(()=>{p&&o&&i()},[p,o,i]),MT(S,d);const m=x.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),h=x.useMemo(()=>UI(s),[s]);return O.jsx(II.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:v,onHoverEnd:y,custom:{position:s},style:h,children:O.jsx(it.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:m,children:sn(n,{id:t,onClose:S})})})});LS.displayName="ToastComponent";function Fn(e){return x.forwardRef(e)}var s3=typeof Element<"u",a3=typeof Map=="function",l3=typeof Set=="function",u3=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function fl(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!fl(e[r],t[r]))return!1;return!0}var o;if(a3&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!fl(r.value[1],t.get(r.value[0])))return!1;return!0}if(l3&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(u3&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(s3&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!fl(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var c3=function(t,n){try{return fl(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const MS=ei(c3);function d3(){const e=x.useContext(Yi);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function f3(){const e=Hh(),t=d3();return{...e,theme:t}}function h3(e,t,n){if(t==null)return t;const r=i=>{var o,s;return(s=(o=e.__cssMap)==null?void 0:o[i])==null?void 0:s.value};return r(t)??r(n)??n}function tB(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const s=i.filter(Boolean),a=r.map((l,u)=>{const c=`${e}.${l}`;return h3(o,c,s[u]??l)});return Array.isArray(t)?a:a[0]}}function zS(e,t={}){const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=f3(),s=e?h1(i,`components.${e}`):void 0,a=n||s,l=an({theme:i,colorMode:o},(a==null?void 0:a.defaultProps)??{},f1(p1(r,["children"]))),u=x.useRef({});if(a){const d=TP(a)(l);MS(u.current,d)||(u.current=d)}return u.current}function kp(e,t={}){return zS(e,t)}function IS(e,t={}){return zS(e,t)}const Vy={path:O.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[O.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),O.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),O.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},ea=Fn((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:s,className:a,__css:l,...u}=e,c=Nn("chakra-icon",a),d=kp("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...d},p={ref:t,focusable:o,className:c,__css:f},v=r??Vy.viewBox;if(n&&typeof n!="string")return O.jsx(it.svg,{as:n,...p,...u});const y=s??Vy.path;return O.jsx(it.svg,{verticalAlign:"middle",viewBox:v,...p,...u,children:y})});ea.displayName="Icon";function p3(e){return O.jsx(ea,{viewBox:"0 0 24 24",...e,children:O.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function m3(e){return O.jsx(ea,{viewBox:"0 0 24 24",...e,children:O.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function Uy(e){return O.jsx(ea,{viewBox:"0 0 24 24",...e,children:O.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}const g3=eL({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),DS=Fn((e,t)=>{const n=kp("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:s="transparent",className:a,...l}=vu(e),u=Nn("chakra-spinner",a),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:s,borderLeftColor:s,animation:`${g3} ${o} linear infinite`,...n};return O.jsx(it.div,{ref:t,__css:c,className:u,...l,children:r&&O.jsx(it.span,{srOnly:!0,children:r})})});DS.displayName="Spinner";const[y3,Cp]=Xt({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[v3,Tp]=Xt({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),jS={info:{icon:m3,colorScheme:"blue"},warning:{icon:Uy,colorScheme:"orange"},success:{icon:p3,colorScheme:"green"},error:{icon:Uy,colorScheme:"red"},loading:{icon:DS,colorScheme:"blue"}};function b3(e){return jS[e].colorScheme}function S3(e){return jS[e].icon}const NS=Fn(function(t,n){const{status:r="info",addRole:i=!0,...o}=vu(t),s=t.colorScheme??b3(r),a=IS("Alert",{...t,colorScheme:s}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...a.container};return O.jsx(y3,{value:{status:r},children:O.jsx(v3,{value:a,children:O.jsx(it.div,{"data-status":r,role:i?"alert":void 0,ref:n,...o,className:Nn("chakra-alert",t.className),__css:l})})})});NS.displayName="Alert";function FS(e){const{status:t}=Cp(),n=S3(t),r=Tp(),i=t==="loading"?r.spinner:r.icon;return O.jsx(it.span,{display:"inherit","data-status":t,...e,className:Nn("chakra-alert__icon",e.className),__css:i,children:e.children||O.jsx(n,{h:"100%",w:"100%"})})}FS.displayName="AlertIcon";const BS=Fn(function(t,n){const r=Tp(),{status:i}=Cp();return O.jsx(it.div,{ref:n,"data-status":i,...t,className:Nn("chakra-alert__title",t.className),__css:r.title})});BS.displayName="AlertTitle";const VS=Fn(function(t,n){const{status:r}=Cp(),i=Tp(),o={display:"inline",...i.description};return O.jsx(it.div,{ref:n,"data-status":r,...t,className:Nn("chakra-alert__desc",t.className),__css:o})});VS.displayName="AlertDescription";function x3(e){return O.jsx(ea,{focusable:"false","aria-hidden":!0,...e,children:O.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}const US=Fn(function(t,n){const r=kp("CloseButton",t),{children:i,isDisabled:o,__css:s,...a}=vu(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return O.jsx(it.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...s},...a,children:i||O.jsx(x3,{width:"1em",height:"1em"})})});US.displayName="CloseButton";const w3=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:s,description:a,colorScheme:l,icon:u}=e,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return O.jsxs(NS,{addRole:!1,status:t,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[O.jsx(FS,{children:u}),O.jsxs(it.div,{flex:"1",maxWidth:"100%",children:[i&&O.jsx(BS,{id:c==null?void 0:c.title,children:i}),a&&O.jsx(VS,{id:c==null?void 0:c.description,display:"block",children:a})]}),o&&O.jsx(US,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1})]})};function k3(e={}){const{render:t,toastComponent:n=w3}=e;return i=>typeof t=="function"?t({...i,...e}):O.jsx(n,{...i,...e})}const C3={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},rs=T3(C3);function T3(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(s=>({...s,[o]:s[o].filter(a=>a.id!=i)}))},notify:(i,o)=>{const s=P3(i,o),{position:a,id:l}=s;return r(u=>{const d=a.includes("top")?[s,...u[a]??[]]:[...u[a]??[],s];return{...u,[a]:d}}),l},update:(i,o)=>{i&&r(s=>{const a={...s},{position:l,index:u}=Ny(a,i);return l&&u!==-1&&(a[l][u]={...a[l][u],...o,message:k3(o)}),a})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(c=>({...c,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const s=OS(o,i);return s?{...o,[s]:o[s].map(a=>a.id==i?{...a,requestClose:!0}:a)}:o})},isActive:i=>!!Ny(rs.getState(),i).position}}let Wy=0;function P3(e,t={}){Wy+=1;const n=t.id??Wy,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>rs.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var WS={exports:{}},Ct={},HS={exports:{}},KS={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(R,D){var I=R.length;R.push(D);e:for(;0>>1,xe=R[Q];if(0>>1;Qi(go,I))pti(kr,go)?(R[Q]=kr,R[pt]=I,Q=pt):(R[Q]=go,R[Je]=I,Q=Je);else if(pti(kr,I))R[Q]=kr,R[pt]=I,Q=pt;else break e}}return D}function i(R,D){var I=R.sortIndex-D.sortIndex;return I!==0?I:R.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,f=3,p=!1,v=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(R){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=R)r(u),D.sortIndex=D.expirationTime,t(l,D);else break;D=n(u)}}function w(R){if(y=!1,g(R),!v)if(n(l)!==null)v=!0,M(P);else{var D=n(u);D!==null&&L(w,D.startTime-R)}}function P(R,D){v=!1,y&&(y=!1,m(A),A=-1),p=!0;var I=f;try{for(g(D),d=n(l);d!==null&&(!(d.expirationTime>D)||R&&!H());){var Q=d.callback;if(typeof Q=="function"){d.callback=null,f=d.priorityLevel;var xe=Q(d.expirationTime<=D);D=e.unstable_now(),typeof xe=="function"?d.callback=xe:d===n(l)&&r(l),g(D)}else r(l);d=n(l)}if(d!==null)var K=!0;else{var Je=n(u);Je!==null&&L(w,Je.startTime-D),K=!1}return K}finally{d=null,f=I,p=!1}}var $=!1,_=null,A=-1,B=5,j=-1;function H(){return!(e.unstable_now()-jR||125Q?(R.sortIndex=I,t(u,R),n(l)===null&&R===n(u)&&(y?(m(A),A=-1):y=!0,L(w,I-Q))):(R.sortIndex=xe,t(l,R),v||p||(v=!0,M(P))),R},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(R){var D=f;return function(){var I=f;f=D;try{return R.apply(this,arguments)}finally{f=I}}}})(KS);HS.exports=KS;var E3=HS.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var _3=x,wt=E3;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pf=Object.prototype.hasOwnProperty,$3=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Hy={},Ky={};function R3(e){return pf.call(Ky,e)?!0:pf.call(Hy,e)?!1:$3.test(e)?Ky[e]=!0:(Hy[e]=!0,!1)}function A3(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function O3(e,t,n,r){if(t===null||typeof t>"u"||A3(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function st(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Ve={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ve[e]=new st(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ve[t]=new st(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ve[e]=new st(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ve[e]=new st(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ve[e]=new st(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ve[e]=new st(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ve[e]=new st(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ve[e]=new st(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ve[e]=new st(e,5,!1,e.toLowerCase(),null,!1,!1)});var Pp=/[\-:]([a-z])/g;function Ep(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Pp,Ep);Ve[t]=new st(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Pp,Ep);Ve[t]=new st(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Pp,Ep);Ve[t]=new st(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ve[e]=new st(e,1,!1,e.toLowerCase(),null,!1,!1)});Ve.xlinkHref=new st("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ve[e]=new st(e,1,!1,e.toLowerCase(),null,!0,!0)});function _p(e,t,n,r){var i=Ve.hasOwnProperty(t)?Ve[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` -`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{ed=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wo(e):""}function L3(e){switch(e.tag){case 5:return Wo(e.type);case 16:return Wo("Lazy");case 13:return Wo("Suspense");case 19:return Wo("SuspenseList");case 0:case 2:case 15:return e=td(e.type,!1),e;case 11:return e=td(e.type.render,!1),e;case 1:return e=td(e.type,!0),e;default:return""}}function vf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ki:return"Fragment";case wi:return"Portal";case mf:return"Profiler";case $p:return"StrictMode";case gf:return"Suspense";case yf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case XS:return(e.displayName||"Context")+".Consumer";case qS:return(e._context.displayName||"Context")+".Provider";case Rp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ap:return t=e.displayName||null,t!==null?t:vf(e.type)||"Memo";case Xn:t=e._payload,e=e._init;try{return vf(e(t))}catch{}}return null}function M3(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return vf(t);case 8:return t===$p?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function mr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function QS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function z3(e){var t=QS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ra(e){e._valueTracker||(e._valueTracker=z3(e))}function ZS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=QS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Dl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function bf(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qy(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=mr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function JS(e,t){t=t.checked,t!=null&&_p(e,"checked",t,!1)}function Sf(e,t){JS(e,t);var n=mr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?xf(e,t.type,n):t.hasOwnProperty("defaultValue")&&xf(e,t.type,mr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xy(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function xf(e,t,n){(t!=="number"||Dl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ho=Array.isArray;function Ni(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Aa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Es(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var is={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},I3=["Webkit","ms","Moz","O"];Object.keys(is).forEach(function(e){I3.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),is[t]=is[e]})});function rx(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||is.hasOwnProperty(e)&&is[e]?(""+t).trim():t+"px"}function ix(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=rx(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var D3=Se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Cf(e,t){if(t){if(D3[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function Tf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pf=null;function Op(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ef=null,Fi=null,Bi=null;function Zy(e){if(e=ra(e)){if(typeof Ef!="function")throw Error(z(280));var t=e.stateNode;t&&(t=qu(t),Ef(e.stateNode,e.type,t))}}function ox(e){Fi?Bi?Bi.push(e):Bi=[e]:Fi=e}function sx(){if(Fi){var e=Fi,t=Bi;if(Bi=Fi=null,Zy(e),t)for(e=0;e>>=0,e===0?32:31-(q3(e)/X3|0)|0}var Oa=64,La=4194304;function Ko(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Bl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=Ko(a):(o&=s,o!==0&&(r=Ko(o)))}else s=n&~i,s!==0?r=Ko(s):o!==0&&(r=Ko(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ta(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=n}function J3(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ss),a0=" ",l0=!1;function Px(e,t){switch(e){case"keyup":return ED.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ex(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ci=!1;function $D(e,t){switch(e){case"compositionend":return Ex(t);case"keypress":return t.which!==32?null:(l0=!0,a0);case"textInput":return e=t.data,e===a0&&l0?null:e;default:return null}}function RD(e,t){if(Ci)return e==="compositionend"||!Fp&&Px(e,t)?(e=Cx(),pl=Dp=er=null,Ci=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=f0(n)}}function Ax(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ax(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ox(){for(var e=window,t=Dl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Dl(e.document)}return t}function Bp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ND(e){var t=Ox(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ax(n.ownerDocument.documentElement,n)){if(r!==null&&Bp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=h0(n,o);var s=h0(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ti=null,Lf=null,ls=null,Mf=!1;function p0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mf||Ti==null||Ti!==Dl(r)||(r=Ti,"selectionStart"in r&&Bp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ls&&Ls(ls,r)||(ls=r,r=Wl(Lf,"onSelect"),0_i||(e.current=Ff[_i],Ff[_i]=null,_i--)}function le(e,t){_i++,Ff[_i]=e.current,e.current=t}var gr={},Ye=Sr(gr),ct=Sr(!1),qr=gr;function to(e,t){var n=e.type.contextTypes;if(!n)return gr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function dt(e){return e=e.childContextTypes,e!=null}function Kl(){he(ct),he(Ye)}function x0(e,t,n){if(Ye.current!==gr)throw Error(z(168));le(Ye,t),le(ct,n)}function Bx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(z(108,M3(e)||"Unknown",i));return Se({},n,r)}function Gl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||gr,qr=Ye.current,le(Ye,e),le(ct,ct.current),!0}function w0(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=Bx(e,t,qr),r.__reactInternalMemoizedMergedChildContext=e,he(ct),he(Ye),le(Ye,e)):he(ct),le(ct,n)}var bn=null,Xu=!1,md=!1;function Vx(e){bn===null?bn=[e]:bn.push(e)}function QD(e){Xu=!0,Vx(e)}function xr(){if(!md&&bn!==null){md=!0;var e=0,t=ie;try{var n=bn;for(ie=1;e>=s,i-=s,Tn=1<<32-Kt(t)+i|n<A?(B=_,_=null):B=_.sibling;var j=f(m,_,g[A],w);if(j===null){_===null&&(_=B);break}e&&_&&j.alternate===null&&t(m,_),h=o(j,h,A),$===null?P=j:$.sibling=j,$=j,_=B}if(A===g.length)return n(m,_),ge&&Ar(m,A),P;if(_===null){for(;AA?(B=_,_=null):B=_.sibling;var H=f(m,_,j.value,w);if(H===null){_===null&&(_=B);break}e&&_&&H.alternate===null&&t(m,_),h=o(H,h,A),$===null?P=H:$.sibling=H,$=H,_=B}if(j.done)return n(m,_),ge&&Ar(m,A),P;if(_===null){for(;!j.done;A++,j=g.next())j=d(m,j.value,w),j!==null&&(h=o(j,h,A),$===null?P=j:$.sibling=j,$=j);return ge&&Ar(m,A),P}for(_=r(m,_);!j.done;A++,j=g.next())j=p(_,m,A,j.value,w),j!==null&&(e&&j.alternate!==null&&_.delete(j.key===null?A:j.key),h=o(j,h,A),$===null?P=j:$.sibling=j,$=j);return e&&_.forEach(function(ce){return t(m,ce)}),ge&&Ar(m,A),P}function S(m,h,g,w){if(typeof g=="object"&&g!==null&&g.type===ki&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case $a:e:{for(var P=g.key,$=h;$!==null;){if($.key===P){if(P=g.type,P===ki){if($.tag===7){n(m,$.sibling),h=i($,g.props.children),h.return=m,m=h;break e}}else if($.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Xn&&T0(P)===$.type){n(m,$.sibling),h=i($,g.props),h.ref=Ao(m,$,g),h.return=m,m=h;break e}n(m,$);break}else t(m,$);$=$.sibling}g.type===ki?(h=Kr(g.props.children,m.mode,w,g.key),h.return=m,m=h):(w=wl(g.type,g.key,g.props,null,m.mode,w),w.ref=Ao(m,h,g),w.return=m,m=w)}return s(m);case wi:e:{for($=g.key;h!==null;){if(h.key===$)if(h.tag===4&&h.stateNode.containerInfo===g.containerInfo&&h.stateNode.implementation===g.implementation){n(m,h.sibling),h=i(h,g.children||[]),h.return=m,m=h;break e}else{n(m,h);break}else t(m,h);h=h.sibling}h=kd(g,m.mode,w),h.return=m,m=h}return s(m);case Xn:return $=g._init,S(m,h,$(g._payload),w)}if(Ho(g))return v(m,h,g,w);if(Po(g))return y(m,h,g,w);Fa(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,h!==null&&h.tag===6?(n(m,h.sibling),h=i(h,g),h.return=m,m=h):(n(m,h),h=wd(g,m.mode,w),h.return=m,m=h),s(m)):n(m,h)}return S}var ro=Kx(!0),Gx=Kx(!1),Yl=Sr(null),Ql=null,Ai=null,Hp=null;function Kp(){Hp=Ai=Ql=null}function Gp(e){var t=Yl.current;he(Yl),e._currentValue=t}function Uf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ui(e,t){Ql=e,Hp=Ai=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ut=!0),e.firstContext=null)}function zt(e){var t=e._currentValue;if(Hp!==e)if(e={context:e,memoizedValue:t,next:null},Ai===null){if(Ql===null)throw Error(z(308));Ai=e,Ql.dependencies={lanes:0,firstContext:e}}else Ai=Ai.next=e;return t}var jr=null;function qp(e){jr===null?jr=[e]:jr.push(e)}function qx(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,qp(t)):(n.next=i.next,i.next=n),t.interleaved=n,Dn(e,r)}function Dn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Yn=!1;function Xp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function On(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ar(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Y&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Dn(e,n)}return i=r.interleaved,i===null?(t.next=t,qp(r)):(t.next=i.next,i.next=t),r.interleaved=t,Dn(e,n)}function gl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mp(e,n)}}function P0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Zl(e,t,n,r){var i=e.updateQueue;Yn=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;s=0,c=u=l=null,a=o;do{var f=a.lane,p=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,y=a;switch(f=t,p=n,y.tag){case 1:if(v=y.payload,typeof v=="function"){d=v.call(p,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,f=typeof v=="function"?v.call(p,d,f):v,f==null)break e;d=Se({},d,f);break e;case 2:Yn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,s|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Qr|=s,e.lanes=s,e.memoizedState=d}}function E0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=yd.transition;yd.transition={};try{e(!1),t()}finally{ie=n,yd.transition=r}}function fw(){return It().memoizedState}function tj(e,t,n){var r=ur(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hw(e))pw(t,n);else if(n=qx(e,t,n,r),n!==null){var i=rt();Gt(n,e,r,i),mw(n,t,r)}}function nj(e,t,n){var r=ur(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hw(e))pw(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,qt(a,s)){var l=t.interleaved;l===null?(i.next=i,qp(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=qx(e,t,i,r),n!==null&&(i=rt(),Gt(n,e,r,i),mw(n,t,r))}}function hw(e){var t=e.alternate;return e===be||t!==null&&t===be}function pw(e,t){us=eu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mp(e,n)}}var tu={readContext:zt,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},rj={readContext:zt,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:zt,useEffect:$0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,vl(4194308,4,aw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vl(4194308,4,e,t)},useInsertionEffect:function(e,t){return vl(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=tj.bind(null,be,e),[r.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:_0,useDebugValue:rm,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=_0(!1),t=e[0];return e=ej.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=be,i=Jt();if(ge){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Ie===null)throw Error(z(349));Yr&30||Jx(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,$0(tw.bind(null,r,o,e),[e]),r.flags|=2048,Bs(9,ew.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Jt(),t=Ie.identifierPrefix;if(ge){var n=Pn,r=Tn;n=(r&~(1<<32-Kt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ns++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[rn]=t,e[Is]=r,Tw(e,t,!1,!1),t.stateNode=e;e:{switch(s=Tf(n,r),n){case"dialog":de("cancel",e),de("close",e),i=r;break;case"iframe":case"object":case"embed":de("load",e),i=r;break;case"video":case"audio":for(i=0;iso&&(t.flags|=128,r=!0,Oo(o,!1),t.lanes=4194304)}else{if(!r)if(e=Jl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Oo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ge)return We(t),null}else 2*Te()-o.renderingStartTime>so&&n!==1073741824&&(t.flags|=128,r=!0,Oo(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Te(),t.sibling=null,n=ye.current,le(ye,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return um(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?gt&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function dj(e,t){switch(Up(t),t.tag){case 1:return dt(t.type)&&Kl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return io(),he(ct),he(Ye),Zp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Qp(t),null;case 13:if(he(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));no()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return he(ye),null;case 4:return io(),null;case 10:return Gp(t.type._context),null;case 22:case 23:return um(),null;case 24:return null;default:return null}}var Va=!1,Ge=!1,fj=typeof WeakSet=="function"?WeakSet:Set,N=null;function Oi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ke(e,t,r)}else n.current=null}function Zf(e,t,n){try{n()}catch(r){ke(e,t,r)}}var F0=!1;function hj(e,t){if(zf=Vl,e=Ox(),Bp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===i&&(a=s),f===o&&++c===r&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(If={focusedElem:e,selectionRange:n},Vl=!1,N=t;N!==null;)if(t=N,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,N=e;else for(;N!==null;){t=N;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,S=v.memoizedState,m=t.stateNode,h=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:Ft(t.type,y),S);m.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(w){ke(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,N=e;break}N=t.return}return v=F0,F0=!1,v}function cs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Zf(t,n,o)}i=i.next}while(i!==r)}}function Zu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Jf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _w(e){var t=e.alternate;t!==null&&(e.alternate=null,_w(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[rn],delete t[Is],delete t[Nf],delete t[XD],delete t[YD])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $w(e){return e.tag===5||e.tag===3||e.tag===4}function B0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$w(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function eh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Hl));else if(r!==4&&(e=e.child,e!==null))for(eh(e,t,n),e=e.sibling;e!==null;)eh(e,t,n),e=e.sibling}function th(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(th(e,t,n),e=e.sibling;e!==null;)th(e,t,n),e=e.sibling}var je=null,Bt=!1;function Hn(e,t,n){for(n=n.child;n!==null;)Rw(e,t,n),n=n.sibling}function Rw(e,t,n){if(hn&&typeof hn.onCommitFiberUnmount=="function")try{hn.onCommitFiberUnmount(Wu,n)}catch{}switch(n.tag){case 5:Ge||Oi(n,t);case 6:var r=je,i=Bt;je=null,Hn(e,t,n),je=r,Bt=i,je!==null&&(Bt?(e=je,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):je.removeChild(n.stateNode));break;case 18:je!==null&&(Bt?(e=je,n=n.stateNode,e.nodeType===8?pd(e.parentNode,n):e.nodeType===1&&pd(e,n),As(e)):pd(je,n.stateNode));break;case 4:r=je,i=Bt,je=n.stateNode.containerInfo,Bt=!0,Hn(e,t,n),je=r,Bt=i;break;case 0:case 11:case 14:case 15:if(!Ge&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Zf(n,t,s),i=i.next}while(i!==r)}Hn(e,t,n);break;case 1:if(!Ge&&(Oi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ke(n,t,a)}Hn(e,t,n);break;case 21:Hn(e,t,n);break;case 22:n.mode&1?(Ge=(r=Ge)||n.memoizedState!==null,Hn(e,t,n),Ge=r):Hn(e,t,n);break;default:Hn(e,t,n)}}function V0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new fj),t.forEach(function(r){var i=wj.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Nt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*mj(r/1960))-r,10e?16:e,tr===null)var r=!1;else{if(e=tr,tr=null,iu=0,Y&6)throw Error(z(331));var i=Y;for(Y|=4,N=e.current;N!==null;){var o=N,s=o.child;if(N.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lTe()-am?Hr(e,0):sm|=n),ft(e,t)}function jw(e,t){t===0&&(e.mode&1?(t=La,La<<=1,!(La&130023424)&&(La=4194304)):t=1);var n=rt();e=Dn(e,t),e!==null&&(ta(e,t,n),ft(e,n))}function xj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jw(e,n)}function wj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),jw(e,n)}var Nw;Nw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ct.current)ut=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ut=!1,uj(e,t,n);ut=!!(e.flags&131072)}else ut=!1,ge&&t.flags&1048576&&Ux(t,Xl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;bl(e,t),e=t.pendingProps;var i=to(t,Ye.current);Ui(t,n),i=em(null,t,r,e,i,n);var o=tm();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dt(r)?(o=!0,Gl(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Xp(t),i.updater=Qu,t.stateNode=i,i._reactInternals=t,Hf(t,r,e,n),t=qf(null,t,r,!0,o,n)):(t.tag=0,ge&&o&&Vp(t),et(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(bl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Cj(r),e=Ft(r,e),i){case 0:t=Gf(null,t,r,e,n);break e;case 1:t=D0(null,t,r,e,n);break e;case 11:t=z0(null,t,r,e,n);break e;case 14:t=I0(null,t,r,Ft(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),Gf(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),D0(e,t,r,i,n);case 3:e:{if(ww(t),e===null)throw Error(z(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Xx(e,t),Zl(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=oo(Error(z(423)),t),t=j0(e,t,r,n,i);break e}else if(r!==i){i=oo(Error(z(424)),t),t=j0(e,t,r,n,i);break e}else for(yt=sr(t.stateNode.containerInfo.firstChild),St=t,ge=!0,Vt=null,n=Gx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(no(),r===i){t=jn(e,t,n);break e}et(e,t,r,n)}t=t.child}return t;case 5:return Yx(t),e===null&&Vf(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Df(r,i)?s=null:o!==null&&Df(r,o)&&(t.flags|=32),xw(e,t),et(e,t,s,n),t.child;case 6:return e===null&&Vf(t),null;case 13:return kw(e,t,n);case 4:return Yp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ro(t,null,r,n):et(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),z0(e,t,r,i,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,le(Yl,r._currentValue),r._currentValue=s,o!==null)if(qt(o.value,s)){if(o.children===i.children&&!ct.current){t=jn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=On(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Uf(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(z(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Uf(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}et(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Ui(t,n),i=zt(i),r=r(i),t.flags|=1,et(e,t,r,n),t.child;case 14:return r=t.type,i=Ft(r,t.pendingProps),i=Ft(r.type,i),I0(e,t,r,i,n);case 15:return bw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),bl(e,t),t.tag=1,dt(r)?(e=!0,Gl(t)):e=!1,Ui(t,n),gw(t,r,i),Hf(t,r,i,n),qf(null,t,r,!0,e,n);case 19:return Cw(e,t,n);case 22:return Sw(e,t,n)}throw Error(z(156,t.tag))};function Fw(e,t){return hx(e,t)}function kj(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lt(e,t,n,r){return new kj(e,t,n,r)}function dm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cj(e){if(typeof e=="function")return dm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rp)return 11;if(e===Ap)return 14}return 2}function cr(e,t){var n=e.alternate;return n===null?(n=Lt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function wl(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")dm(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ki:return Kr(n.children,i,o,t);case $p:s=8,i|=8;break;case mf:return e=Lt(12,n,t,i|2),e.elementType=mf,e.lanes=o,e;case gf:return e=Lt(13,n,t,i),e.elementType=gf,e.lanes=o,e;case yf:return e=Lt(19,n,t,i),e.elementType=yf,e.lanes=o,e;case YS:return ec(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qS:s=10;break e;case XS:s=9;break e;case Rp:s=11;break e;case Ap:s=14;break e;case Xn:s=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Lt(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Kr(e,t,n,r){return e=Lt(7,e,r,t),e.lanes=n,e}function ec(e,t,n,r){return e=Lt(22,e,r,t),e.elementType=YS,e.lanes=n,e.stateNode={isHidden:!1},e}function wd(e,t,n){return e=Lt(6,e,null,t),e.lanes=n,e}function kd(e,t,n){return t=Lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Tj(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rd(0),this.expirationTimes=rd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rd(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function fm(e,t,n,r,i,o,s,a,l){return e=new Tj(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Lt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xp(o),e}function Pj(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ww)}catch(e){console.error(e)}}Ww(),WS.exports=Ct;var gm=WS.exports;const[Hw,Aj]=Xt({strict:!1,name:"PortalContext"}),ym="chakra-portal",Oj=".chakra-portal",Lj=e=>O.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),Mj=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=x.useState(null),o=x.useRef(null),[,s]=x.useState({});x.useEffect(()=>s({}),[]);const a=Aj(),l=fL();Dd(()=>{if(!r)return;const c=r.ownerDocument,d=t?a??c.body:c.body;if(!d)return;o.current=c.createElement("div"),o.current.className=ym,d.appendChild(o.current),s({});const f=o.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const u=l!=null&&l.zIndex?O.jsx(Lj,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return o.current?gm.createPortal(O.jsx(Hw,{value:o.current,children:u}),o.current):O.jsx("span",{ref:c=>{c&&i(c)}})},zj=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),s=x.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=ym),l},[i]),[,a]=x.useState({});return Dd(()=>a({}),[]),Dd(()=>{if(!(!s||!o))return o.appendChild(s),()=>{o.removeChild(s)}},[s,o]),o&&s?gm.createPortal(O.jsx(Hw,{value:r?s:null,children:t}),s):null};function oc(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?O.jsx(zj,{containerRef:n,...r}):O.jsx(Mj,{...r})}oc.className=ym;oc.selector=Oj;oc.displayName="Portal";const[Ij,nB]=Xt({name:"ToastOptionsContext",strict:!1}),Dj=e=>{const t=x.useSyncExternalStore(rs.subscribe,rs.getState,rs.getState),{motionVariants:n,component:r=LS,portalProps:i,animatePresenceProps:o}=e,a=Object.keys(t).map(l=>{const u=t[l];return O.jsx("div",{role:"region","aria-live":"polite","aria-label":`Notifications-${l}`,id:`chakra-toast-manager-${l}`,style:WI(l),children:O.jsx(BI,{...o,initial:!1,children:u.map(c=>O.jsx(r,{motionVariants:n,...c},c.id))})},l)});return O.jsx(oc,{...i,children:a})},jj=e=>function({children:n,theme:r=e,toastOptions:i,...o}){return O.jsxs(hL,{theme:r,...o,children:[O.jsx(Ij,{value:i==null?void 0:i.defaultOptions,children:n}),O.jsx(Dj,{...i})]})},Nj=jj(QA);function Y0(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}const Fj=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function Q0(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function Z0(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}const sh=typeof window<"u"?x.useLayoutEffect:x.useEffect,au=e=>e;var Bj=Object.defineProperty,Vj=(e,t,n)=>t in e?Bj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,we=(e,t,n)=>(Vj(e,typeof t!="symbol"?t+"":t,n),n);class Uj{constructor(){we(this,"descendants",new Map),we(this,"register",t=>{if(t!=null)return Fj(t)?this.registerNode(t):n=>{this.registerNode(n,t)}}),we(this,"unregister",t=>{this.descendants.delete(t);const n=Y0(Array.from(this.descendants.keys()));this.assignIndex(n)}),we(this,"destroy",()=>{this.descendants.clear()}),we(this,"assignIndex",t=>{this.descendants.forEach(n=>{const r=t.indexOf(n.node);n.index=r,n.node.dataset.index=n.index.toString()})}),we(this,"count",()=>this.descendants.size),we(this,"enabledCount",()=>this.enabledValues().length),we(this,"values",()=>Array.from(this.descendants.values()).sort((n,r)=>n.index-r.index)),we(this,"enabledValues",()=>this.values().filter(t=>!t.disabled)),we(this,"item",t=>{if(this.count()!==0)return this.values()[t]}),we(this,"enabledItem",t=>{if(this.enabledCount()!==0)return this.enabledValues()[t]}),we(this,"first",()=>this.item(0)),we(this,"firstEnabled",()=>this.enabledItem(0)),we(this,"last",()=>this.item(this.descendants.size-1)),we(this,"lastEnabled",()=>{const t=this.enabledValues().length-1;return this.enabledItem(t)}),we(this,"indexOf",t=>{var n;return t?((n=this.descendants.get(t))==null?void 0:n.index)??-1:-1}),we(this,"enabledIndexOf",t=>t==null?-1:this.enabledValues().findIndex(n=>n.node.isSameNode(t))),we(this,"next",(t,n=!0)=>{const r=Q0(t,this.count(),n);return this.item(r)}),we(this,"nextEnabled",(t,n=!0)=>{const r=this.item(t);if(!r)return;const i=this.enabledIndexOf(r.node),o=Q0(i,this.enabledCount(),n);return this.enabledItem(o)}),we(this,"prev",(t,n=!0)=>{const r=Z0(t,this.count()-1,n);return this.item(r)}),we(this,"prevEnabled",(t,n=!0)=>{const r=this.item(t);if(!r)return;const i=this.enabledIndexOf(r.node),o=Z0(i,this.enabledCount()-1,n);return this.enabledItem(o)}),we(this,"registerNode",(t,n)=>{if(!t||this.descendants.has(t))return;const r=Array.from(this.descendants.keys()).concat(t),i=Y0(r);n!=null&&n.disabled&&(n.disabled=!!n.disabled);const o={node:t,index:-1,...n};this.descendants.set(t,o),this.assignIndex(i)})}}function Wj(){const e=x.useRef(new Uj);return sh(()=>()=>e.current.destroy()),e.current}const[Hj,Kw]=Xt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function Kj(e){const t=Kw(),[n,r]=x.useState(-1),i=x.useRef(null);sh(()=>()=>{i.current&&t.unregister(i.current)},[]),sh(()=>{if(!i.current)return;const s=Number(i.current.dataset.index);n!=s&&!Number.isNaN(s)&&r(s)});const o=au(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:gu(o,i)}}function Gj(){return[au(Hj),()=>au(Kw()),()=>Wj(),i=>Kj(i)]}const ah=it("div");ah.displayName="Box";var Gw={exports:{}},qj="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Xj=qj,Yj=Xj;function qw(){}function Xw(){}Xw.resetWarningCache=qw;var Qj=function(){function e(r,i,o,s,a,l){if(l!==Yj){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Xw,resetWarningCache:qw};return n.PropTypes=n,n};Gw.exports=Qj();var Zj=Gw.exports;const _r=ei(Zj);function Jj(){const e=x.useRef(new Map),t=e.current,n=x.useCallback((i,o,s,a)=>{e.current.set(s,{type:o,el:i,options:a}),i.addEventListener(o,s,a)},[]),r=x.useCallback((i,o,s,a)=>{i.removeEventListener(o,s,a),e.current.delete(s)},[]);return x.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function Cd(e){var i,o;const t=((o=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:o[0])??e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function eN(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:s,onMouseUp:a,onClick:l,onKeyDown:u,onKeyUp:c,tabIndex:d,onMouseOver:f,onMouseLeave:p,...v}=e,[y,S]=x.useState(!0),[m,h]=x.useState(!1),g=Jj(),w=L=>{L&&L.tagName!=="BUTTON"&&S(!1)},P=y?d:d||0,$=n&&!r,_=x.useCallback(L=>{if(n){L.stopPropagation(),L.preventDefault();return}L.currentTarget.focus(),l==null||l(L)},[n,l]),A=x.useCallback(L=>{m&&Cd(L)&&(L.preventDefault(),L.stopPropagation(),h(!1),g.remove(document,"keyup",A,!1))},[m,g]),B=x.useCallback(L=>{if(u==null||u(L),n||L.defaultPrevented||L.metaKey||!Cd(L.nativeEvent)||y)return;const R=i&&L.key==="Enter";o&&L.key===" "&&(L.preventDefault(),h(!0)),R&&(L.preventDefault(),L.currentTarget.click()),g.add(document,"keyup",A,!1)},[n,y,u,i,o,g,A]),j=x.useCallback(L=>{if(c==null||c(L),n||L.defaultPrevented||L.metaKey||!Cd(L.nativeEvent)||y)return;o&&L.key===" "&&(L.preventDefault(),h(!1),L.currentTarget.click())},[o,y,n,c]),H=x.useCallback(L=>{L.button===0&&(h(!1),g.remove(document,"mouseup",H,!1))},[g]),ce=x.useCallback(L=>{if(L.button!==0)return;if(n){L.stopPropagation(),L.preventDefault();return}y||h(!0),L.currentTarget.focus({preventScroll:!0}),g.add(document,"mouseup",H,!1),s==null||s(L)},[n,y,s,g,H]),Ze=x.useCallback(L=>{L.button===0&&(y||h(!1),a==null||a(L))},[a,y]),Re=x.useCallback(L=>{if(n){L.preventDefault();return}f==null||f(L)},[n,f]),T=x.useCallback(L=>{m&&(L.preventDefault(),h(!1)),p==null||p(L)},[m,p]),M=gu(t,w);return y?{...v,ref:M,type:"button","aria-disabled":$?void 0:n,disabled:$,onClick:_,onMouseDown:s,onMouseUp:a,onKeyUp:c,onKeyDown:u,onMouseOver:f,onMouseLeave:p}:{...v,ref:M,role:"button","data-active":vT(m),"aria-disabled":n?"true":void 0,tabIndex:$?void 0:P,onClick:_,onMouseDown:ce,onMouseUp:Ze,onKeyUp:j,onKeyDown:B,onMouseOver:Re,onMouseLeave:T}}const[tN,nN,rN,iN]=Gj();function oN(e){const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:s="unmount",orientation:a="horizontal",direction:l="ltr",...u}=e,[c,d]=x.useState(t??0),[f,p]=OT({defaultValue:t??0,value:r,onChange:n});x.useEffect(()=>{r!=null&&d(r)},[r]);const v=rN(),y=x.useId();return{id:`tabs-${e.id??y}`,selectedIndex:f,focusedIndex:c,setSelectedIndex:p,setFocusedIndex:d,isManual:i,isLazy:o,lazyBehavior:s,orientation:a,descendants:v,direction:l,htmlProps:u}}const[sN,Yw]=Xt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function aN(e){const{focusedIndex:t,orientation:n,direction:r}=Yw(),i=nN(),o=x.useCallback(s=>{const a=()=>{var g;const h=i.nextEnabled(t);h&&((g=h.node)==null||g.focus())},l=()=>{var g;const h=i.prevEnabled(t);h&&((g=h.node)==null||g.focus())},u=()=>{var g;const h=i.firstEnabled();h&&((g=h.node)==null||g.focus())},c=()=>{var g;const h=i.lastEnabled();h&&((g=h.node)==null||g.focus())},d=n==="horizontal",f=n==="vertical",p=s.key,v=r==="ltr"?"ArrowLeft":"ArrowRight",y=r==="ltr"?"ArrowRight":"ArrowLeft",m={[v]:()=>d&&l(),[y]:()=>d&&a(),ArrowDown:()=>f&&a(),ArrowUp:()=>f&&l(),Home:u,End:c}[p];m&&(s.preventDefault(),m(s))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Id(e.onKeyDown,o)}}function lN(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:i,isManual:o,id:s,setFocusedIndex:a,selectedIndex:l}=Yw(),{index:u,register:c}=iN({disabled:t&&!n}),d=u===l,f=()=>{i(u)},p=()=>{a(u),!o&&!(t&&n)&&i(u)};return{...eN({...r,ref:gu(c,e.ref),isDisabled:t,isFocusable:n,onClick:Id(e.onClick,f)}),id:uN(s,u),role:"tab",tabIndex:d?0:-1,type:"button","aria-selected":d,"aria-controls":cN(s,u),onFocus:t?void 0:Id(e.onFocus,p)}}Xt({});function uN(e,t){return`${e}--tab-${t}`}function cN(e,t){return`${e}--tabpanel-${t}`}const[dN,Qw]=Xt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Zw=Fn(function(t,n){const r=IS("Tabs",t),{children:i,className:o,...s}=vu(t),{htmlProps:a,descendants:l,...u}=oN(s),c=x.useMemo(()=>u,[u]),{isFitted:d,...f}=a,p={position:"relative",...r.root};return O.jsx(tN,{value:l,children:O.jsx(sN,{value:c,children:O.jsx(dN,{value:r,children:O.jsx(it.div,{className:Nn("chakra-tabs",o),ref:n,...f,__css:p,children:i})})})})});Zw.displayName="Tabs";const lh=Fn(function(t,n){const r=Qw(),i=lN({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return O.jsx(it.button,{...i,className:Nn("chakra-tabs__tab",t.className),__css:o})});lh.displayName="Tab";const Jw=Fn(function(t,n){const r=aN({...t,ref:n}),i=Qw(),o={display:"flex",...i.tablist};return O.jsx(it.div,{...r,className:Nn("chakra-tabs__tablist",t.className),__css:o})});Jw.displayName="TabList";var ek,tk,J0=gm;tk=J0.createRoot,ek=J0.hydrateRoot;/** - * @remix-run/router v1.20.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function nk(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function hN(){return Math.random().toString(36).substr(2,8)}function tv(e,t){return{usr:e.state,key:e.key,idx:t}}function uh(e,t,n,r){return n===void 0&&(n=null),Us({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?mo(t):t,{state:n,key:t&&t.key||r||hN()})}function lu(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function mo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function pN(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=nr.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(Us({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){a=nr.Pop;let S=c(),m=S==null?null:S-u;u=S,l&&l({action:a,location:y.location,delta:m})}function f(S,m){a=nr.Push;let h=uh(y.location,S,m);u=c()+1;let g=tv(h,u),w=y.createHref(h);try{s.pushState(g,"",w)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(w)}o&&l&&l({action:a,location:y.location,delta:1})}function p(S,m){a=nr.Replace;let h=uh(y.location,S,m);u=c();let g=tv(h,u),w=y.createHref(h);s.replaceState(g,"",w),o&&l&&l({action:a,location:y.location,delta:0})}function v(S){let m=i.location.origin!=="null"?i.location.origin:i.location.href,h=typeof S=="string"?S:lu(S);return h=h.replace(/ $/,"%20"),$e(m,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,m)}let y={get action(){return a},get location(){return e(i,s)},listen(S){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(ev,d),l=S,()=>{i.removeEventListener(ev,d),l=null}},createHref(S){return t(i,S)},createURL:v,encodeLocation(S){let m=v(S);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:p,go(S){return s.go(S)}};return y}var nv;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(nv||(nv={}));function mN(e,t,n){return n===void 0&&(n="/"),gN(e,t,n,!1)}function gN(e,t,n,r){let i=typeof t=="string"?mo(t):t,o=vm(i.pathname||"/",n);if(o==null)return null;let s=rk(e);yN(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&($e(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=dr([r,l.relativePath]),c=n.concat(l);o.children&&o.children.length>0&&($e(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),rk(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:CN(u,o.index),routesMeta:c})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of ik(o.path))i(o,s,l)}),t}function ik(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=ik(r.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function yN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:TN(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const vN=/^:[\w-]+$/,bN=3,SN=2,xN=1,wN=10,kN=-2,rv=e=>e==="*";function CN(e,t){let n=e.split("/"),r=n.length;return n.some(rv)&&(r+=kN),t&&(r+=SN),n.filter(i=>!rv(i)).reduce((i,o)=>i+(vN.test(o)?bN:o===""?xN:wN),r)}function TN(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function PN(e,t,n){let{routesMeta:r}=e,i={},o="/",s=[];for(let a=0;a{let{paramName:f,isOptional:p}=c;if(f==="*"){let y=a[d]||"";s=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const v=a[d];return p&&!v?u[f]=void 0:u[f]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:s,pattern:e}}function EN(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),nk(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function _N(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nk(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function vm(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function $N(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?mo(e):e;return{pathname:n?n.startsWith("/")?n:RN(n,t):t,search:LN(r),hash:MN(i)}}function RN(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Td(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function AN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ok(e,t){let n=AN(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function sk(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=mo(e):(i=Us({},e),$e(!i.pathname||!i.pathname.includes("?"),Td("?","pathname","search",i)),$e(!i.pathname||!i.pathname.includes("#"),Td("#","pathname","hash",i)),$e(!i.search||!i.search.includes("#"),Td("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=$N(i,a),u=s&&s!=="/"&&s.endsWith("/"),c=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const dr=e=>e.join("/").replace(/\/\/+/g,"/"),ON=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),LN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,MN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function zN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ak=["post","put","patch","delete"];new Set(ak);const IN=["get",...ak];new Set(IN);/** - * React Router v6.27.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Ws(){return Ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),x.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=sk(u,JSON.parse(s),o,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:dr([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,s,o,e])}function rB(){let{matches:e}=x.useContext(wr),t=e[e.length-1];return t?t.params:{}}function ck(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(ri),{matches:i}=x.useContext(wr),{pathname:o}=sa(),s=JSON.stringify(ok(i,r.v7_relativeSplatPath));return x.useMemo(()=>sk(e,JSON.parse(s),o,n==="path"),[e,s,o,n])}function BN(e,t){return VN(e,t)}function VN(e,t,n,r){oa()||$e(!1);let{navigator:i}=x.useContext(ri),{matches:o}=x.useContext(wr),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=sa(),c;if(t){var d;let S=typeof t=="string"?mo(t):t;l==="/"||(d=S.pathname)!=null&&d.startsWith(l)||$e(!1),c=S}else c=u;let f=c.pathname||"/",p=f;if(l!=="/"){let S=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=mN(e,{pathname:p}),y=GN(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:dr([l,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?l:dr([l,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&y?x.createElement(sc.Provider,{value:{location:Ws({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:nr.Pop}},y):y}function UN(){let e=QN(),t=zN(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:i},n):null,null)}const WN=x.createElement(UN,null);class HN extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement(wr.Provider,{value:this.props.routeContext},x.createElement(lk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function KN(e){let{routeContext:t,match:n,children:r}=e,i=x.useContext(bm);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(wr.Provider,{value:t},r)}function GN(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let c=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||$e(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,f)=>{let p,v=!1,y=null,S=null;n&&(p=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||WN,l&&(u<0&&f===0?(v=!0,S=null):u===f&&(v=!0,S=d.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,f+1)),h=()=>{let g;return p?g=y:v?g=S:d.route.Component?g=x.createElement(d.route.Component,null):d.route.element?g=d.route.element:g=c,x.createElement(KN,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:n!=null},children:g})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?x.createElement(HN,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):h()},null)}var dk=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(dk||{}),uu=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(uu||{});function qN(e){let t=x.useContext(bm);return t||$e(!1),t}function XN(e){let t=x.useContext(DN);return t||$e(!1),t}function YN(e){let t=x.useContext(wr);return t||$e(!1),t}function fk(e){let t=YN(),n=t.matches[t.matches.length-1];return n.route.id||$e(!1),n.route.id}function QN(){var e;let t=x.useContext(lk),n=XN(uu.UseRouteError),r=fk(uu.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function ZN(){let{router:e}=qN(dk.UseNavigateStable),t=fk(uu.UseNavigateStable),n=x.useRef(!1);return uk(()=>{n.current=!0}),x.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ws({fromRouteId:t},o)))},[e,t])}function Gn(e){$e(!1)}function JN(e){let{basename:t="/",children:n=null,location:r,navigationType:i=nr.Pop,navigator:o,static:s=!1,future:a}=e;oa()&&$e(!1);let l=t.replace(/^\/*/,"/"),u=x.useMemo(()=>({basename:l,navigator:o,static:s,future:Ws({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof r=="string"&&(r=mo(r));let{pathname:c="/",search:d="",hash:f="",state:p=null,key:v="default"}=r,y=x.useMemo(()=>{let S=vm(c,l);return S==null?null:{location:{pathname:S,search:d,hash:f,state:p,key:v},navigationType:i}},[l,c,d,f,p,v,i]);return y==null?null:x.createElement(ri.Provider,{value:u},x.createElement(sc.Provider,{children:n,value:y}))}function e4(e){let{children:t,location:n}=e;return BN(ch(t),n)}new Promise(()=>{});function ch(e,t){t===void 0&&(t=[]);let n=[];return x.Children.forEach(e,(r,i)=>{if(!x.isValidElement(r))return;let o=[...t,i];if(r.type===x.Fragment){n.push.apply(n,ch(r.props.children,o));return}r.type!==Gn&&$e(!1),!r.props.index||!r.props.children||$e(!1);let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=ch(r.props.children,o)),n.push(s)}),n}/** - * React Router DOM v6.27.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function dh(){return dh=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function n4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function r4(e,t){return e.button===0&&(!t||t==="_self")&&!n4(e)}const i4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],o4="6";try{window.__reactRouterVersion=o4}catch{}const s4="startTransition",ov=Md[s4];function a4(e){let{basename:t,children:n,future:r,window:i}=e,o=x.useRef();o.current==null&&(o.current=fN({window:i,v5Compat:!0}));let s=o.current,[a,l]=x.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=x.useCallback(d=>{u&&ov?ov(()=>l(d)):l(d)},[l,u]);return x.useLayoutEffect(()=>s.listen(c),[s,c]),x.createElement(JN,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const l4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",u4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sv=x.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=t,f=t4(t,i4),{basename:p}=x.useContext(ri),v,y=!1;if(typeof u=="string"&&u4.test(u)&&(v=u,l4))try{let g=new URL(window.location.href),w=u.startsWith("//")?new URL(g.protocol+u):new URL(u),P=vm(w.pathname,p);w.origin===g.origin&&P!=null?u=P+w.search+w.hash:y=!0}catch{}let S=jN(u,{relative:i}),m=c4(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:d});function h(g){r&&r(g),g.defaultPrevented||m(g)}return x.createElement("a",dh({},f,{href:v||S,onClick:y||o?r:h,ref:n,target:l}))});var av;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(av||(av={}));var lv;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(lv||(lv={}));function c4(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,viewTransition:a}=t===void 0?{}:t,l=NN(),u=sa(),c=ck(e,{relative:s});return x.useCallback(d=>{if(r4(d,n)){d.preventDefault();let f=r!==void 0?r:lu(u)===lu(c);l(e,{replace:f,state:i,preventScrollReset:o,relative:s,viewTransition:a})}},[u,l,c,r,i,n,e,o,s,a])}const d4={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 cu{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||d4,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-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 n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},uv=e=>e==null?"":""+e,f4=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},h4=/###/g,cv=e=>e&&e.indexOf("###")>-1?e.replace(h4,"."):e,dv=e=>!e||typeof e=="string",hs=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let i=0;for(;i{const{obj:r,k:i}=hs(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],s=t.slice(0,t.length-1),a=hs(e,s,Object);for(;a.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),a=hs(e,s,Object),a&&a.obj&&typeof a.obj[`${a.k}.${o}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=n},p4=(e,t,n,r)=>{const{obj:i,k:o}=hs(e,t,Object);i[o]=i[o]||[],i[o].push(n)},du=(e,t)=>{const{obj:n,k:r}=hs(e,t);if(n)return n[r]},m4=(e,t,n)=>{const r=du(e,n);return r!==void 0?r:du(t,n)},hk=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):hk(e[r],t[r],n):e[r]=t[r]);return e},li=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var g4={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const y4=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>g4[t]):e;class v4{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const b4=[" ",",","?","!",";"],S4=new v4(20),x4=(e,t,n)=>{t=t||"",n=n||"";const r=b4.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=S4.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o},fh=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let o=0;o-1&&le&&e.indexOf("_")>0?e.replace("_","-"):e;class hv extends ac{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,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 n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){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,n],r&&(Array.isArray(r)?a.push(...r):typeof r=="string"&&o?a.push(...r.split(o)):a.push(r)));const l=du(this.data,a);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),l||!s||typeof r!="string"?l:fh(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,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,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(a=t.split("."),i=n,n=a[1]),this.addNamespaces(n),fv(this.data,a,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),i=r,r=n,n=a[1]),this.addNamespaces(n);let l=du(this.data,a)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?hk(l,r,o):l={...l,...r},fv(this.data,a,l),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var pk={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,i))}),t}};const pv={};class hu extends ac{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),f4(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ln.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!x4(t,r,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(r);(r!==i||r===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,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],n),l=a[a.length-1],u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const w=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${w}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${w}${s}`}return i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s}const d=this.resolve(t,n);let f=d&&d.res;const p=d&&d.usedKey||s,v=d&&d.exactUsedKey||s,y=Object.prototype.toString.apply(f),S=["[object Number]","[object Function]","[object RegExp]"],m=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,h=!this.i18nFormat||this.i18nFormat.handleAsObject;if(h&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&S.indexOf(y)<0&&!(typeof m=="string"&&Array.isArray(f))){if(!n.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,{...n,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(d.res=w,d.usedParams=this.getUsedParamsDetails(n),d):w}if(o){const w=Array.isArray(f),P=w?[]:{},$=w?v:p;for(const _ in f)if(Object.prototype.hasOwnProperty.call(f,_)){const A=`${$}${o}${_}`;P[_]=this.translate(A,{...n,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,n,r));else{let w=!1,P=!1;const $=n.count!==void 0&&typeof n.count!="string",_=hu.hasDefaultValue(n),A=$?this.pluralResolver.getSuffix(u,n.count,n):"",B=n.ordinal&&$?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",j=$&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),H=j&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${A}`]||n[`defaultValue${B}`]||n.defaultValue;!this.isValidLookup(f)&&_&&(w=!0,f=H),this.isValidLookup(f)||(P=!0,f=s);const Ze=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:f,Re=_&&H!==f&&this.options.updateMissing;if(P||w||Re){if(this.logger.log(Re?"updateKey":"missingKey",u,l,s,Re?H:f),o){const R=this.resolve(s,{...n,keySeparator:!1});R&&R.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 M=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&M&&M[0])for(let R=0;R{const Q=_&&I!==f?I:Ze;this.options.missingKeyHandler?this.options.missingKeyHandler(R,l,D,Q,Re,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(R,l,D,Q,Re,n),this.emit("missingKey",R,l,D,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&$?T.forEach(R=>{const D=this.pluralResolver.getSuffixes(R,n);j&&n[`defaultValue${this.options.pluralSeparator}zero`]&&D.indexOf(`${this.options.pluralSeparator}zero`)<0&&D.push(`${this.options.pluralSeparator}zero`),D.forEach(I=>{L([R],s+I,n[`defaultValue${I}`]||H)})}):L(T,s,H))}f=this.extendTranslation(f,t,n,d,r),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(n),d):f}extendTranslation(t,n,r,i,o){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const f=t.match(this.interpolator.nestingRegexp);c=f&&f.length}let d=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language||i.usedLng,r),u){const f=t.match(this.interpolator.nestingRegexp),p=f&&f.length;c1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,s,a;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",p=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),v=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(S=>{this.isValidLookup(r)||(a=S,!pv[`${y[0]}-${S}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(pv[`${y[0]}-${S}`]=!0,this.logger.warn(`key "${i}" for languages "${y.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!!!")),y.forEach(m=>{if(this.isValidLookup(r))return;s=m;const h=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(h,c,m,S,n);else{let w;f&&(w=this.pluralResolver.getSuffix(m,n.count,n));const P=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(h.push(c+w),n.ordinal&&w.indexOf($)===0&&h.push(c+w.replace($,this.options.pluralSeparator)),p&&h.push(c+P)),v){const _=`${c}${this.options.contextSeparator}${n.context}`;h.push(_),f&&(h.push(_+w),n.ordinal&&w.indexOf($)===0&&h.push(_+w.replace($,this.options.pluralSeparator)),p&&h.push(_+P))}}let g;for(;g=h.pop();)this.isValidLookup(r)||(o=g,r=this.getResource(m,S,g,n))}))})}),{res:r,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,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const Pd=e=>e.charAt(0).toUpperCase()+e.slice(1);class mv{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ln.create("languageUtils")}getScriptPartFromCode(t){if(t=fu(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=fu(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Pd(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Pd(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Pd(r[2].toLowerCase()))),r.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 n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=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})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||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)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}let w4=[{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}],k4={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 C4=["v1","v2","v3"],T4=["v4"],gv={zero:0,one:1,two:2,few:3,many:4,other:5},P4=()=>{const e={};return w4.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:k4[t.fc]}})}),e};class E4{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=ln.create("pluralResolver"),(!this.options.compatibilityJSON||T4.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=P4(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=fu(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const s=new Intl.PluralRules(r,{type:i});return this.pluralRulesCache[o]=s,s}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,o)=>gv[i]-gv[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(t,i,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let i=t.numbers[r];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&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!C4.includes(this.options.compatibilityJSON)}}const yv=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=m4(e,t,n);return!o&&i&&typeof n=="string"&&(o=fh(e,n,r),o===void 0&&(o=fh(t,n,r))),o},Ed=e=>e.replace(/\$/g,"$$$$");class _4{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ln.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:s,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:v,nestingSuffixEscaped:y,nestingOptionsSeparator:S,maxReplaces:m,alwaysFormat:h}=t.interpolation;this.escape=n!==void 0?n:y4,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?li(o):s||"{{",this.suffix=a?li(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=f?li(f):p||li("$t("),this.nestingSuffix=v?li(v):y||li(")"),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=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"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,n,r,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=yv(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(m,void 0,r,{...i,...n,interpolationkey:p}):m}const v=p.split(this.formatSeparator),y=v.shift().trim(),S=v.join(this.formatSeparator).trim();return this.format(yv(n,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...i,...n,interpolationkey:y})};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=>Ed(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?Ed(this.escape(p)):Ed(p)}].forEach(p=>{for(a=0;o=p.regex.exec(t);){const v=o[1].trim();if(s=u(v),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,v))s="";else if(d){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=uv(s));const y=p.safeValue(s);if(t=t.replace(o[0],y),d?(p.regex.lastIndex+=s.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=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),v=f.match(/"/g);(p&&p.length%2===0&&!v||v.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),u&&(s={...u,...s})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${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={...r},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=n(a.call(this,i[1].trim(),s),s),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=uv(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const $4=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(s=>{if(s){const[a,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();n[c]||(n[c]=u),u==="false"&&(n[c]=!1),u==="true"&&(n[c]=!0),isNaN(u)||(n[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},ui=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let a=t[s];return a||(a=e(fu(r),i),t[s]=a),a(n)}};class R4{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ln.create("formatter"),this.options=t,this.formats={number:ui((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:ui((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:ui((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:ui((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:ui((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=ui(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.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}=$4(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||r;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 A4=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class O4 extends ac{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=ln.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(r,i.backend,i)}queueLoad(t,n,r,i){const o={},s={},a={},l={};return t.forEach(u=>{let c=!0;n.forEach(d=>{const f=`${u}|${d}`;!r.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,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),!n&&r&&this.store.addResourceBundle(o,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(l=>{p4(l.loaded,[o],s),A4(l,t),n&&l.errors.push(n),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,n,r){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:n,fcName:r,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,n,r,i+1,o*2,s)},o);return}s(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>a(null,c)).catch(a):a(null,u)}catch(u){a(u)}return}return l(t,n,a)}prepareLoading(t,n){let r=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 n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,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(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){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,n,r,i,l):c=u(t,n,r,i),c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}else u(t,n,r,i,a,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const vv=()=>({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 n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),bv=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),Ha=()=>{},L4=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Hs extends ac{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=bv(t),this.services={},this.logger=ln,this.modules={external:[]},L4(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=vv();this.options={...i,...this.options,...bv(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?ln.init(o(this.modules.logger),this.options):ln.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=R4);const d=new mv(this.options);this.store=new hv(this.options.resources,this.options);const f=this.services;f.logger=ln,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new E4(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 _4(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new O4(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var v=arguments.length,y=new Array(v>1?v-1:0),S=1;S1?v-1:0),S=1;S{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Ha),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=Mo(),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),r(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 r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ha;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();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),r(a)})}else r(null)}reloadResources(t,n,r){const i=Mo();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Ha),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(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"&&pk.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 n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Mo();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 r.t(...arguments)}),n&&n(l,function(){return r.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,n,r){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}${v}`):p=l.keyPrefix?`${l.keyPrefix}${f}${s}`:s,i.t(p,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,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 n=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 r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=Mo();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=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Mo();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=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["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"],r=this.services&&this.services.languageUtils||new mv(vv());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Hs(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ha;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Hs(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)},r&&(o.store=new hv(this.store.data,i),o.services.resourceStore=o.store),o.translator=new hu(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&&(Gr(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},Sv={},hh=(...e)=>{Gr(e[0])&&Sv[e[0]]||(Gr(e[0])&&(Sv[e[0]]=new Date),M4(...e))},mk=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},ph=(e,t,n)=>{e.loadNamespaces(t,mk(e,n))},xv=(e,t,n,r)=>{if(Gr(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return ph(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,mk(e,r))},z4=(e,t,n={})=>!t.languages||!t.languages.length?(hh("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{var o;if(((o=n.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Gr=e=>typeof e=="string",I4=e=>typeof e=="object"&&e!==null,D4=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,j4={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},N4=e=>j4[e],F4=e=>e.replace(D4,N4);let mh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:F4};const B4=(e={})=>{mh={...mh,...e}},V4=()=>mh;let gk;const U4=e=>{gk=e},W4=()=>gk,H4={type:"3rdParty",init(e){B4(e.options.react),U4(e)}},K4=x.createContext();class G4{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const q4=(e,t)=>{const n=x.useRef();return x.useEffect(()=>{n.current=e},[e,t]),n.current},yk=(e,t,n,r)=>e.getFixedT(t,n,r),X4=(e,t,n,r)=>x.useCallback(yk(e,t,n,r),[e,t,n,r]),Y4=(e,t={})=>{var w,P,$,_;const{i18n:n}=t,{i18n:r,defaultNS:i}=x.useContext(K4)||{},o=n||r||W4();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new G4),!o){hh("You will need to pass in an i18next instance by using initReactI18next");const A=(j,H)=>Gr(H)?H:I4(H)&&Gr(H.defaultValue)?H.defaultValue:Array.isArray(j)?j[j.length-1]:j,B=[A,{},!1];return B.t=A,B.i18n={},B.ready=!1,B}(w=o.options.react)!=null&&w.wait&&hh("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...V4(),...o.options.react,...t},{useSuspense:a,keyPrefix:l}=s;let u=i||((P=o.options)==null?void 0:P.defaultNS);u=Gr(u)?[u]:u||["translation"],(_=($=o.reportNamespaces).addUsedNamespaces)==null||_.call($,u);const c=(o.isInitialized||o.initializedStoreOnce)&&u.every(A=>z4(A,o,s)),d=X4(o,t.lng||null,s.nsMode==="fallback"?u:u[0],l),f=()=>d,p=()=>yk(o,t.lng||null,s.nsMode==="fallback"?u:u[0],l),[v,y]=x.useState(f);let S=u.join();t.lng&&(S=`${t.lng}${S}`);const m=q4(S),h=x.useRef(!0);x.useEffect(()=>{const{bindI18n:A,bindI18nStore:B}=s;h.current=!0,!c&&!a&&(t.lng?xv(o,t.lng,u,()=>{h.current&&y(p)}):ph(o,u,()=>{h.current&&y(p)})),c&&m&&m!==S&&h.current&&y(p);const j=()=>{h.current&&y(p)};return A&&(o==null||o.on(A,j)),B&&(o==null||o.store.on(B,j)),()=>{h.current=!1,o&&(A==null||A.split(" ").forEach(H=>o.off(H,j))),B&&o&&B.split(" ").forEach(H=>o.store.off(H,j))}},[o,S]),x.useEffect(()=>{h.current&&c&&y(f)},[o,l,c]);const g=[v,o,c];if(g.t=v,g.i18n=o,g.ready=c,c||!c&&!a)return g;throw new Promise(A=>{t.lng?xv(o,t.lng,u,()=>A()):ph(o,u,()=>A())})};function gh(e){"@babel/helpers - typeof";return gh=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},gh(e)}function vk(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":gh(XMLHttpRequest))==="object"}function Q4(e){return!!e&&typeof e.then=="function"}function Z4(e){return Q4(e)?e:Promise.resolve(e)}function J4(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 yh={exports:{}},Ka={exports:{}},wv;function eF(){return wv||(wv=1,function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof wn<"u"&&wn,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,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 v(T){var M={next:function(){var L=T.shift();return{done:L===void 0,value:L}}};return l.iterable&&(M[Symbol.iterator]=function(){return M}),M}function y(T){this.map={},T instanceof y?T.forEach(function(M,L){this.append(L,M)},this):Array.isArray(T)?T.forEach(function(M){this.append(M[0],M[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(M){this.append(M,T[M])},this)}y.prototype.append=function(T,M){T=f(T),M=p(M);var L=this.map[T];this.map[T]=L?L+", "+M:M},y.prototype.delete=function(T){delete this.map[f(T)]},y.prototype.get=function(T){return T=f(T),this.has(T)?this.map[T]:null},y.prototype.has=function(T){return this.map.hasOwnProperty(f(T))},y.prototype.set=function(T,M){this.map[f(T)]=p(M)},y.prototype.forEach=function(T,M){for(var L in this.map)this.map.hasOwnProperty(L)&&T.call(M,this.map[L],L,this)},y.prototype.keys=function(){var T=[];return this.forEach(function(M,L){T.push(L)}),v(T)},y.prototype.values=function(){var T=[];return this.forEach(function(M){T.push(M)}),v(T)},y.prototype.entries=function(){var T=[];return this.forEach(function(M,L){T.push([L,M])}),v(T)},l.iterable&&(y.prototype[Symbol.iterator]=y.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(M,L){T.onload=function(){M(T.result)},T.onerror=function(){L(T.error)}})}function h(T){var M=new FileReader,L=m(M);return M.readAsArrayBuffer(T),L}function g(T){var M=new FileReader,L=m(M);return M.readAsText(T),L}function w(T){for(var M=new Uint8Array(T),L=new Array(M.length),R=0;R-1?M:T}function B(T,M){if(!(this instanceof B))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');M=M||{};var L=M.body;if(T instanceof B){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,M.headers||(this.headers=new y(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!L&&T._bodyInit!=null&&(L=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=M.credentials||this.credentials||"same-origin",(M.headers||!this.headers)&&(this.headers=new y(M.headers)),this.method=A(M.method||this.method||"GET"),this.mode=M.mode||this.mode||null,this.signal=M.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&L)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(L),(this.method==="GET"||this.method==="HEAD")&&(M.cache==="no-store"||M.cache==="no-cache")){var R=/([?&])_=[^&]*/;if(R.test(this.url))this.url=this.url.replace(R,"$1_="+new Date().getTime());else{var D=/\?/;this.url+=(D.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}B.prototype.clone=function(){return new B(this,{body:this._bodyInit})};function j(T){var M=new FormData;return T.trim().split("&").forEach(function(L){if(L){var R=L.split("="),D=R.shift().replace(/\+/g," "),I=R.join("=").replace(/\+/g," ");M.append(decodeURIComponent(D),decodeURIComponent(I))}}),M}function H(T){var M=new y,L=T.replace(/\r?\n[\t ]+/g," ");return L.split("\r").map(function(R){return R.indexOf(` -`)===0?R.substr(1,R.length):R}).forEach(function(R){var D=R.split(":"),I=D.shift().trim();if(I){var Q=D.join(":").trim();M.append(I,Q)}}),M}$.call(B.prototype);function ce(T,M){if(!(this instanceof ce))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');M||(M={}),this.type="default",this.status=M.status===void 0?200:M.status,this.ok=this.status>=200&&this.status<300,this.statusText=M.statusText===void 0?"":""+M.statusText,this.headers=new y(M.headers),this.url=M.url||"",this._initBody(T)}$.call(ce.prototype),ce.prototype.clone=function(){return new ce(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},ce.error=function(){var T=new ce(null,{status:0,statusText:""});return T.type="error",T};var Ze=[301,302,303,307,308];ce.redirect=function(T,M){if(Ze.indexOf(M)===-1)throw new RangeError("Invalid status code");return new ce(null,{status:M,headers:{location:T}})},s.DOMException=a.DOMException;try{new s.DOMException}catch{s.DOMException=function(M,L){this.message=M,this.name=L;var R=Error(M);this.stack=R.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function Re(T,M){return new Promise(function(L,R){var D=new B(T,M);if(D.signal&&D.signal.aborted)return R(new s.DOMException("Aborted","AbortError"));var I=new XMLHttpRequest;function Q(){I.abort()}I.onload=function(){var K={status:I.status,statusText:I.statusText,headers:H(I.getAllResponseHeaders()||"")};K.url="responseURL"in I?I.responseURL:K.headers.get("X-Request-URL");var Je="response"in I?I.response:I.responseText;setTimeout(function(){L(new ce(Je,K))},0)},I.onerror=function(){setTimeout(function(){R(new TypeError("Network request failed"))},0)},I.ontimeout=function(){setTimeout(function(){R(new TypeError("Network request failed"))},0)},I.onabort=function(){setTimeout(function(){R(new s.DOMException("Aborted","AbortError"))},0)};function xe(K){try{return K===""&&a.location.href?a.location.href:K}catch{return K}}I.open(D.method,xe(D.url),!0),D.credentials==="include"?I.withCredentials=!0:D.credentials==="omit"&&(I.withCredentials=!1),"responseType"in I&&(l.blob?I.responseType="blob":l.arrayBuffer&&D.headers.get("Content-Type")&&D.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(I.responseType="arraybuffer")),M&&typeof M.headers=="object"&&!(M.headers instanceof y)?Object.getOwnPropertyNames(M.headers).forEach(function(K){I.setRequestHeader(K,p(M.headers[K]))}):D.headers.forEach(function(K,Je){I.setRequestHeader(Je,K)}),D.signal&&(D.signal.addEventListener("abort",Q),I.onreadystatechange=function(){I.readyState===4&&D.signal.removeEventListener("abort",Q)}),I.send(typeof D._bodyInit>"u"?null:D._bodyInit)})}return Re.polyfill=!0,a.fetch||(a.fetch=Re,a.Headers=y,a.Request=B,a.Response=ce),s.Headers=y,s.Request=B,s.Response=ce,s.fetch=Re,s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;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}(Ka,Ka.exports)),Ka.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof wn<"u"&&wn.fetch?n=wn.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof J4<"u"&&typeof window>"u"){var r=n||eF();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(yh,yh.exports);var bk=yh.exports;const Sk=ei(bk),kv=Jv({__proto__:null,default:Sk},[bk]);function Cv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tv(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,")")),r&&(o["Content-Type"]="application/json");var s=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,a=Tv({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},Ev?{}:s),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{Pv(n,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]}),Pv(n,a,i,l),Ev=!0}catch(c){i(c)}}},oF=function(t,n,r,i){r&&Jr(r)==="object"&&(r=vh("",r).slice(1)),t.queryStringParams&&(n=vh(n,t.queryStringParams));try{var o;Ks?o=new Ks:o=new pu("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&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(r)}catch(l){console&&console.log(l)}},sF=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Ln&&n.indexOf("file:")!==0)return iF(t,n,r,i);if(vk()||typeof ActiveXObject=="function")return oF(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function ao(e){"@babel/helpers - typeof";return ao=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},ao(e)}function _v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _d(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};aF(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return uF(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=_d(_d(_d({},dF()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var s=setInterval(function(){return r.reload()},this.options.reloadInterval);ao(s)==="object"&&typeof s.unref=="function"&&s.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,s){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=Z4(l),l.then(function(u){if(!u)return s(null,{});var c=a.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});a.loadUrl(c,s,r,o)})}},{key:"loadUrl",value:function(n,r,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,n,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&c&&c.message){var f=c.message.toLowerCase(),p=["failed","fetch","network","load"].find(function(S){return f.indexOf(S)>-1});if(p)return r("failed loading "+n+": "+c.message,!0)}if(c)return r(c,!1);var v,y;try{typeof d.data=="string"?v=s.options.parse(d.data,i,o):v=d.data}catch{y="failed parsing "+n+" to json"}if(y)return r(y,!1);r(null,v)})}},{key:"create",value:function(n,r,i,o,s){var a=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,c=[],d=[];n.forEach(function(f){var p=a.options.addPath;typeof a.options.addPath=="function"&&(p=a.options.addPath(f,r));var v=a.services.interpolator.interpolate(p,{lng:f,ns:r});a.options.request(a.options,v,l,function(y,S){u+=1,c.push(y),d.push(S),u===n.length&&typeof s=="function"&&s(c,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,s=r.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){n.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)})})})}}}])}();kk.type="backend";Qe.use(kk).use(H4).init({fallbackLng:"de"});var fF=function(e,t,n,r,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=[n,r,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}},hF=fF;const $v=ei(hF);var pF=function(t,n,r,i){var o=r?r.call(i,t,n):void 0;if(o!==void 0)return!!o;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var s=Object.keys(t),a=Object.keys(n);if(s.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),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))(Ck||{}),$d={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"]}},Rv=Object.values(Ck),Sm={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},gF=Object.entries(Sm).reduce((e,[t,n])=>(e[n]=t,e),{}),Wt="data-rh",Hi={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Ki=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},yF=e=>{let t=Ki(e,"title");const n=Ki(e,Hi.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=Ki(e,Hi.DEFAULT_TITLE);return t||r||void 0},vF=e=>Ki(e,Hi.ON_CHANGE_CLIENT_STATE)||(()=>{}),Rd=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),bF=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const i=Object.keys(r);for(let o=0;oconsole&&typeof console.warn=="function"&&console.warn(e),zo=(e,t,n)=>{const r={};return n.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&SF(`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 n=0;n({baseTag:bF(["href"],e),bodyAttributes:Rd("bodyAttributes",e),defer:Ki(e,Hi.DEFER),encode:Ki(e,Hi.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Rd("htmlAttributes",e),linkTags:zo("link",["rel","href"],e),metaTags:zo("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:zo("noscript",["innerHTML"],e),onChangeClientState:vF(e),scriptTags:zo("script",["src","innerHTML"],e),styleTags:zo("style",["cssText"],e),title:yF(e),titleAttributes:Rd("titleAttributes",e),prioritizeSeoTags:xF(e,Hi.PRIORITIZE_SEO_TAGS)}),Tk=e=>Array.isArray(e)?e.join(""):e,kF=(e,t)=>{const n=Object.keys(e);for(let r=0;rArray.isArray(e)?e.reduce((n,r)=>(kF(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},Av=(e,t)=>({...e,[t]:void 0}),CF=["noscript","script","style"],bh=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),Pk=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),TF=(e,t,n,r)=>{const i=Pk(n),o=Tk(t);return i?`<${e} ${Wt}="true" ${i}>${bh(o,r)}`:`<${e} ${Wt}="true">${bh(o,r)}`},PF=(e,t,n=!0)=>t.reduce((r,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}="${bh(o[c],n)}"`;return u?`${u} ${d}`:d},""),a=o.innerHTML||o.cssText||"",l=CF.indexOf(e)===-1;return`${r}<${e} ${Wt}="true" ${s}${l?"/>":`>${a}`}`},""),Ek=(e,t={})=>Object.keys(e).reduce((n,r)=>{const i=Sm[r];return n[i||r]=e[r],n},t),EF=(e,t,n)=>{const r={key:t,[Wt]:!0},i=Ek(n,r);return[on.createElement("title",i,t)]},kl=(e,t)=>t.map((n,r)=>{const i={key:r,[Wt]:!0};return Object.keys(n).forEach(o=>{const a=Sm[o]||o;if(a==="innerHTML"||a==="cssText"){const l=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[a]=n[o]}),on.createElement(e,i)}),Rt=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>EF(e,t.title,t.titleAttributes),toString:()=>TF(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Ek(t),toString:()=>Pk(t)};default:return{toComponent:()=>kl(e,t),toString:()=>PF(e,t,n)}}},_F=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const i=Ad(e,$d.meta),o=Ad(t,$d.link),s=Ad(n,$d.script);return{priorityMethods:{toComponent:()=>[...kl("meta",i.priority),...kl("link",o.priority),...kl("script",s.priority)],toString:()=>`${Rt("meta",i.priority,r)} ${Rt("link",o.priority,r)} ${Rt("script",s.priority,r)}`},metaTags:i.default,linkTags:o.default,scriptTags:s.default}},$F=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!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}=_F(e)),{priority:p,base:Rt("base",t,r),bodyAttributes:Rt("bodyAttributes",n,r),htmlAttributes:Rt("htmlAttributes",i,r),link:Rt("link",c,r),meta:Rt("meta",d,r),noscript:Rt("noscript",o,r),script:Rt("script",f,r),style:Rt("style",s,r),title:Rt("title",{title:a,titleAttributes:l},r)}},Sh=$F,Ga=[],_k=!!(typeof window<"u"&&window.document&&window.document.createElement),xh=class{constructor(e,t){gn(this,"instances",[]);gn(this,"canUseDOM",_k);gn(this,"context");gn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Ga:this.instances,add:e=>{(this.canUseDOM?Ga:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Ga:this.instances).indexOf(e);(this.canUseDOM?Ga:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=Sh({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},RF={},$k=on.createContext(RF),Fr,Rk=(Fr=class extends x.Component{constructor(n){super(n);gn(this,"helmetData");this.helmetData=new xh(this.props.context||{},Fr.canUseDOM)}render(){return on.createElement($k.Provider,{value:this.helmetData.value},this.props.children)}},gn(Fr,"canUseDOM",_k),Fr),ci=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${Wt}]`),i=[].slice.call(r),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(Wt,"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=>n.appendChild(a)),{oldTags:i,newTags:o}},wh=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(Wt),i=r?r.split(","):[],o=[...i],s=Object.keys(t);for(const a of s){const l=t[a]||"";n.getAttribute(a)!==l&&n.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)n.removeAttribute(o[a]);i.length===o.length?n.removeAttribute(Wt):n.getAttribute(Wt)!==s.join(",")&&n.setAttribute(Wt,s.join(","))},AF=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=Tk(e)),wh("title",t)},Ov=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:o,metaTags:s,noscriptTags:a,onChangeClientState:l,scriptTags:u,styleTags:c,title:d,titleAttributes:f}=e;wh("body",r),wh("html",i),AF(d,f);const p={baseTag:ci("base",n),linkTags:ci("link",o),metaTags:ci("meta",s),noscriptTags:ci("noscript",a),scriptTags:ci("script",u),styleTags:ci("style",c)},v={},y={};Object.keys(p).forEach(S=>{const{newTags:m,oldTags:h}=p[S];m.length&&(v[S]=m),h.length&&(y[S]=p[S].oldTags)}),t&&t(),l(e,v,y)},Io=null,OF=e=>{Io&&cancelAnimationFrame(Io),e.defer?Io=requestAnimationFrame(()=>{Ov(e,()=>{Io=null})}):(Ov(e),Io=null)},LF=OF,Lv=class extends x.Component{constructor(){super(...arguments);gn(this,"rendered",!1)}shouldComponentUpdate(t){return!mF(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const i=wF(t.get().map(o=>{const s={...o.props};return delete s.context,s}));Rk.canUseDOM?LF(i):Sh&&(r=Sh(i)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},Ld,MF=(Ld=class extends x.Component{shouldComponentUpdate(e){return!MS(Av(this.props,"helmetData"),Av(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,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return $v(Rv.some(n=>e.type===n),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 ${Rv.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),$v(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="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 n={};return on.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:i,...o}=r.props,s=Object.keys(o).reduce((l,u)=>(l[gF[u]||u]=o[u],l),{});let{type:a}=r;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(r,i),a){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,s,i);break;default:t=this.mapObjectTypeChildren(r,t,s,i);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof xh)){const i=r;r=new xh(i.context,!0),delete n.helmetData}return r?on.createElement(Lv,{...n,context:r.value}):on.createElement($k.Consumer,null,i=>on.createElement(Lv,{...n,context:i}))}},gn(Ld,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Ld);const zF=()=>{const{t:e}=Y4(),t=sa(),n=r=>t.pathname===r;return O.jsx(Zw,{as:"nav",className:"links",index:n("/")?0:n("/about")?1:-1,children:O.jsxs(Jw,{children:[O.jsx(lh,{as:sv,to:"/",isSelected:n("/"),fontSize:"xl",fontWeight:"bold",p:4,children:"OpenPV"},"/"),O.jsx(lh,{as:sv,to:"/about",isSelected:n("/about"),children:e("about.title")},"/about")]})})},xm=e=>O.jsxs(Rk,{children:[O.jsxs(MF,{titleTemplate:"%s | OpenPV",defaultTitle:"OpenPV",defer:!1,children:[e.title&&O.jsx("title",{children:e.title}),O.jsx("meta",{name:"description",content:e.description}),O.jsx("meta",{name:"Beschreibung",content:e.description})]}),O.jsxs(IF,{children:[O.jsx(zF,{}),e.children]})]});xm.propTypes={children:_r.oneOfType([_r.arrayOf(_r.node),_r.node]),fullPage:_r.bool,title:_r.string,description:_r.string};xm.defaultProps={children:null,fullPage:!1,title:null,description:"Ermittle das Potential für eine Solaranlage."};const IF=({children:e})=>O.jsx(ah,{as:"div",display:"flex",margin:"0",maxWidth:"100%",opacity:1,padding:0,width:"100vw",height:"100vh",position:"fixed",left:0,top:0,flexDirection:"column",children:O.jsx(ah,{display:"flex",flexDirection:"column",justifyContent:"space-between",minWidth:0,minHeight:0,overflow:"hidden",flexGrow:1,width:"100%",height:"100%",children:e})});var DF={};const{PUBLIC_URL:jF}=DF,NF=x.lazy(()=>lo(()=>import("./Map-CC9rkVA0.js"),__vite__mapDeps([0,1,2,3,4]))),FF=x.lazy(()=>lo(()=>import("./Simulation-x5IYgVeF.js").then(e=>e.S),__vite__mapDeps([5,6,1,2,7]))),BF=x.lazy(()=>lo(()=>import("./NotFound-D-mYvcMO.js"),[])),VF=x.lazy(()=>lo(()=>import("./Impressum-DBV6waNB.js"),__vite__mapDeps([8,6]))),UF=x.lazy(()=>lo(()=>import("./Datenschutz-BRFAolcR.js"),__vite__mapDeps([9,6]))),Mv=x.lazy(()=>lo(()=>import("./About--s9Eeedt.js"),__vite__mapDeps([10,1,6,7,3])));window.isTouchDevice=WF();const zv=()=>O.jsx(Nj,{children:O.jsx(on.StrictMode,{children:O.jsx(a4,{basename:jF,children:O.jsx(x.Suspense,{fallback:O.jsx(xm,{}),children:O.jsxs(e4,{children:[O.jsx(Gn,{path:"/",element:O.jsx(NF,{})}),O.jsx(Gn,{path:"/simulation/:lon/:lat",element:O.jsx(FF,{})}),O.jsx(Gn,{path:"/anleitung",element:O.jsx(Mv,{})}),O.jsx(Gn,{path:"/about",element:O.jsx(Mv,{})}),O.jsx(Gn,{path:"/impressum",element:O.jsx(VF,{})}),O.jsx(Gn,{path:"/datenschutz",element:O.jsx(UF,{})}),O.jsx(Gn,{path:"*",element:O.jsx(BF,{})})]})})})})}),Od=document.getElementById("root");Od.hasChildNodes()?ek(Od,O.jsx(zv,{})):tk(Od).render(O.jsx(zv,{}));function WF(){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{DS as $,BI as A,ah as B,eL as C,IS as D,OT as E,XF as F,_T as G,ei as H,ea as I,NS as J,US as K,VS as L,xm as M,$l as N,rB as O,oc as P,QF as Q,on as R,Rk as S,MF as T,sv as U,tB as V,Ht as W,gT as X,qF as Y,GF as Z,lo as _,k3 as a,YF as a0,qM as a1,f1 as a2,Qe as a3,ZF as a4,wn as a5,nB as b,it as c,x as d,gm as e,Fn as f,Y4 as g,NN as h,KF as i,O as j,Ya as k,Nn as l,II as m,Dd as n,p1 as o,Ym as p,vT as q,sn as r,Id as s,rs as t,f3 as u,gu as v,kp as w,vu as x,Xt as y,d3 as z}; diff --git a/assets/index-DZP_WaxS.js b/assets/index-DZP_WaxS.js new file mode 100644 index 0000000..894d30e --- /dev/null +++ b/assets/index-DZP_WaxS.js @@ -0,0 +1,377 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Map-B8jw3anQ.js","assets/Footer-C3QM0Uoc.js","assets/location-BMuwxVaI.js","assets/image-x7XY6IFe.js","assets/Map-k4G4I0uA.css","assets/Simulation-Bjnv8os2.js","assets/heading-D46BZoGw.js","assets/stack-D-KFs-Nt.js","assets/Impressum-B9uORefi.js","assets/Datenschutz-BrIseX2Y.js","assets/About-BJ53y4VU.js"])))=>i.map(i=>d[i]); +var GC=Object.defineProperty;var qC=(e,t,n)=>t in e?GC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var vn=(e,t,n)=>qC(e,typeof t!="symbol"?t+"":t,n);function o1(e,t){for(var n=0;nr[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"]'))r(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"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(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 r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const XC="modulepreload",YC=function(e){return"/"+e},Xm={},ao=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=YC(l),l in Xm)return;Xm[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":XC,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};var Cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s1={exports:{}},vu={},a1={exports:{}},G={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var qs=Symbol.for("react.element"),QC=Symbol.for("react.portal"),ZC=Symbol.for("react.fragment"),JC=Symbol.for("react.strict_mode"),eT=Symbol.for("react.profiler"),tT=Symbol.for("react.provider"),nT=Symbol.for("react.context"),rT=Symbol.for("react.forward_ref"),iT=Symbol.for("react.suspense"),oT=Symbol.for("react.memo"),sT=Symbol.for("react.lazy"),Ym=Symbol.iterator;function aT(e){return e===null||typeof e!="object"?null:(e=Ym&&e[Ym]||e["@@iterator"],typeof e=="function"?e:null)}var l1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},u1=Object.assign,c1={};function lo(e,t,n){this.props=e,this.context=t,this.refs=c1,this.updater=n||l1}lo.prototype.isReactComponent={};lo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};lo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function d1(){}d1.prototype=lo.prototype;function Ph(e,t,n){this.props=e,this.context=t,this.refs=c1,this.updater=n||l1}var Eh=Ph.prototype=new d1;Eh.constructor=Ph;u1(Eh,lo.prototype);Eh.isPureReactComponent=!0;var Qm=Array.isArray,f1=Object.prototype.hasOwnProperty,_h={current:null},h1={key:!0,ref:!0,__self:!0,__source:!0};function p1(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)f1.call(t,r)&&!h1.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1e?"":void 0,JF=e=>e?!0:void 0;function wT(e){return Array.isArray(e)}function Gt(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!wT(e)}function kT(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function CT(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function Id(e){if(e==null)return e;const{unitless:t}=CT(e);return t||typeof e=="number"?`${e}px`:e}const y1=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,Rh=e=>Object.fromEntries(Object.entries(e).sort(y1));function Jm(e){const t=Rh(e);return Object.assign(Object.values(t),t)}function TT(e){const t=Object.keys(Rh(e));return new Set(t)}function eg(e){if(!e)return e;e=Id(e)??e;const t=-.02;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function zo(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${Id(e)})`),t&&n.push("and",`(max-width: ${Id(t)})`),n.join(" ")}function PT(e){if(!e)return null;e.base=e.base??"0px";const t=Jm(e),n=Object.entries(e).sort(y1).map(([o,s],a,l)=>{let[,u]=l[a+1]??[];return u=parseFloat(u)>0?eg(u):void 0,{_minW:eg(s),breakpoint:o,minW:s,maxW:u,maxWQuery:zo(null,u),minWQuery:zo(s),minMaxQuery:zo(s,u)}}),r=TT(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(o){const s=Object.keys(o);return s.length>0&&s.every(a=>r.has(a))},asObject:Rh(e),asArray:Jm(e),details:n,get(o){return n.find(s=>s.breakpoint===o)},media:[null,...t.map(o=>zo(o)).slice(1)],toArrayValue(o){if(!Gt(o))throw new Error("toArrayValue: value must be an object");const s=i.map(a=>o[a]??null);for(;kT(s)===null;)s.pop();return s},toObjectValue(o){if(!Array.isArray(o))throw new Error("toObjectValue: value must be an array");return o.reduce((s,a,l)=>{const u=i[l];return u!=null&&a!=null&&(s[u]=a),s},{})}}}function jd(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function v1(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function ET(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Qt(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o,defaultValue:s}=e,a=x.createContext(s);a.displayName=t;function l(){var c;const u=x.useContext(a);if(!u&&n){const d=new Error(o??ET(r,i));throw d.name="ContextError",(c=Error.captureStackTrace)==null||c.call(Error,d,l),d}return u}return[a.Provider,l,a]}const Nn=(...e)=>e.filter(Boolean).join(" ");function _T(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,s)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(i))return a.get(i);const l=e(r,i,o,s);return a.set(i,l),l}},b1=$T(_T),RT=e=>e.default||e;function S1(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function AT(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}const OT=e=>typeof e=="function";function ln(e,...t){return OT(e)?e(...t):e}function LT(e,...t){const n=Object.getOwnPropertyDescriptors(e),r=Object.keys(n),i=s=>{const a={};for(let l=0;li(Array.isArray(s)?s:r.filter(s));return t.map(o).concat(i(r))}function tg(e,t,n={}){const{stop:r,getKey:i}=n;function o(s,a=[]){if(Gt(s)||Array.isArray(s)){const l={};for(const[u,c]of Object.entries(s)){const d=(i==null?void 0:i(u))??u,f=[...a,d];if(r!=null&&r(s,f))return t(s,a);l[d]=o(c,f)}return l}return t(s,a)}return o(e)}var El={exports:{}};El.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",v="[object GeneratorFunction]",y="[object Map]",S="[object Number]",m="[object Null]",h="[object Object]",g="[object Proxy]",k="[object RegExp]",T="[object Set]",$="[object String]",_="[object Undefined]",R="[object WeakMap]",F="[object ArrayBuffer]",j="[object DataView]",H="[object Float32Array]",ue="[object Float64Array]",Ze="[object Int8Array]",Ae="[object Int16Array]",P="[object Int32Array]",M="[object Uint8Array]",L="[object Uint8ClampedArray]",A="[object Uint16Array]",I="[object Uint32Array]",z=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,xe=/^(?:0|[1-9]\d*)$/,K={};K[H]=K[ue]=K[Ze]=K[Ae]=K[P]=K[M]=K[L]=K[A]=K[I]=!0,K[a]=K[l]=K[F]=K[c]=K[j]=K[d]=K[f]=K[p]=K[y]=K[S]=K[h]=K[k]=K[T]=K[$]=K[R]=!1;var Je=typeof Cn=="object"&&Cn&&Cn.Object===Object&&Cn,mo=typeof self=="object"&&self&&self.Object===Object&&self,pt=Je||mo||Function("return this")(),xr=t&&!t.nodeType&&t,go=xr&&!0&&e&&!e.nodeType&&e,_m=go&&go.exports===xr,cc=_m&&Je.process,$m=function(){try{var b=go&&go.require&&go.require("util").types;return b||cc&&cc.binding&&cc.binding("util")}catch{}}(),Rm=$m&&$m.isTypedArray;function Mk(b,C,E){switch(E.length){case 0:return b.call(C);case 1:return b.call(C,E[0]);case 2:return b.call(C,E[0],E[1]);case 3:return b.call(C,E[0],E[1],E[2])}return b.apply(C,E)}function Dk(b,C){for(var E=-1,B=Array(b);++E-1}function rC(b,C){var E=this.__data__,B=pa(E,b);return B<0?(++this.size,E.push([b,C])):E[B][1]=C,this}yn.prototype.clear=Jk,yn.prototype.delete=eC,yn.prototype.get=tC,yn.prototype.has=nC,yn.prototype.set=rC;function ri(b){var C=-1,E=b==null?0:b.length;for(this.clear();++C1?E[X-1]:void 0,pe=X>2?E[2]:void 0;for(se=b.length>3&&typeof se=="function"?(X--,se):void 0,pe&&OC(E[0],E[1],pe)&&(se=X<3?void 0:se,X=1),C=Object(C);++B-1&&b%1==0&&b0){if(++C>=i)return arguments[0]}else C=0;return b.apply(void 0,arguments)}}function FC(b){if(b!=null){try{return da.call(b)}catch{}try{return b+""}catch{}}return""}function ya(b,C){return b===C||b!==b&&C!==C}var gc=Nm(function(){return arguments}())?Nm:function(b){return vo(b)&&Vn.call(b,"callee")&&!Uk.call(b,"callee")},yc=Array.isArray;function vc(b){return b!=null&&Wm(b.length)&&!bc(b)}function BC(b){return vo(b)&&vc(b)}var Um=Hk||KC;function bc(b){if(!Cr(b))return!1;var C=ma(b);return C==p||C==v||C==u||C==g}function Wm(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=s}function Cr(b){var C=typeof b;return b!=null&&(C=="object"||C=="function")}function vo(b){return b!=null&&typeof b=="object"}function VC(b){if(!vo(b)||ma(b)!=h)return!1;var C=Dm(b);if(C===null)return!0;var E=Vn.call(C,"constructor")&&C.constructor;return typeof E=="function"&&E instanceof E&&da.call(E)==Bk}var Hm=Rm?zk(Rm):vC;function UC(b){return EC(b,Km(b))}function Km(b){return vc(b)?pC(b):bC(b)}var WC=_C(function(b,C,E,B){Fm(b,C,E,B)});function HC(b){return function(){return b}}function Gm(b){return b}function KC(){return!1}e.exports=WC})(El,El.exports);var MT=El.exports;const un=Zr(MT);function Ja(e,t=[]){const n=x.useRef(e);return x.useEffect(()=>{n.current=e}),x.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function DT(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(f,p)=>f!==p}=e,o=Ja(r),s=Ja(i),[a,l]=x.useState(n),u=t!==void 0,c=u?t:a,d=Ja(f=>{const v=typeof f=="function"?f(c):f;s(c,v)&&(u||l(v),o(v))},[u,o,c,s]);return[c,d]}const Nd=globalThis!=null&&globalThis.document?x.useLayoutEffect:x.useEffect,ng=(e,t)=>{const n=x.useRef(!1),r=x.useRef(!1);x.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),x.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function zT(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 bu(...e){return t=>{e.forEach(n=>{zT(n,t)})}}function eB(...e){return x.useMemo(()=>bu(...e),e)}function IT(e,t){const n=Ja(e);x.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}const Oe={open:(e,t)=>`${e}[data-open], ${e}[open], ${e}[data-state=open] ${t}`,closed:(e,t)=>`${e}[data-closed], ${e}[data-state=closed] ${t}`,hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},Zt=e=>x1(t=>e(t,"&"),"[role=group]","[data-group]",".group"),bn=e=>x1(t=>e(t,"~ &"),"[data-peer]",".peer"),x1=(e,...t)=>t.map(e).join(", "),jT={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within, &[data-focus-within]",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty, &[data-empty]",_expanded:"&[aria-expanded=true], &[data-expanded], &[data-state=expanded]",_checked:"&[aria-checked=true], &[data-checked], &[data-state=checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate], &[data-state=indeterminate]",_groupOpen:Zt(Oe.open),_groupClosed:Zt(Oe.closed),_groupHover:Zt(Oe.hover),_peerHover:bn(Oe.hover),_groupFocus:Zt(Oe.focus),_peerFocus:bn(Oe.focus),_groupFocusVisible:Zt(Oe.focusVisible),_peerFocusVisible:bn(Oe.focusVisible),_groupActive:Zt(Oe.active),_peerActive:bn(Oe.active),_groupDisabled:Zt(Oe.disabled),_peerDisabled:bn(Oe.disabled),_groupInvalid:Zt(Oe.invalid),_peerInvalid:bn(Oe.invalid),_groupChecked:Zt(Oe.checked),_peerChecked:bn(Oe.checked),_groupFocusWithin:Zt(Oe.focusWithin),_peerFocusWithin:bn(Oe.focusWithin),_peerPlaceholderShown:bn(Oe.placeholderShown),_placeholder:"&::placeholder, &[data-placeholder]",_placeholderShown:"&:placeholder-shown, &[data-placeholder-shown]",_fullScreen:"&:fullscreen, &[data-fullscreen]",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]",_open:"&[data-open], &[open], &[data-state=open]",_closed:"&[data-closed], &[data-state=closed]",_complete:"&[data-complete]",_incomplete:"&[data-incomplete]",_current:"&[data-current]"};function Su(e){const t=e.conditions??{},n=Object.fromEntries(Object.entries(t).map(([r,i])=>[`_${r}`,i]));return{...jT,...n}}function w1(e){return Object.keys(Su(e))}const NT=e=>/!(important)?$/.test(e),rg=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,FT=(e,t)=>n=>{const r=String(t),i=NT(r),o=rg(r),s=e?`${e}.${o}`:o;let a=Gt(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return a=rg(a),i?`${a} !important`:a};function Ah(e){const{scale:t,transform:n,compose:r}=e;return(o,s)=>{const a=FT(t,o)(s);let l=(n==null?void 0:n(a,s))??a;return r&&(l=r(l,s)),l}}const ba=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Et(e,t){return n=>{const r={property:n,scale:e};return r.transform=Ah({scale:e,transform:t}),r}}const BT=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function VT(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:BT(t),transform:n?Ah({scale:n,compose:r}):r}}const k1=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function UT(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...k1].join(" ")}function WT(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...k1].join(" ")}const HT={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},KT={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function GT(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}const qT={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},Fd={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},XT=new Set(Object.values(Fd)),Bd=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),YT=e=>e.trim();function QT(e,t){if(e==null||Bd.has(e))return e;if(!(Vd(e)||Bd.has(e)))return`url('${e}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),o=i==null?void 0:i[1],s=i==null?void 0:i[2];if(!o||!s)return e;const a=o.includes("-gradient")?o:`${o}-gradient`,[l,...u]=s.split(",").map(YT).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in Fd?Fd[l]:l;u.unshift(c);const d=u.map(f=>{if(XT.has(f))return f;const p=f.indexOf(" "),[v,y]=p!==-1?[f.substr(0,p),f.substr(p+1)]:[f],S=Vd(y)?y:y&&y.split(" "),m=`colors.${v}`,h=m in t.__cssMap?t.__cssMap[m].varRef:v;return S?[h,...Array.isArray(S)?S:[S]].join(" "):h});return`${a}(${d.join(", ")})`}const Vd=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),ZT=(e,t)=>QT(e,t??{});function JT(e){return/^var\(--.+\)$/.test(e)}const eP=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Jt=e=>t=>`${e}(${t})`,q={filter(e){return e!=="auto"?e:HT},backdropFilter(e){return e!=="auto"?e:KT},ring(e){return GT(q.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?UT():e==="auto-gpu"?WT():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=eP(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(JT(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:ZT,blur:Jt("blur"),opacity:Jt("opacity"),brightness:Jt("brightness"),contrast:Jt("contrast"),dropShadow:Jt("drop-shadow"),grayscale:Jt("grayscale"),hueRotate:e=>Jt("hue-rotate")(q.degree(e)),invert:Jt("invert"),saturate:Jt("saturate"),sepia:Jt("sepia"),bgImage(e){return e==null||Vd(e)||Bd.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=qT[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},w={borderWidths:Et("borderWidths"),borderStyles:Et("borderStyles"),colors:Et("colors"),borders:Et("borders"),gradients:Et("gradients",q.gradient),radii:Et("radii",q.px),space:Et("space",ba(q.vh,q.px)),spaceT:Et("space",ba(q.vh,q.px)),degreeT(e){return{property:e,transform:q.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:Ah({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Et("sizes",ba(q.vh,q.px)),sizesT:Et("sizes",ba(q.vh,q.fraction)),shadows:Et("shadows"),logical:VT,blur:Et("blur",q.blur)},el={background:w.colors("background"),backgroundColor:w.colors("backgroundColor"),backgroundImage:w.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:q.bgClip},bgSize:w.prop("backgroundSize"),bgPosition:w.prop("backgroundPosition"),bg:w.colors("background"),bgColor:w.colors("backgroundColor"),bgPos:w.prop("backgroundPosition"),bgRepeat:w.prop("backgroundRepeat"),bgAttachment:w.prop("backgroundAttachment"),bgGradient:w.gradients("backgroundImage"),bgClip:{transform:q.bgClip}};Object.assign(el,{bgImage:el.backgroundImage,bgImg:el.backgroundImage});const J={border:w.borders("border"),borderWidth:w.borderWidths("borderWidth"),borderStyle:w.borderStyles("borderStyle"),borderColor:w.colors("borderColor"),borderRadius:w.radii("borderRadius"),borderTop:w.borders("borderTop"),borderBlockStart:w.borders("borderBlockStart"),borderTopLeftRadius:w.radii("borderTopLeftRadius"),borderStartStartRadius:w.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:w.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:w.radii("borderTopRightRadius"),borderStartEndRadius:w.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:w.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:w.borders("borderRight"),borderInlineEnd:w.borders("borderInlineEnd"),borderBottom:w.borders("borderBottom"),borderBlockEnd:w.borders("borderBlockEnd"),borderBottomLeftRadius:w.radii("borderBottomLeftRadius"),borderBottomRightRadius:w.radii("borderBottomRightRadius"),borderLeft:w.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:w.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:w.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:w.borders(["borderLeft","borderRight"]),borderInline:w.borders("borderInline"),borderY:w.borders(["borderTop","borderBottom"]),borderBlock:w.borders("borderBlock"),borderTopWidth:w.borderWidths("borderTopWidth"),borderBlockStartWidth:w.borderWidths("borderBlockStartWidth"),borderTopColor:w.colors("borderTopColor"),borderBlockStartColor:w.colors("borderBlockStartColor"),borderTopStyle:w.borderStyles("borderTopStyle"),borderBlockStartStyle:w.borderStyles("borderBlockStartStyle"),borderBottomWidth:w.borderWidths("borderBottomWidth"),borderBlockEndWidth:w.borderWidths("borderBlockEndWidth"),borderBottomColor:w.colors("borderBottomColor"),borderBlockEndColor:w.colors("borderBlockEndColor"),borderBottomStyle:w.borderStyles("borderBottomStyle"),borderBlockEndStyle:w.borderStyles("borderBlockEndStyle"),borderLeftWidth:w.borderWidths("borderLeftWidth"),borderInlineStartWidth:w.borderWidths("borderInlineStartWidth"),borderLeftColor:w.colors("borderLeftColor"),borderInlineStartColor:w.colors("borderInlineStartColor"),borderLeftStyle:w.borderStyles("borderLeftStyle"),borderInlineStartStyle:w.borderStyles("borderInlineStartStyle"),borderRightWidth:w.borderWidths("borderRightWidth"),borderInlineEndWidth:w.borderWidths("borderInlineEndWidth"),borderRightColor:w.colors("borderRightColor"),borderInlineEndColor:w.colors("borderInlineEndColor"),borderRightStyle:w.borderStyles("borderRightStyle"),borderInlineEndStyle:w.borderStyles("borderInlineEndStyle"),borderTopRadius:w.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:w.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:w.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:w.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(J,{rounded:J.borderRadius,roundedTop:J.borderTopRadius,roundedTopLeft:J.borderTopLeftRadius,roundedTopRight:J.borderTopRightRadius,roundedTopStart:J.borderStartStartRadius,roundedTopEnd:J.borderStartEndRadius,roundedBottom:J.borderBottomRadius,roundedBottomLeft:J.borderBottomLeftRadius,roundedBottomRight:J.borderBottomRightRadius,roundedBottomStart:J.borderEndStartRadius,roundedBottomEnd:J.borderEndEndRadius,roundedLeft:J.borderLeftRadius,roundedRight:J.borderRightRadius,roundedStart:J.borderInlineStartRadius,roundedEnd:J.borderInlineEndRadius,borderStart:J.borderInlineStart,borderEnd:J.borderInlineEnd,borderTopStartRadius:J.borderStartStartRadius,borderTopEndRadius:J.borderStartEndRadius,borderBottomStartRadius:J.borderEndStartRadius,borderBottomEndRadius:J.borderEndEndRadius,borderStartRadius:J.borderInlineStartRadius,borderEndRadius:J.borderInlineEndRadius,borderStartWidth:J.borderInlineStartWidth,borderEndWidth:J.borderInlineEndWidth,borderStartColor:J.borderInlineStartColor,borderEndColor:J.borderInlineEndColor,borderStartStyle:J.borderInlineStartStyle,borderEndStyle:J.borderInlineEndStyle});const tP={color:w.colors("color"),textColor:w.colors("color"),fill:w.colors("fill"),stroke:w.colors("stroke"),accentColor:w.colors("accentColor"),textFillColor:w.colors("textFillColor")},_l={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:q.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:w.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:w.space("gap"),rowGap:w.space("rowGap"),columnGap:w.space("columnGap")};Object.assign(_l,{flexDir:_l.flexDirection});const $t={width:w.sizesT("width"),inlineSize:w.sizesT("inlineSize"),height:w.sizes("height"),blockSize:w.sizes("blockSize"),boxSize:w.sizes(["width","height"]),minWidth:w.sizes("minWidth"),minInlineSize:w.sizes("minInlineSize"),minHeight:w.sizes("minHeight"),minBlockSize:w.sizes("minBlockSize"),maxWidth:w.sizes("maxWidth"),maxInlineSize:w.sizes("maxInlineSize"),maxHeight:w.sizes("maxHeight"),maxBlockSize:w.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var i,o;return{[`@media screen and (min-width: ${((o=(i=t.__breakpoints)==null?void 0:i.get(e))==null?void 0:o.minW)??e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var i,o;return{[`@media screen and (max-width: ${((o=(i=t.__breakpoints)==null?void 0:i.get(e))==null?void 0:o._minW)??e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:w.propT("float",q.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign($t,{w:$t.width,h:$t.height,minW:$t.minWidth,maxW:$t.maxWidth,minH:$t.minHeight,maxH:$t.maxHeight,overscroll:$t.overscrollBehavior,overscrollX:$t.overscrollBehaviorX,overscrollY:$t.overscrollBehaviorY});const nP={filter:{transform:q.filter},blur:w.blur("--chakra-blur"),brightness:w.propT("--chakra-brightness",q.brightness),contrast:w.propT("--chakra-contrast",q.contrast),hueRotate:w.propT("--chakra-hue-rotate",q.hueRotate),invert:w.propT("--chakra-invert",q.invert),saturate:w.propT("--chakra-saturate",q.saturate),dropShadow:w.propT("--chakra-drop-shadow",q.dropShadow),backdropFilter:{transform:q.backdropFilter},backdropBlur:w.blur("--chakra-backdrop-blur"),backdropBrightness:w.propT("--chakra-backdrop-brightness",q.brightness),backdropContrast:w.propT("--chakra-backdrop-contrast",q.contrast),backdropHueRotate:w.propT("--chakra-backdrop-hue-rotate",q.hueRotate),backdropInvert:w.propT("--chakra-backdrop-invert",q.invert),backdropSaturate:w.propT("--chakra-backdrop-saturate",q.saturate)},rP={ring:{transform:q.ring},ringColor:w.colors("--chakra-ring-color"),ringOffset:w.prop("--chakra-ring-offset-width"),ringOffsetColor:w.colors("--chakra-ring-offset-color"),ringInset:w.prop("--chakra-ring-inset")},iP={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:q.outline},outlineOffset:!0,outlineColor:w.colors("outlineColor")},C1={gridGap:w.space("gridGap"),gridColumnGap:w.space("gridColumnGap"),gridRowGap:w.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0};function oP(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,s)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(i))return a.get(i);const l=e(r,i,o,s);return a.set(i,l),l}},aP=sP(oP),lP={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},uP={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},kc=(e,t,n)=>{const r={},i=aP(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},cP={srOnly:{transform(e){return e===!0?lP:e==="focusable"?uP:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>kc(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>kc(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>kc(t,e,n)}},qo={position:!0,pos:w.prop("position"),zIndex:w.prop("zIndex","zIndices"),inset:w.spaceT("inset"),insetX:w.spaceT(["left","right"]),insetInline:w.spaceT("insetInline"),insetY:w.spaceT(["top","bottom"]),insetBlock:w.spaceT("insetBlock"),top:w.spaceT("top"),insetBlockStart:w.spaceT("insetBlockStart"),bottom:w.spaceT("bottom"),insetBlockEnd:w.spaceT("insetBlockEnd"),left:w.spaceT("left"),insetInlineStart:w.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:w.spaceT("right"),insetInlineEnd:w.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(qo,{insetStart:qo.insetInlineStart,insetEnd:qo.insetInlineEnd});const Ud={boxShadow:w.shadows("boxShadow"),mixBlendMode:!0,blendMode:w.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:w.prop("backgroundBlendMode"),opacity:!0};Object.assign(Ud,{shadow:Ud.boxShadow});const de={margin:w.spaceT("margin"),marginTop:w.spaceT("marginTop"),marginBlockStart:w.spaceT("marginBlockStart"),marginRight:w.spaceT("marginRight"),marginInlineEnd:w.spaceT("marginInlineEnd"),marginBottom:w.spaceT("marginBottom"),marginBlockEnd:w.spaceT("marginBlockEnd"),marginLeft:w.spaceT("marginLeft"),marginInlineStart:w.spaceT("marginInlineStart"),marginX:w.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:w.spaceT("marginInline"),marginY:w.spaceT(["marginTop","marginBottom"]),marginBlock:w.spaceT("marginBlock"),padding:w.space("padding"),paddingTop:w.space("paddingTop"),paddingBlockStart:w.space("paddingBlockStart"),paddingRight:w.space("paddingRight"),paddingBottom:w.space("paddingBottom"),paddingBlockEnd:w.space("paddingBlockEnd"),paddingLeft:w.space("paddingLeft"),paddingInlineStart:w.space("paddingInlineStart"),paddingInlineEnd:w.space("paddingInlineEnd"),paddingX:w.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:w.space("paddingInline"),paddingY:w.space(["paddingTop","paddingBottom"]),paddingBlock:w.space("paddingBlock")};Object.assign(de,{m:de.margin,mt:de.marginTop,mr:de.marginRight,me:de.marginInlineEnd,marginEnd:de.marginInlineEnd,mb:de.marginBottom,ml:de.marginLeft,ms:de.marginInlineStart,marginStart:de.marginInlineStart,mx:de.marginX,my:de.marginY,p:de.padding,pt:de.paddingTop,py:de.paddingY,px:de.paddingX,pb:de.paddingBottom,pl:de.paddingLeft,ps:de.paddingInlineStart,paddingStart:de.paddingInlineStart,pr:de.paddingRight,pe:de.paddingInlineEnd,paddingEnd:de.paddingInlineEnd});const dP={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:w.spaceT("scrollMargin"),scrollMarginTop:w.spaceT("scrollMarginTop"),scrollMarginBottom:w.spaceT("scrollMarginBottom"),scrollMarginLeft:w.spaceT("scrollMarginLeft"),scrollMarginRight:w.spaceT("scrollMarginRight"),scrollMarginX:w.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:w.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:w.spaceT("scrollPadding"),scrollPaddingTop:w.spaceT("scrollPaddingTop"),scrollPaddingBottom:w.spaceT("scrollPaddingBottom"),scrollPaddingLeft:w.spaceT("scrollPaddingLeft"),scrollPaddingRight:w.spaceT("scrollPaddingRight"),scrollPaddingX:w.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:w.spaceT(["scrollPaddingTop","scrollPaddingBottom"])},fP={fontFamily:w.prop("fontFamily","fonts"),fontSize:w.prop("fontSize","fontSizes",q.px),fontWeight:w.prop("fontWeight","fontWeights"),lineHeight:w.prop("lineHeight","lineHeights"),letterSpacing:w.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},hP={textDecorationColor:w.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:w.shadows("textShadow")},pP={clipPath:!0,transform:w.propT("transform",q.transform),transformOrigin:!0,translateX:w.spaceT("--chakra-translate-x"),translateY:w.spaceT("--chakra-translate-y"),skewX:w.degreeT("--chakra-skew-x"),skewY:w.degreeT("--chakra-skew-y"),scaleX:w.prop("--chakra-scale-x"),scaleY:w.prop("--chakra-scale-y"),scale:w.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:w.degreeT("--chakra-rotate")},mP={listStyleType:!0,listStylePosition:!0,listStylePos:w.prop("listStylePosition"),listStyleImage:!0,listStyleImg:w.prop("listStyleImage")},gP={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:w.prop("transitionDuration","transition.duration"),transitionProperty:w.prop("transitionProperty","transition.property"),transitionTimingFunction:w.prop("transitionTimingFunction","transition.easing")},Oh=un({},el,J,tP,_l,$t,nP,rP,iP,C1,cP,qo,Ud,de,dP,fP,hP,pP,mP,gP);Object.assign({},de,$t,_l,C1,qo);const yP=e=>[...Object.keys(Oh),...w1(e)],vP=e=>{const t=Su(e);return n=>{const r={...Oh,...t};return Object.hasOwnProperty.call(r,n)}},bP=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const s in e){let a=ln(e[s],t);if(a==null)continue;if(a=Gt(a)&&n(a)?r(a):a,!Array.isArray(a)){o[s]=a;continue}const l=a.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!xP(t),kP=(e,t)=>{if(t==null)return t;const n=s=>{var a,l;return(l=(a=e.__cssMap)==null?void 0:a[s])==null?void 0:l.varRef},r=s=>n(s)??s,[i,o]=SP(t);return t=n(i)??r(o)??r(t),t};function CP(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,s=!1)=>{var c;const a=ln(o,r),l=bP(a)(r);let u={};for(let d in l){const f=l[d];let p=ln(f,r);d in n&&(d=n[d]),wP(d,p)&&(p=kP(r,p));let v=t[d];if(v===!0&&(v={property:d}),Gt(p)){u[d]=u[d]??{},u[d]=un({},u[d],i(p,!0));continue}let y=((c=v==null?void 0:v.transform)==null?void 0:c.call(v,p,r,a))??p;y=v!=null&&v.processResult?i(y,!0):y;const S=ln(v==null?void 0:v.property,r);if(!s&&(v!=null&&v.static)){const m=ln(v.static,r);u=un({},u,m)}if(S&&Array.isArray(S)){for(const m of S)u[m]=y;continue}if(S){S==="&"&&Gt(y)?u=un({},u,y):u[S]=y;continue}if(Gt(y)){u=un({},u,y);continue}u[d]=y}return u};return i}const T1=e=>t=>CP({theme:t,pseudos:Su(t),configs:Oh})(e);function tB(e){return e}function le(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function TP(e,t){if(Array.isArray(e))return e;if(Gt(e))return t(e);if(e!=null)return[e]}function PP(e,t){for(let n=t+1;n{un(a,{[g]:c?h[g]:{[m]:h[g]}})});continue}if(!d){c?un(a,h):a[m]=h;continue}a[m]=h}}return a}}function _P(e){return t=>{const{variant:n,size:r,theme:i}=t,o=EP(i);return un({},ln(e.baseStyle??{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function xu(e){return S1(e,["styleConfig","size","variant","colorScheme"])}function P1(e){return Gt(e)&&e.reference?e.reference:String(e)}const wu=(e,...t)=>t.map(P1).join(` ${e} `).replace(/calc/g,""),ig=(...e)=>`calc(${wu("+",...e)})`,og=(...e)=>`calc(${wu("-",...e)})`,Wd=(...e)=>`calc(${wu("*",...e)})`,sg=(...e)=>`calc(${wu("/",...e)})`,ag=e=>{const t=P1(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:Wd(t,-1)},Ar=Object.assign(e=>({add:(...t)=>Ar(ig(e,...t)),subtract:(...t)=>Ar(og(e,...t)),multiply:(...t)=>Ar(Wd(e,...t)),divide:(...t)=>Ar(sg(e,...t)),negate:()=>Ar(ag(e)),toString:()=>e.toString()}),{add:ig,subtract:og,multiply:Wd,divide:sg,negate:ag});function $P(e,t="-"){return e.replace(/\s+/g,t)}function RP(e){const t=$P(e.toString());return OP(AP(t))}function AP(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function OP(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function LP(e,t=""){return[t,e].filter(Boolean).join("-")}function MP(e,t){return`var(${e}${t?`, ${t}`:""})`}function DP(e,t=""){return RP(`--${LP(e,t)}`)}function U(e,t,n){const r=DP(e,n);return{variable:r,reference:MP(r,t)}}function zP(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[i,o]=r;n[i]=U(`${e}-${i}`,o);continue}n[r]=U(`${e}-${r}`)}return n}const IP=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function jP(e){return AT(e,IP)}function NP(e){return e.semanticTokens}function FP(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function BP(e){const t=jP(e),n=NP(e),r=w1(e),i=s=>r.includes(s)||s==="default",o={};return tg(t,(s,a)=>{s!=null&&(o[a.join(".")]={isSemantic:!1,value:s})}),tg(n,(s,a)=>{s!=null&&(o[a.join(".")]={isSemantic:!0,value:s})},{stop:s=>Object.keys(s).every(i)}),o}function lg(e,t){return U(String(e).replace(/\./g,"-"),void 0,t)}function VP(e){var a;const t=BP(e),n=(a=e.config)==null?void 0:a.cssVarPrefix,r=Su(e);let i={};const o={};function s(l,u){const d=[String(l).split(".")[0],u].join(".");if(!t[d])return u;const{reference:p}=lg(d,n);return p}for(const[l,u]of Object.entries(t)){const{isSemantic:c,value:d}=u,{variable:f,reference:p}=lg(l,n);if(!c){if(l.startsWith("space")){const y=l.split("."),[S,...m]=y,h=`${S}.-${m.join(".")}`,g=Ar.negate(d),k=Ar.negate(p);o[h]={value:g,var:f,varRef:k}}i[f]=d,o[l]={value:d,var:f,varRef:p};continue}const v=Gt(d)?d:{default:d};i=un(i,Object.entries(v).reduce((y,[S,m])=>{if(!m)return y;const h=s(l,`${m}`);if(S==="default")return y[f]=h,y;const g=(r==null?void 0:r[S])??S;return y[g]={[f]:h},y},{})),o[l]={value:p,var:f,varRef:p}}return{cssVars:i,cssMap:o}}function UP(e){const t=FP(e),{cssMap:n,cssVars:r}=VP(t);return Object.assign(t,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...r},__cssMap:n,__breakpoints:PT(t.breakpoints)}),t}function re(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function i(...c){r();for(const d of c)t[d]=l(d);return re(e,t)}function o(...c){for(const d of c)d in t||(t[d]=l(d));return re(e,t)}function s(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.selector]))}function a(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.className]))}function l(c){const p=`chakra-${(["container","root"].includes(c??"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:p,selector:`.${p}`,toString:()=>c}}return{parts:i,toPart:l,extend:o,selectors:s,classnames:a,get keys(){return Object.keys(t)},__type:{}}}const WP=re("accordion").parts("root","container","button","panel","icon"),HP=re("alert").parts("title","description","container","icon","spinner"),KP=re("avatar").parts("label","badge","container","excessLabel","group"),GP=re("breadcrumb").parts("link","item","container","separator");re("button").parts();const qP=re("checkbox").parts("control","icon","container","label");re("progress").parts("track","filledTrack","label");const XP=re("drawer").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),YP=re("editable").parts("preview","input","textarea"),QP=re("form").parts("container","requiredIndicator","helperText"),ZP=re("formError").parts("text","icon"),JP=re("input").parts("addon","field","element","group"),eE=re("list").parts("container","item","icon"),tE=re("menu").parts("button","list","item","groupTitle","icon","command","divider"),nE=re("modal").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),rE=re("numberinput").parts("root","field","stepperGroup","stepper");re("pininput").parts("field");const iE=re("popover").parts("content","header","body","footer","popper","arrow","closeButton"),oE=re("progress").parts("label","filledTrack","track"),sE=re("radio").parts("container","control","label"),aE=re("select").parts("field","icon"),lE=re("slider").parts("container","track","thumb","filledTrack","mark"),uE=re("stat").parts("container","label","helpText","number","icon"),cE=re("switch").parts("container","track","thumb","label"),dE=re("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),fE=re("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),hE=re("tag").parts("container","label","closeButton"),pE=re("card").parts("container","header","body","footer");re("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");const{definePartsStyle:mE,defineMultiStyleConfig:gE}=le(WP.keys),yE={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},vE={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},bE={pt:"2",px:"4",pb:"5"},SE={fontSize:"1.25em"},xE=mE({container:yE,button:vE,panel:bE,icon:SE}),wE=gE({baseStyle:xE});function Lr(e,t,n){return Math.min(Math.max(e,n),t)}class kE extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Io=kE;function Lh(e){if(typeof e!="string")throw new Io(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=AE.test(e)?PE(e):e;const n=EE.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(ms(a,2),16)),parseInt(ms(s[3]||"f",2),16)/255]}const r=_E.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const i=$E.exec(t);if(i){const s=Array.from(i).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const o=RE.exec(t);if(o){const[s,a,l,u]=Array.from(o).slice(1).map(parseFloat);if(Lr(0,100,a)!==a)throw new Io(e);if(Lr(0,100,l)!==l)throw new Io(e);return[...OE(s,a,l),Number.isNaN(u)?1:u]}throw new Io(e)}function CE(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const ug=e=>parseInt(e.replace(/_/g,""),36),TE="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=ug(t.substring(0,3)),r=ug(t.substring(3)).toString(16);let i="";for(let o=0;o<6-r.length;o++)i+="0";return e[n]=`${i}${r}`,e},{});function PE(e){const t=e.toLowerCase().trim(),n=TE[CE(t)];if(!n)throw new Io(e);return`#${n}`}const ms=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),EE=new RegExp(`^#${ms("([a-f0-9])",3)}([a-f0-9])?$`,"i"),_E=new RegExp(`^#${ms("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),$E=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${ms(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),RE=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,AE=/^[a-z]+$/i,cg=e=>Math.round(e*255),OE=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(cg);const i=(e%360+360)%360/60,o=(1-Math.abs(2*r-1))*(t/100),s=o*(1-Math.abs(i%2-1));let a=0,l=0,u=0;i>=0&&i<1?(a=o,l=s):i>=1&&i<2?(a=s,l=o):i>=2&&i<3?(l=o,u=s):i>=3&&i<4?(l=s,u=o):i>=4&&i<5?(a=s,u=o):i>=5&&i<6&&(a=o,u=s);const c=r-o/2,d=a+c,f=l+c,p=u+c;return[d,f,p].map(cg)};function LE(e,t,n,r){return`rgba(${Lr(0,255,e).toFixed()}, ${Lr(0,255,t).toFixed()}, ${Lr(0,255,n).toFixed()}, ${parseFloat(Lr(0,1,r).toFixed(3))})`}function ME(e,t){const[n,r,i,o]=Lh(e);return LE(n,r,i,o-t)}function DE(e){const[t,n,r,i]=Lh(e);let o=s=>{const a=Lr(0,255,s).toString(16);return a.length===1?`0${a}`:a};return`#${o(t)}${o(n)}${o(r)}${i<1?o(Math.round(i*255)):""}`}const zE=e=>Object.keys(e).length===0;function IE(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r{const r=IE(e,`colors.${t}`,t);try{return DE(r),r}catch{return"#000000"}},jE=e=>{const[t,n,r]=Lh(e);return(t*299+n*587+r*114)/1e3},NE=e=>t=>{const n=tt(t,e);return jE(n)<128?"dark":"light"},FE=e=>t=>NE(e)(t)==="dark",Ki=(e,t)=>n=>{const r=tt(n,e);return ME(r,1-t)};function dg(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + 45deg, + ${t} 25%, + transparent 25%, + transparent 50%, + ${t} 50%, + ${t} 75%, + transparent 75%, + transparent + )`,backgroundSize:`${e} ${e}`}}const BE=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function VE(e){const t=BE();return!e||zE(e)?t:e.string&&e.colors?WE(e.string,e.colors):e.string&&!e.colors?UE(e.string):e.colors&&!e.string?HE(e.colors):t}function UE(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function WE(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function Mh(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function E1(e){return Gt(e)&&e.reference?e.reference:String(e)}const ku=(e,...t)=>t.map(E1).join(` ${e} `).replace(/calc/g,""),fg=(...e)=>`calc(${ku("+",...e)})`,hg=(...e)=>`calc(${ku("-",...e)})`,Hd=(...e)=>`calc(${ku("*",...e)})`,pg=(...e)=>`calc(${ku("/",...e)})`,mg=e=>{const t=E1(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:Hd(t,-1)},wn=Object.assign(e=>({add:(...t)=>wn(fg(e,...t)),subtract:(...t)=>wn(hg(e,...t)),multiply:(...t)=>wn(Hd(e,...t)),divide:(...t)=>wn(pg(e,...t)),negate:()=>wn(mg(e)),toString:()=>e.toString()}),{add:fg,subtract:hg,multiply:Hd,divide:pg,negate:mg});function KE(e){return!Number.isInteger(parseFloat(e.toString()))}function GE(e,t="-"){return e.replace(/\s+/g,t)}function _1(e){const t=GE(e.toString());return t.includes("\\.")?e:KE(e)?t.replace(".","\\."):e}function qE(e,t=""){return[t,_1(e)].filter(Boolean).join("-")}function XE(e,t){return`var(${_1(e)}${t?`, ${t}`:""})`}function YE(e,t=""){return`--${qE(e,t)}`}function De(e,t){const n=YE(e,t==null?void 0:t.prefix);return{variable:n,reference:XE(n,QE(t==null?void 0:t.fallback))}}function QE(e){return e==null?void 0:e.reference}const{definePartsStyle:Xs,defineMultiStyleConfig:ZE}=le(HP.keys),vt=U("alert-fg"),Ln=U("alert-bg"),JE=Xs({container:{bg:Ln.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:vt.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:vt.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function Dh(e){const{theme:t,colorScheme:n}=e,r=Ki(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}const e2=Xs(e=>{const{colorScheme:t}=e,n=Dh(e);return{container:{[vt.variable]:`colors.${t}.600`,[Ln.variable]:n.light,_dark:{[vt.variable]:`colors.${t}.200`,[Ln.variable]:n.dark}}}}),t2=Xs(e=>{const{colorScheme:t}=e,n=Dh(e);return{container:{[vt.variable]:`colors.${t}.600`,[Ln.variable]:n.light,_dark:{[vt.variable]:`colors.${t}.200`,[Ln.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:vt.reference}}}),n2=Xs(e=>{const{colorScheme:t}=e,n=Dh(e);return{container:{[vt.variable]:`colors.${t}.600`,[Ln.variable]:n.light,_dark:{[vt.variable]:`colors.${t}.200`,[Ln.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:vt.reference}}}),r2=Xs(e=>{const{colorScheme:t}=e;return{container:{[vt.variable]:"colors.white",[Ln.variable]:`colors.${t}.600`,_dark:{[vt.variable]:"colors.gray.900",[Ln.variable]:`colors.${t}.200`},color:vt.reference}}}),i2={subtle:e2,"left-accent":t2,"top-accent":n2,solid:r2},o2=ZE({baseStyle:JE,variants:i2,defaultProps:{variant:"subtle",colorScheme:"blue"}}),$1={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},s2={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},a2={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},R1={...$1,...s2,container:a2},l2=e=>typeof e=="function";function nt(e,...t){return l2(e)?e(...t):e}const{definePartsStyle:A1,defineMultiStyleConfig:u2}=le(KP.keys),Li=U("avatar-border-color"),Xo=U("avatar-bg"),gs=U("avatar-font-size"),Gi=U("avatar-size"),c2={borderRadius:"full",border:"0.2em solid",borderColor:Li.reference,[Li.variable]:"white",_dark:{[Li.variable]:"colors.gray.800"}},d2={bg:Xo.reference,fontSize:gs.reference,width:Gi.reference,height:Gi.reference,lineHeight:"1",[Xo.variable]:"colors.gray.200",_dark:{[Xo.variable]:"colors.whiteAlpha.400"}},f2=e=>{const{name:t,theme:n}=e,r=t?VE({string:t}):"colors.gray.400",i=FE(r)(n);let o="white";return i||(o="gray.800"),{bg:Xo.reference,fontSize:gs.reference,color:o,borderColor:Li.reference,verticalAlign:"top",width:Gi.reference,height:Gi.reference,"&:not([data-loaded])":{[Xo.variable]:r},[Li.variable]:"colors.white",_dark:{[Li.variable]:"colors.gray.800"}}},h2={fontSize:gs.reference,lineHeight:"1"},p2=A1(e=>({badge:nt(c2,e),excessLabel:nt(d2,e),container:nt(f2,e),label:h2}));function Un(e){const t=e!=="100%"?R1[e]:void 0;return A1({container:{[Gi.variable]:t??e,[gs.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[Gi.variable]:t??e,[gs.variable]:`calc(${t??e} / 2.5)`}})}const m2={"2xs":Un(4),xs:Un(6),sm:Un(8),md:Un(12),lg:Un(16),xl:Un(24),"2xl":Un(32),full:Un("100%")},g2=u2({baseStyle:p2,sizes:m2,defaultProps:{size:"md"}}),Ee=zP("badge",["bg","color","shadow"]),y2={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:Ee.bg.reference,color:Ee.color.reference,boxShadow:Ee.shadow.reference},v2=e=>{const{colorScheme:t,theme:n}=e,r=Ki(`${t}.500`,.6)(n);return{[Ee.bg.variable]:`colors.${t}.500`,[Ee.color.variable]:"colors.white",_dark:{[Ee.bg.variable]:r,[Ee.color.variable]:"colors.whiteAlpha.800"}}},b2=e=>{const{colorScheme:t,theme:n}=e,r=Ki(`${t}.200`,.16)(n);return{[Ee.bg.variable]:`colors.${t}.100`,[Ee.color.variable]:`colors.${t}.800`,_dark:{[Ee.bg.variable]:r,[Ee.color.variable]:`colors.${t}.200`}}},S2=e=>{const{colorScheme:t,theme:n}=e,r=Ki(`${t}.200`,.8)(n);return{[Ee.color.variable]:`colors.${t}.500`,_dark:{[Ee.color.variable]:r},[Ee.shadow.variable]:`inset 0 0 0px 1px ${Ee.color.reference}`}},x2={solid:v2,subtle:b2,outline:S2},Yo={baseStyle:y2,variants:x2,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:w2,definePartsStyle:k2}=le(GP.keys),Cc=U("breadcrumb-link-decor"),C2={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:Cc.reference,[Cc.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[Cc.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},T2=k2({link:C2}),P2=w2({baseStyle:T2}),E2={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},O1=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:V("gray.800","whiteAlpha.900")(e),_hover:{bg:V("gray.100","whiteAlpha.200")(e)},_active:{bg:V("gray.200","whiteAlpha.300")(e)}};const r=Ki(`${t}.200`,.12)(n),i=Ki(`${t}.200`,.24)(n);return{color:V(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:V(`${t}.50`,r)(e)},_active:{bg:V(`${t}.100`,i)(e)}}},_2=e=>{const{colorScheme:t}=e,n=V("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...nt(O1,e)}},$2={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},R2=e=>{const{colorScheme:t}=e;if(t==="gray"){const a=V("gray.100","whiteAlpha.200")(e);return{bg:a,color:V("gray.800","whiteAlpha.900")(e),_hover:{bg:V("gray.200","whiteAlpha.300")(e),_disabled:{bg:a}},_active:{bg:V("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=$2[t]??{},s=V(n,`${t}.200`)(e);return{bg:s,color:V(r,"gray.800")(e),_hover:{bg:V(i,`${t}.300`)(e),_disabled:{bg:s}},_active:{bg:V(o,`${t}.400`)(e)}}},A2=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:V(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:V(`${t}.700`,`${t}.500`)(e)}}},O2={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},L2={ghost:O1,outline:_2,solid:R2,link:A2,unstyled:O2},M2={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},D2={baseStyle:E2,variants:L2,sizes:M2,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Nr,defineMultiStyleConfig:z2}=le(pE.keys),$l=U("card-bg"),_n=U("card-padding"),L1=U("card-shadow"),tl=U("card-radius"),M1=U("card-border-width","0"),D1=U("card-border-color"),I2=Nr({container:{[$l.variable]:"colors.chakra-body-bg",backgroundColor:$l.reference,boxShadow:L1.reference,borderRadius:tl.reference,color:"chakra-body-text",borderWidth:M1.reference,borderColor:D1.reference},body:{padding:_n.reference,flex:"1 1 0%"},header:{padding:_n.reference},footer:{padding:_n.reference}}),j2={sm:Nr({container:{[tl.variable]:"radii.base",[_n.variable]:"space.3"}}),md:Nr({container:{[tl.variable]:"radii.md",[_n.variable]:"space.5"}}),lg:Nr({container:{[tl.variable]:"radii.xl",[_n.variable]:"space.7"}})},N2={elevated:Nr({container:{[L1.variable]:"shadows.base",_dark:{[$l.variable]:"colors.gray.700"}}}),outline:Nr({container:{[M1.variable]:"1px",[D1.variable]:"colors.chakra-border-color"}}),filled:Nr({container:{[$l.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[_n.variable]:0},header:{[_n.variable]:0},footer:{[_n.variable]:0}}},F2=z2({baseStyle:I2,variants:N2,sizes:j2,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:nl,defineMultiStyleConfig:B2}=le(qP.keys),Qo=U("checkbox-size"),V2=e=>{const{colorScheme:t}=e;return{w:Qo.reference,h:Qo.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:V(`${t}.500`,`${t}.200`)(e),borderColor:V(`${t}.500`,`${t}.200`)(e),color:V("white","gray.900")(e),_hover:{bg:V(`${t}.600`,`${t}.300`)(e),borderColor:V(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:V("gray.200","transparent")(e),bg:V("gray.200","whiteAlpha.300")(e),color:V("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:V(`${t}.500`,`${t}.200`)(e),borderColor:V(`${t}.500`,`${t}.200`)(e),color:V("white","gray.900")(e)},_disabled:{bg:V("gray.100","whiteAlpha.100")(e),borderColor:V("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:V("red.500","red.300")(e)}}},U2={_disabled:{cursor:"not-allowed"}},W2={userSelect:"none",_disabled:{opacity:.4}},H2={transitionProperty:"transform",transitionDuration:"normal"},K2=nl(e=>({icon:H2,container:U2,control:nt(V2,e),label:W2})),G2={sm:nl({control:{[Qo.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:nl({control:{[Qo.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:nl({control:{[Qo.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},qn=B2({baseStyle:K2,sizes:G2,defaultProps:{size:"md",colorScheme:"blue"}}),Zo=De("close-button-size"),So=De("close-button-bg"),q2={w:[Zo.reference],h:[Zo.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[So.variable]:"colors.blackAlpha.100",_dark:{[So.variable]:"colors.whiteAlpha.100"}},_active:{[So.variable]:"colors.blackAlpha.200",_dark:{[So.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:So.reference},X2={lg:{[Zo.variable]:"sizes.10",fontSize:"md"},md:{[Zo.variable]:"sizes.8",fontSize:"xs"},sm:{[Zo.variable]:"sizes.6",fontSize:"2xs"}},Y2={baseStyle:q2,sizes:X2,defaultProps:{size:"md"}},{variants:Q2,defaultProps:Z2}=Yo,J2={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:Ee.bg.reference,color:Ee.color.reference,boxShadow:Ee.shadow.reference},e_={baseStyle:J2,variants:Q2,defaultProps:Z2},t_={w:"100%",mx:"auto",maxW:"prose",px:"4"},n_={baseStyle:t_},r_={opacity:.6,borderColor:"inherit"},i_={borderStyle:"solid"},o_={borderStyle:"dashed"},s_={solid:i_,dashed:o_},a_={baseStyle:r_,variants:s_,defaultProps:{variant:"solid"}},{definePartsStyle:Kd,defineMultiStyleConfig:l_}=le(XP.keys),Tc=U("drawer-bg"),Pc=U("drawer-box-shadow");function oi(e){return Kd(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}const u_={bg:"blackAlpha.600",zIndex:"modal"},c_={display:"flex",zIndex:"modal",justifyContent:"center"},d_=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[Tc.variable]:"colors.white",[Pc.variable]:"shadows.lg",_dark:{[Tc.variable]:"colors.gray.700",[Pc.variable]:"shadows.dark-lg"},bg:Tc.reference,boxShadow:Pc.reference}},f_={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},h_={position:"absolute",top:"2",insetEnd:"3"},p_={px:"6",py:"2",flex:"1",overflow:"auto"},m_={px:"6",py:"4"},g_=Kd(e=>({overlay:u_,dialogContainer:c_,dialog:nt(d_,e),header:f_,closeButton:h_,body:p_,footer:m_})),y_={xs:oi("xs"),sm:oi("md"),md:oi("lg"),lg:oi("2xl"),xl:oi("4xl"),full:oi("full")},v_=l_({baseStyle:g_,sizes:y_,defaultProps:{size:"xs"}}),{definePartsStyle:b_,defineMultiStyleConfig:S_}=le(YP.keys),x_={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},w_={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},k_={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},C_=b_({preview:x_,input:w_,textarea:k_}),T_=S_({baseStyle:C_}),{definePartsStyle:P_,defineMultiStyleConfig:E_}=le(QP.keys),Mi=U("form-control-color"),__={marginStart:"1",[Mi.variable]:"colors.red.500",_dark:{[Mi.variable]:"colors.red.300"},color:Mi.reference},$_={mt:"2",[Mi.variable]:"colors.gray.600",_dark:{[Mi.variable]:"colors.whiteAlpha.600"},color:Mi.reference,lineHeight:"normal",fontSize:"sm"},R_=P_({container:{width:"100%",position:"relative"},requiredIndicator:__,helperText:$_}),A_=E_({baseStyle:R_}),{definePartsStyle:O_,defineMultiStyleConfig:L_}=le(ZP.keys),Di=U("form-error-color"),M_={[Di.variable]:"colors.red.500",_dark:{[Di.variable]:"colors.red.300"},color:Di.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},D_={marginEnd:"0.5em",[Di.variable]:"colors.red.500",_dark:{[Di.variable]:"colors.red.300"},color:Di.reference},z_=O_({text:M_,icon:D_}),I_=L_({baseStyle:z_}),j_={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},N_={baseStyle:j_},F_={fontFamily:"heading",fontWeight:"bold"},B_={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},V_={baseStyle:F_,sizes:B_,defaultProps:{size:"xl"}},{definePartsStyle:Tn,defineMultiStyleConfig:U_}=le(JP.keys),ci=U("input-height"),di=U("input-font-size"),fi=U("input-padding"),hi=U("input-border-radius"),W_=Tn({addon:{height:ci.reference,fontSize:di.reference,px:fi.reference,borderRadius:hi.reference},field:{width:"100%",height:ci.reference,fontSize:di.reference,px:fi.reference,borderRadius:hi.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Wn={lg:{[di.variable]:"fontSizes.lg",[fi.variable]:"space.4",[hi.variable]:"radii.md",[ci.variable]:"sizes.12"},md:{[di.variable]:"fontSizes.md",[fi.variable]:"space.4",[hi.variable]:"radii.md",[ci.variable]:"sizes.10"},sm:{[di.variable]:"fontSizes.sm",[fi.variable]:"space.3",[hi.variable]:"radii.sm",[ci.variable]:"sizes.8"},xs:{[di.variable]:"fontSizes.xs",[fi.variable]:"space.2",[hi.variable]:"radii.sm",[ci.variable]:"sizes.6"}},H_={lg:Tn({field:Wn.lg,group:Wn.lg}),md:Tn({field:Wn.md,group:Wn.md}),sm:Tn({field:Wn.sm,group:Wn.sm}),xs:Tn({field:Wn.xs,group:Wn.xs})};function zh(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||V("blue.500","blue.300")(e),errorBorderColor:n||V("red.500","red.300")(e)}}const K_=Tn(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=zh(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:V("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:tt(t,r),boxShadow:`0 0 0 1px ${tt(t,r)}`},_focusVisible:{zIndex:1,borderColor:tt(t,n),boxShadow:`0 0 0 1px ${tt(t,n)}`}},addon:{border:"1px solid",borderColor:V("inherit","whiteAlpha.50")(e),bg:V("gray.100","whiteAlpha.300")(e)}}}),G_=Tn(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=zh(e);return{field:{border:"2px solid",borderColor:"transparent",bg:V("gray.100","whiteAlpha.50")(e),_hover:{bg:V("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:tt(t,r)},_focusVisible:{bg:"transparent",borderColor:tt(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:V("gray.100","whiteAlpha.50")(e)}}}),q_=Tn(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=zh(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:tt(t,r),boxShadow:`0px 1px 0px 0px ${tt(t,r)}`},_focusVisible:{borderColor:tt(t,n),boxShadow:`0px 1px 0px 0px ${tt(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),X_=Tn({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),Y_={outline:K_,filled:G_,flushed:q_,unstyled:X_},ne=U_({baseStyle:W_,sizes:H_,variants:Y_,defaultProps:{size:"md",variant:"outline"}}),Ec=U("kbd-bg"),Q_={[Ec.variable]:"colors.gray.100",_dark:{[Ec.variable]:"colors.whiteAlpha.100"},bg:Ec.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Z_={baseStyle:Q_},J_={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},e$={baseStyle:J_},{defineMultiStyleConfig:t$,definePartsStyle:n$}=le(eE.keys),r$={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},i$=n$({icon:r$}),o$=t$({baseStyle:i$}),{defineMultiStyleConfig:s$,definePartsStyle:a$}=le(tE.keys),nn=U("menu-bg"),_c=U("menu-shadow"),l$={[nn.variable]:"#fff",[_c.variable]:"shadows.sm",_dark:{[nn.variable]:"colors.gray.700",[_c.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:"dropdown",borderRadius:"md",borderWidth:"1px",bg:nn.reference,boxShadow:_c.reference},u$={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[nn.variable]:"colors.gray.100",_dark:{[nn.variable]:"colors.whiteAlpha.100"}},_active:{[nn.variable]:"colors.gray.200",_dark:{[nn.variable]:"colors.whiteAlpha.200"}},_expanded:{[nn.variable]:"colors.gray.100",_dark:{[nn.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:nn.reference},c$={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},d$={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},f$={opacity:.6},h$={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},p$={transitionProperty:"common",transitionDuration:"normal"},m$=a$({button:p$,list:l$,item:u$,groupTitle:c$,icon:d$,command:f$,divider:h$}),g$=s$({baseStyle:m$}),{defineMultiStyleConfig:y$,definePartsStyle:Gd}=le(nE.keys),$c=U("modal-bg"),Rc=U("modal-shadow"),v$={bg:"blackAlpha.600",zIndex:"modal"},b$=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},S$=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[$c.variable]:"colors.white",[Rc.variable]:"shadows.lg",_dark:{[$c.variable]:"colors.gray.700",[Rc.variable]:"shadows.dark-lg"},bg:$c.reference,boxShadow:Rc.reference}},x$={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},w$={position:"absolute",top:"2",insetEnd:"3"},k$=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},C$={px:"6",py:"4"},T$=Gd(e=>({overlay:v$,dialogContainer:nt(b$,e),dialog:nt(S$,e),header:x$,closeButton:w$,body:nt(k$,e),footer:C$}));function Nt(e){return Gd(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}const P$={xs:Nt("xs"),sm:Nt("sm"),md:Nt("md"),lg:Nt("lg"),xl:Nt("xl"),"2xl":Nt("2xl"),"3xl":Nt("3xl"),"4xl":Nt("4xl"),"5xl":Nt("5xl"),"6xl":Nt("6xl"),full:Nt("full")},E$=y$({baseStyle:T$,sizes:P$,defaultProps:{size:"md"}}),z1={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},{defineMultiStyleConfig:_$,definePartsStyle:I1}=le(rE.keys),Ih=De("number-input-stepper-width"),j1=De("number-input-input-padding"),$$=wn(Ih).add("0.5rem").toString(),Ac=De("number-input-bg"),Oc=De("number-input-color"),Lc=De("number-input-border-color"),R$={[Ih.variable]:"sizes.6",[j1.variable]:$$},A$=e=>{var t;return((t=nt(ne.baseStyle,e))==null?void 0:t.field)??{}},O$={width:Ih.reference},L$={borderStart:"1px solid",borderStartColor:Lc.reference,color:Oc.reference,bg:Ac.reference,[Oc.variable]:"colors.chakra-body-text",[Lc.variable]:"colors.chakra-border-color",_dark:{[Oc.variable]:"colors.whiteAlpha.800",[Lc.variable]:"colors.whiteAlpha.300"},_active:{[Ac.variable]:"colors.gray.200",_dark:{[Ac.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},M$=I1(e=>({root:R$,field:nt(A$,e)??{},stepperGroup:O$,stepper:L$}));function Sa(e){var o,s;const t=(o=ne.sizes)==null?void 0:o[e],n={lg:"md",md:"md",sm:"sm",xs:"sm"},r=((s=t.field)==null?void 0:s.fontSize)??"md",i=z1.fontSizes[r];return I1({field:{...t.field,paddingInlineEnd:j1.reference,verticalAlign:"top"},stepper:{fontSize:wn(i).multiply(.75).toString(),_first:{borderTopEndRadius:n[e]},_last:{borderBottomEndRadius:n[e],mt:"-1px",borderTopWidth:1}}})}const D$={xs:Sa("xs"),sm:Sa("sm"),md:Sa("md"),lg:Sa("lg")},z$=_$({baseStyle:M$,sizes:D$,variants:ne.variants,defaultProps:ne.defaultProps});var Vv;const I$={...(Vv=ne.baseStyle)==null?void 0:Vv.field,textAlign:"center"},j$={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}};var Uv;const N$={outline:e=>{var t,n;return((n=nt((t=ne.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=nt((t=ne.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=nt((t=ne.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((Uv=ne.variants)==null?void 0:Uv.unstyled.field)??{}},F$={baseStyle:I$,sizes:j$,variants:N$,defaultProps:ne.defaultProps},{defineMultiStyleConfig:B$,definePartsStyle:V$}=le(iE.keys),xa=De("popper-bg"),U$=De("popper-arrow-bg"),gg=De("popper-arrow-shadow-color"),W$={zIndex:10},H$={[xa.variable]:"colors.white",bg:xa.reference,[U$.variable]:xa.reference,[gg.variable]:"colors.gray.200",_dark:{[xa.variable]:"colors.gray.700",[gg.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},K$={px:3,py:2,borderBottomWidth:"1px"},G$={px:3,py:2},q$={px:3,py:2,borderTopWidth:"1px"},X$={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},Y$=V$({popper:W$,content:H$,header:K$,body:G$,footer:q$,closeButton:X$}),Q$=B$({baseStyle:Y$}),{defineMultiStyleConfig:Z$,definePartsStyle:jo}=le(oE.keys),J$=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=V(dg(),dg("1rem","rgba(0,0,0,0.1)"))(e),s=V(`${t}.500`,`${t}.200`)(e),a=`linear-gradient( + to right, + transparent 0%, + ${tt(n,s)} 50%, + transparent 100% + )`;return{...!r&&i&&o,...r?{bgImage:a}:{bgColor:s}}},eR={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},tR=e=>({bg:V("gray.100","whiteAlpha.300")(e)}),nR=e=>({transitionProperty:"common",transitionDuration:"slow",...J$(e)}),rR=jo(e=>({label:eR,filledTrack:nR(e),track:tR(e)})),iR={xs:jo({track:{h:"1"}}),sm:jo({track:{h:"2"}}),md:jo({track:{h:"3"}}),lg:jo({track:{h:"4"}})},oR=Z$({sizes:iR,baseStyle:rR,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:sR,definePartsStyle:rl}=le(sE.keys),aR=e=>{var n;const t=(n=nt(qn.baseStyle,e))==null?void 0:n.control;return{...t,borderRadius:"full",_checked:{...t==null?void 0:t._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},lR=rl(e=>{var t,n;return{label:(t=qn.baseStyle)==null?void 0:t.call(qn,e).label,container:(n=qn.baseStyle)==null?void 0:n.call(qn,e).container,control:aR(e)}}),uR={md:rl({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:rl({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:rl({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},cR=sR({baseStyle:lR,sizes:uR,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:dR,definePartsStyle:fR}=le(aE.keys),wa=U("select-bg");var Wv;const hR={...(Wv=ne.baseStyle)==null?void 0:Wv.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:wa.reference,[wa.variable]:"colors.white",_dark:{[wa.variable]:"colors.gray.700"},"> option, > optgroup":{bg:wa.reference}},pR={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},mR=fR({field:hR,icon:pR}),ka={paddingInlineEnd:"8"};var Hv,Kv,Gv,qv,Xv,Yv,Qv,Zv;const gR={lg:{...(Hv=ne.sizes)==null?void 0:Hv.lg,field:{...(Kv=ne.sizes)==null?void 0:Kv.lg.field,...ka}},md:{...(Gv=ne.sizes)==null?void 0:Gv.md,field:{...(qv=ne.sizes)==null?void 0:qv.md.field,...ka}},sm:{...(Xv=ne.sizes)==null?void 0:Xv.sm,field:{...(Yv=ne.sizes)==null?void 0:Yv.sm.field,...ka}},xs:{...(Qv=ne.sizes)==null?void 0:Qv.xs,field:{...(Zv=ne.sizes)==null?void 0:Zv.xs.field,...ka},icon:{insetEnd:"1"}}},yR=dR({baseStyle:mR,sizes:gR,variants:ne.variants,defaultProps:ne.defaultProps}),Mc=U("skeleton-start-color"),Dc=U("skeleton-end-color"),vR={[Mc.variable]:"colors.gray.100",[Dc.variable]:"colors.gray.400",_dark:{[Mc.variable]:"colors.gray.800",[Dc.variable]:"colors.gray.600"},background:Mc.reference,borderColor:Dc.reference,opacity:.7,borderRadius:"sm"},bR={baseStyle:vR},zc=U("skip-link-bg"),SR={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[zc.variable]:"colors.white",_dark:{[zc.variable]:"colors.gray.700"},bg:zc.reference}},xR={baseStyle:SR},{defineMultiStyleConfig:wR,definePartsStyle:Cu}=le(lE.keys),ys=U("slider-thumb-size"),vs=U("slider-track-size"),Qn=U("slider-bg"),kR=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...Mh({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},CR=e=>({...Mh({orientation:e.orientation,horizontal:{h:vs.reference},vertical:{w:vs.reference}}),overflow:"hidden",borderRadius:"sm",[Qn.variable]:"colors.gray.200",_dark:{[Qn.variable]:"colors.whiteAlpha.200"},_disabled:{[Qn.variable]:"colors.gray.300",_dark:{[Qn.variable]:"colors.whiteAlpha.300"}},bg:Qn.reference}),TR=e=>{const{orientation:t}=e;return{...Mh({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:ys.reference,h:ys.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},PR=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[Qn.variable]:`colors.${t}.500`,_dark:{[Qn.variable]:`colors.${t}.200`},bg:Qn.reference}},ER=Cu(e=>({container:kR(e),track:CR(e),thumb:TR(e),filledTrack:PR(e)})),_R=Cu({container:{[ys.variable]:"sizes.4",[vs.variable]:"sizes.1"}}),$R=Cu({container:{[ys.variable]:"sizes.3.5",[vs.variable]:"sizes.1"}}),RR=Cu({container:{[ys.variable]:"sizes.2.5",[vs.variable]:"sizes.0.5"}}),AR={lg:_R,md:$R,sm:RR},OR=wR({baseStyle:ER,sizes:AR,defaultProps:{size:"md",colorScheme:"blue"}}),Or=De("spinner-size"),LR={width:[Or.reference],height:[Or.reference]},MR={xs:{[Or.variable]:"sizes.3"},sm:{[Or.variable]:"sizes.4"},md:{[Or.variable]:"sizes.6"},lg:{[Or.variable]:"sizes.8"},xl:{[Or.variable]:"sizes.12"}},DR={baseStyle:LR,sizes:MR,defaultProps:{size:"md"}},{defineMultiStyleConfig:zR,definePartsStyle:N1}=le(uE.keys),IR={fontWeight:"medium"},jR={opacity:.8,marginBottom:"2"},NR={verticalAlign:"baseline",fontWeight:"semibold"},FR={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},BR=N1({container:{},label:IR,helpText:jR,number:NR,icon:FR}),VR={md:N1({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},UR=zR({baseStyle:BR,sizes:VR,defaultProps:{size:"md"}}),{defineMultiStyleConfig:WR,definePartsStyle:No}=le(["stepper","step","title","description","indicator","separator","icon","number"]),kn=U("stepper-indicator-size"),pi=U("stepper-icon-size"),mi=U("stepper-title-font-size"),Fo=U("stepper-description-font-size"),xo=U("stepper-accent-color"),HR=No(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[xo.variable]:`colors.${e}.500`,_dark:{[xo.variable]:`colors.${e}.200`}},title:{fontSize:mi.reference,fontWeight:"medium"},description:{fontSize:Fo.reference,color:"chakra-subtle-text"},number:{fontSize:mi.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:pi.reference,height:pi.reference},indicator:{flexShrink:0,borderRadius:"full",width:kn.reference,height:kn.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:xo.reference},"&[data-status=complete]":{bg:xo.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:xo.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${kn.reference} - 8px)`,top:`calc(${kn.reference} + 4px)`,insetStart:`calc(${kn.reference} / 2 - 1px)`}}})),KR=WR({baseStyle:HR,sizes:{xs:No({stepper:{[kn.variable]:"sizes.4",[pi.variable]:"sizes.3",[mi.variable]:"fontSizes.xs",[Fo.variable]:"fontSizes.xs"}}),sm:No({stepper:{[kn.variable]:"sizes.6",[pi.variable]:"sizes.4",[mi.variable]:"fontSizes.sm",[Fo.variable]:"fontSizes.xs"}}),md:No({stepper:{[kn.variable]:"sizes.8",[pi.variable]:"sizes.5",[mi.variable]:"fontSizes.md",[Fo.variable]:"fontSizes.sm"}}),lg:No({stepper:{[kn.variable]:"sizes.10",[pi.variable]:"sizes.6",[mi.variable]:"fontSizes.lg",[Fo.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:GR,definePartsStyle:il}=le(cE.keys),Jo=De("switch-track-width"),Fr=De("switch-track-height"),Ic=De("switch-track-diff"),qR=wn.subtract(Jo,Fr),qd=De("switch-thumb-x"),wo=De("switch-bg"),XR=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Jo.reference],height:[Fr.reference],transitionProperty:"common",transitionDuration:"fast",[wo.variable]:"colors.gray.300",_dark:{[wo.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[wo.variable]:`colors.${t}.500`,_dark:{[wo.variable]:`colors.${t}.200`}},bg:wo.reference}},YR={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Fr.reference],height:[Fr.reference],_checked:{transform:`translateX(${qd.reference})`}},QR=il(e=>({container:{[Ic.variable]:qR,[qd.variable]:Ic.reference,_rtl:{[qd.variable]:wn(Ic).negate().toString()}},track:XR(e),thumb:YR})),ZR={sm:il({container:{[Jo.variable]:"1.375rem",[Fr.variable]:"sizes.3"}}),md:il({container:{[Jo.variable]:"1.875rem",[Fr.variable]:"sizes.4"}}),lg:il({container:{[Jo.variable]:"2.875rem",[Fr.variable]:"sizes.6"}})},JR=GR({baseStyle:QR,sizes:ZR,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:eA,definePartsStyle:zi}=le(dE.keys),tA=zi({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Rl={"&[data-is-numeric=true]":{textAlign:"end"}},nA=zi(e=>{const{colorScheme:t}=e;return{th:{color:V("gray.600","gray.400")(e),borderBottom:"1px",borderColor:V(`${t}.100`,`${t}.700`)(e),...Rl},td:{borderBottom:"1px",borderColor:V(`${t}.100`,`${t}.700`)(e),...Rl},caption:{color:V("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),rA=zi(e=>{const{colorScheme:t}=e;return{th:{color:V("gray.600","gray.400")(e),borderBottom:"1px",borderColor:V(`${t}.100`,`${t}.700`)(e),...Rl},td:{borderBottom:"1px",borderColor:V(`${t}.100`,`${t}.700`)(e),...Rl},caption:{color:V("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:V(`${t}.100`,`${t}.700`)(e)},td:{background:V(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),iA={simple:nA,striped:rA,unstyled:{}},oA={sm:zi({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:zi({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:zi({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},sA=eA({baseStyle:tA,variants:iA,sizes:oA,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),lt=U("tabs-color"),Ht=U("tabs-bg"),Ca=U("tabs-border-color"),{defineMultiStyleConfig:aA,definePartsStyle:dn}=le(fE.keys),lA=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},uA=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},cA=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},dA={p:4},fA=dn(e=>({root:lA(e),tab:uA(e),tablist:cA(e),tabpanel:dA})),hA={sm:dn({tab:{py:1,px:4,fontSize:"sm"}}),md:dn({tab:{fontSize:"md",py:2,px:4}}),lg:dn({tab:{fontSize:"lg",py:3,px:4}})},pA=dn(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=r?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[lt.variable]:`colors.${t}.600`,_dark:{[lt.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Ht.variable]:"colors.gray.200",_dark:{[Ht.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:lt.reference,bg:Ht.reference}}}),mA=dn(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Ca.variable]:"transparent",_selected:{[lt.variable]:`colors.${t}.600`,[Ca.variable]:"colors.white",_dark:{[lt.variable]:`colors.${t}.300`,[Ca.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Ca.reference},color:lt.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),gA=dn(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Ht.variable]:"colors.gray.50",_dark:{[Ht.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Ht.variable]:"colors.white",[lt.variable]:`colors.${t}.600`,_dark:{[Ht.variable]:"colors.gray.800",[lt.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:lt.reference,bg:Ht.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),yA=dn(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:tt(n,`${t}.700`),bg:tt(n,`${t}.100`)}}}}),vA=dn(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[lt.variable]:"colors.gray.600",_dark:{[lt.variable]:"inherit"},_selected:{[lt.variable]:"colors.white",[Ht.variable]:`colors.${t}.600`,_dark:{[lt.variable]:"colors.gray.800",[Ht.variable]:`colors.${t}.300`}},color:lt.reference,bg:Ht.reference}}}),bA=dn({}),SA={line:pA,enclosed:mA,"enclosed-colored":gA,"soft-rounded":yA,"solid-rounded":vA,unstyled:bA},xA=aA({baseStyle:fA,sizes:hA,variants:SA,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:wA,definePartsStyle:Br}=le(hE.keys),yg=U("tag-bg"),vg=U("tag-color"),jc=U("tag-shadow"),ol=U("tag-min-height"),sl=U("tag-min-width"),al=U("tag-font-size"),ll=U("tag-padding-inline"),kA={fontWeight:"medium",lineHeight:1.2,outline:0,[vg.variable]:Ee.color.reference,[yg.variable]:Ee.bg.reference,[jc.variable]:Ee.shadow.reference,color:vg.reference,bg:yg.reference,boxShadow:jc.reference,borderRadius:"md",minH:ol.reference,minW:sl.reference,fontSize:al.reference,px:ll.reference,_focusVisible:{[jc.variable]:"shadows.outline"}},CA={lineHeight:1.2,overflow:"visible"},TA={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},PA=Br({container:kA,label:CA,closeButton:TA}),EA={sm:Br({container:{[ol.variable]:"sizes.5",[sl.variable]:"sizes.5",[al.variable]:"fontSizes.xs",[ll.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Br({container:{[ol.variable]:"sizes.6",[sl.variable]:"sizes.6",[al.variable]:"fontSizes.sm",[ll.variable]:"space.2"}}),lg:Br({container:{[ol.variable]:"sizes.8",[sl.variable]:"sizes.8",[al.variable]:"fontSizes.md",[ll.variable]:"space.3"}})},_A={subtle:Br(e=>{var t;return{container:(t=Yo.variants)==null?void 0:t.subtle(e)}}),solid:Br(e=>{var t;return{container:(t=Yo.variants)==null?void 0:t.solid(e)}}),outline:Br(e=>{var t;return{container:(t=Yo.variants)==null?void 0:t.outline(e)}})},$A=wA({variants:_A,baseStyle:PA,sizes:EA,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}});var Jv;const RA={...(Jv=ne.baseStyle)==null?void 0:Jv.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"};var e1;const AA={outline:e=>{var t;return((t=ne.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=ne.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=ne.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((e1=ne.variants)==null?void 0:e1.unstyled.field)??{}};var t1,n1,r1,i1;const OA={xs:((t1=ne.sizes)==null?void 0:t1.xs.field)??{},sm:((n1=ne.sizes)==null?void 0:n1.sm.field)??{},md:((r1=ne.sizes)==null?void 0:r1.md.field)??{},lg:((i1=ne.sizes)==null?void 0:i1.lg.field)??{}},LA={baseStyle:RA,sizes:OA,variants:AA,defaultProps:{size:"md",variant:"outline"}},Ta=De("tooltip-bg"),Nc=De("tooltip-fg"),MA=De("popper-arrow-bg"),DA={bg:Ta.reference,color:Nc.reference,[Ta.variable]:"colors.gray.700",[Nc.variable]:"colors.whiteAlpha.900",_dark:{[Ta.variable]:"colors.gray.300",[Nc.variable]:"colors.gray.900"},[MA.variable]:Ta.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},zA={baseStyle:DA},IA={Accordion:wE,Alert:o2,Avatar:g2,Badge:Yo,Breadcrumb:P2,Button:D2,Checkbox:qn,CloseButton:Y2,Code:e_,Container:n_,Divider:a_,Drawer:v_,Editable:T_,Form:A_,FormError:I_,FormLabel:N_,Heading:V_,Input:ne,Kbd:Z_,Link:e$,List:o$,Menu:g$,Modal:E$,NumberInput:z$,PinInput:F$,Popover:Q$,Progress:oR,Radio:cR,Select:yR,Skeleton:bR,SkipLink:xR,Slider:OR,Spinner:DR,Stat:UR,Switch:JR,Table:sA,Tabs:xA,Tag:$A,Textarea:LA,Tooltip:zA,Card:F2,Stepper:KR},jA={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},NA={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},FA={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"}},BA={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},VA={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},UA={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},WA={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},HA={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},KA={property:UA,easing:WA,duration:HA},GA={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},qA={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},XA={breakpoints:NA,zIndices:GA,radii:BA,blur:qA,colors:FA,...z1,sizes:R1,shadows:VA,space:$1,borders:jA,transition:KA},YA={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},QA={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},ZA="ltr",JA={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},eO={semanticTokens:YA,direction:ZA,...XA,components:IA,styles:QA,config:JA};var tO=!1;function nO(e){if(e.sheet)return e.sheet;for(var t=0;t0?Be(uo,--ht):0,qi--,_e===10&&(qi=1,Pu--),_e}function bt(){return _e=ht2||Ss(_e)>3?"":" "}function mO(e,t){for(;--t&&bt()&&!(_e<48||_e>102||_e>57&&_e<65||_e>70&&_e<97););return Ys(e,ul()+(t<6&&fn()==32&&bt()==32))}function Yd(e){for(;bt();)switch(_e){case e:return ht;case 34:case 39:e!==34&&e!==39&&Yd(_e);break;case 40:e===41&&Yd(e);break;case 92:bt();break}return ht}function gO(e,t){for(;bt()&&e+_e!==57;)if(e+_e===84&&fn()===47)break;return"/*"+Ys(t,ht-1)+"*"+Tu(e===47?e:bt())}function yO(e){for(;!Ss(fn());)bt();return Ys(e,ht)}function vO(e){return H1(dl("",null,null,null,[""],e=W1(e),0,[0],e))}function dl(e,t,n,r,i,o,s,a,l){for(var u=0,c=0,d=s,f=0,p=0,v=0,y=1,S=1,m=1,h=0,g="",k=i,T=o,$=r,_=g;S;)switch(v=h,h=bt()){case 40:if(v!=108&&Be(_,d-1)==58){Xd(_+=te(cl(h),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:_+=cl(h);break;case 9:case 10:case 13:case 32:_+=pO(v);break;case 92:_+=mO(ul()-1,7);continue;case 47:switch(fn()){case 42:case 47:Pa(bO(gO(bt(),ul()),t,n),l);break;default:_+="/"}break;case 123*y:a[u++]=rn(_)*m;case 125*y:case 59:case 0:switch(h){case 0:case 125:S=0;case 59+c:m==-1&&(_=te(_,/\f/g,"")),p>0&&rn(_)-d&&Pa(p>32?Sg(_+";",r,n,d-1):Sg(te(_," ","")+";",r,n,d-2),l);break;case 59:_+=";";default:if(Pa($=bg(_,t,n,u,c,i,a,g,k=[],T=[],d),o),h===123)if(c===0)dl(_,t,$,$,k,o,d,a,T);else switch(f===99&&Be(_,3)===110?100:f){case 100:case 108:case 109:case 115:dl(e,$,$,r&&Pa(bg(e,$,$,0,0,i,a,g,i,k=[],d),T),i,T,d,a,r?k:T);break;default:dl(_,$,$,$,[""],T,0,a,T)}}u=c=p=0,y=m=1,g=_="",d=s;break;case 58:d=1+rn(_),p=v;default:if(y<1){if(h==123)--y;else if(h==125&&y++==0&&hO()==125)continue}switch(_+=Tu(h),h*y){case 38:m=c>0?1:(_+="\f",-1);break;case 44:a[u++]=(rn(_)-1)*m,m=1;break;case 64:fn()===45&&(_+=cl(bt())),f=fn(),c=d=rn(g=_+=yO(ul())),h++;break;case 45:v===45&&rn(_)==2&&(y=0)}}return o}function bg(e,t,n,r,i,o,s,a,l,u,c){for(var d=i-1,f=i===0?o:[""],p=Fh(f),v=0,y=0,S=0;v0?f[m]+" "+h:te(h,/&\f/g,f[m])))&&(l[S++]=g);return Eu(e,t,n,i===0?jh:a,l,u,c)}function bO(e,t,n){return Eu(e,t,n,F1,Tu(fO()),bs(e,2,-2),0)}function Sg(e,t,n,r){return Eu(e,t,n,Nh,bs(e,0,r),bs(e,r+1,-1),r)}function Ii(e,t){for(var n="",r=Fh(e),i=0;i6)switch(Be(e,t+1)){case 109:if(Be(e,t+4)!==45)break;case 102:return te(e,/(.+:)(.+)-([^]+)/,"$1"+ee+"$2-$3$1"+Al+(Be(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Xd(e,"stretch")?G1(te(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Be(e,t+1)!==115)break;case 6444:switch(Be(e,rn(e)-3-(~Xd(e,"!important")&&10))){case 107:return te(e,":",":"+ee)+e;case 101:return te(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ee+(Be(e,14)===45?"inline-":"")+"box$3$1"+ee+"$2$3$1"+Ke+"$2box$3")+e}break;case 5936:switch(Be(e,t+11)){case 114:return ee+e+Ke+te(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ee+e+Ke+te(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ee+e+Ke+te(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ee+e+Ke+e+e}return e}var _O=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Nh:t.return=G1(t.value,t.length);break;case B1:return Ii([ko(t,{value:te(t.value,"@","@"+ee)})],i);case jh:if(t.length)return dO(t.props,function(o){switch(cO(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ii([ko(t,{props:[te(o,/:(read-\w+)/,":"+Al+"$1")]})],i);case"::placeholder":return Ii([ko(t,{props:[te(o,/:(plac\w+)/,":"+ee+"input-$1")]}),ko(t,{props:[te(o,/:(plac\w+)/,":"+Al+"$1")]}),ko(t,{props:[te(o,/:(plac\w+)/,Ke+"input-$1")]})],i)}return""})}},$O=[_O],RO=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var S=y.getAttribute("data-emotion");S.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=t.stylisPlugins||$O,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(y){for(var S=y.getAttribute("data-emotion").split(" "),m=1;m=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var BO={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},VO=!1,UO=/[A-Z]|^ms/g,WO=/_EMO_([^_]+?)_([^]*?)_EMO_/g,J1=function(t){return t.charCodeAt(1)===45},kg=function(t){return t!=null&&typeof t!="boolean"},Fc=K1(function(e){return J1(e)?e:e.replace(UO,"-$&").toLowerCase()}),Cg=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(WO,function(r,i,o){return on={name:i,styles:o,next:on},i})}return BO[t]!==1&&!J1(t)&&typeof n=="number"&&n!==0?n+"px":n},HO="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function xs(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return on={name:i.name,styles:i.styles,next:on},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)on={name:s.name,styles:s.styles,next:on},s=s.next;var a=o.styles+";";return a}return KO(e,t,n)}case"function":{if(e!==void 0){var l=on,u=n(e);return on=l,xs(e,t,u)}break}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function KO(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{const o=t?r.preventTransition():void 0;document.documentElement.dataset.theme=i,document.documentElement.style.colorScheme=i,o==null||o()},setClassName(i){document.body.classList.add(i?Ea.dark:Ea.light),document.body.classList.remove(i?Ea.light:Ea.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(i){return r.query().matches??i==="dark"?"dark":"light"},addListener(i){const o=r.query(),s=a=>{i(a.matches?"dark":"light")};return typeof o.addListener=="function"?o.addListener(s):o.addEventListener("change",s),()=>{typeof o.removeListener=="function"?o.removeListener(s):o.removeEventListener("change",s)}},preventTransition(){const i=document.createElement("style");return i.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),n!==void 0&&(i.nonce=n),document.head.appendChild(i),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(i)})})}}};return r}const o5="chakra-ui-color-mode";function s5(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}const a5=s5(o5),_g=()=>{},l5=vT()?x.useLayoutEffect:x.useEffect;function $g(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}const rb=Nu(function(t,n){const{value:r,children:i,options:{useSystemColorMode:o,initialColorMode:s,disableTransitionOnChange:a}={},colorModeManager:l=a5}=t,u=s==="dark"?"dark":"light",[c,d]=x.useState(()=>$g(l,u)),[f,p]=x.useState(()=>$g(l)),{getSystemTheme:v,setClassName:y,setDataset:S,addListener:m}=x.useMemo(()=>i5({preventTransition:a,nonce:n==null?void 0:n.nonce}),[a,n==null?void 0:n.nonce]),h=s==="system"&&!c?f:c,g=x.useCallback($=>{const _=$==="system"?v():$;d(_),y(_==="dark"),S(_),l.set(_)},[l,v,y,S]);l5(()=>{s==="system"&&p(v())},[]),x.useEffect(()=>{const $=l.get();if($){g($);return}if(s==="system"){g("system");return}g(u)},[l,u,s,g]);const k=x.useCallback(()=>{g(h==="dark"?"light":"dark")},[h,g]);x.useEffect(()=>{if(o)return m(g)},[o,m,g]);const T=x.useMemo(()=>({colorMode:r??h,toggleColorMode:r?_g:k,setColorMode:r?_g:g,forced:r!==void 0}),[h,k,g,r]);return O.jsx(Gh.Provider,{value:T,children:i})});rb.displayName="ColorModeProvider";const ib=String.raw,ob=ib` + :root, + :host { + --chakra-vh: 100vh; + } + + @supports (height: -webkit-fill-available) { + :root, + :host { + --chakra-vh: -webkit-fill-available; + } + } + + @supports (height: -moz-fill-available) { + :root, + :host { + --chakra-vh: -moz-fill-available; + } + } + + @supports (height: 100dvh) { + :root, + :host { + --chakra-vh: 100dvh; + } + } +`,u5=()=>O.jsx(Fu,{styles:ob}),c5=({scope:e=""})=>O.jsx(Fu,{styles:ib` + html { + line-height: 1.5; + -webkit-text-size-adjust: 100%; + font-family: system-ui, sans-serif; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + -moz-osx-font-smoothing: grayscale; + touch-action: manipulation; + } + + body { + position: relative; + min-height: 100%; + margin: 0; + font-feature-settings: "kern"; + } + + ${e} :where(*, *::before, *::after) { + border-width: 0; + border-style: solid; + box-sizing: border-box; + word-wrap: break-word; + } + + main { + display: block; + } + + ${e} hr { + border-top-width: 1px; + box-sizing: content-box; + height: 0; + overflow: visible; + } + + ${e} :where(pre, code, kbd,samp) { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-size: 1em; + } + + ${e} a { + background-color: transparent; + color: inherit; + text-decoration: inherit; + } + + ${e} abbr[title] { + border-bottom: none; + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + } + + ${e} :where(b, strong) { + font-weight: bold; + } + + ${e} small { + font-size: 80%; + } + + ${e} :where(sub,sup) { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + ${e} sub { + bottom: -0.25em; + } + + ${e} sup { + top: -0.5em; + } + + ${e} img { + border-style: none; + } + + ${e} :where(button, input, optgroup, select, textarea) { + font-family: inherit; + font-size: 100%; + line-height: 1.15; + margin: 0; + } + + ${e} :where(button, input) { + overflow: visible; + } + + ${e} :where(button, select) { + text-transform: none; + } + + ${e} :where( + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner + ) { + border-style: none; + padding: 0; + } + + ${e} fieldset { + padding: 0.35em 0.75em 0.625em; + } + + ${e} legend { + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal; + } + + ${e} progress { + vertical-align: baseline; + } + + ${e} textarea { + overflow: auto; + } + + ${e} :where([type="checkbox"], [type="radio"]) { + box-sizing: border-box; + padding: 0; + } + + ${e} input[type="number"]::-webkit-inner-spin-button, + ${e} input[type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none !important; + } + + ${e} input[type="number"] { + -moz-appearance: textfield; + } + + ${e} input[type="search"] { + -webkit-appearance: textfield; + outline-offset: -2px; + } + + ${e} input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none !important; + } + + ${e} ::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit; + } + + ${e} details { + display: block; + } + + ${e} summary { + display: list-item; + } + + template { + display: none; + } + + [hidden] { + display: none !important; + } + + ${e} :where( + blockquote, + dl, + dd, + h1, + h2, + h3, + h4, + h5, + h6, + hr, + figure, + p, + pre + ) { + margin: 0; + } + + ${e} button { + background: transparent; + padding: 0; + } + + ${e} fieldset { + margin: 0; + padding: 0; + } + + ${e} :where(ol, ul) { + margin: 0; + padding: 0; + } + + ${e} textarea { + resize: vertical; + } + + ${e} :where(button, [role="button"]) { + cursor: pointer; + } + + ${e} button::-moz-focus-inner { + border: 0 !important; + } + + ${e} table { + border-collapse: collapse; + } + + ${e} :where(h1, h2, h3, h4, h5, h6) { + font-size: inherit; + font-weight: inherit; + } + + ${e} :where(button, input, optgroup, select, textarea) { + padding: 0; + line-height: inherit; + color: inherit; + } + + ${e} :where(img, svg, video, canvas, audio, iframe, embed, object) { + display: block; + } + + ${e} :where(img, video) { + max-width: 100%; + height: auto; + } + + [data-js-focus-visible] + :focus:not([data-focus-visible-added]):not( + [data-focus-visible-disabled] + ) { + outline: none; + box-shadow: none; + } + + ${e} select::-ms-expand { + display: none; + } + + ${ob} + `});function d5(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=x.useMemo(()=>UP(n),[n]);return O.jsxs(QO,{theme:i,children:[O.jsx(f5,{root:t}),r]})}function f5({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return O.jsx(Fu,{styles:n=>({[t]:n.__cssVars})})}Qt({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function nB(e){return Qt({name:`${e}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${e} />" `})}function h5(){const{colorMode:e}=qh();return O.jsx(Fu,{styles:t=>{const n=b1(t,"styles.global"),r=ln(n,{theme:t,colorMode:e});return r?T1(r)(t):void 0}})}const[p5,m5]=Qt({strict:!1,name:"PortalManagerContext"});function sb(e){const{children:t,zIndex:n}=e;return O.jsx(p5,{value:{zIndex:n},children:t})}sb.displayName="PortalManager";const ab=x.createContext({getDocument(){return document},getWindow(){return window}});ab.displayName="EnvironmentContext";function lb(e){const{children:t,environment:n,disabled:r}=e,i=x.useRef(null),o=x.useMemo(()=>n||{getDocument:()=>{var a;return((a=i.current)==null?void 0:a.ownerDocument)??document},getWindow:()=>{var a;return((a=i.current)==null?void 0:a.ownerDocument.defaultView)??window}},[n]),s=!r||!n;return O.jsxs(ab.Provider,{value:o,children:[t,s&&O.jsx("span",{id:"__chakra_env",hidden:!0,ref:i})]})}lb.displayName="EnvironmentProvider";const g5=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetScope:i,resetCSS:o=!0,theme:s={},environment:a,cssVarsRoot:l,disableEnvironment:u,disableGlobalStyle:c}=e,d=O.jsx(lb,{environment:a,disabled:u,children:t});return O.jsx(d5,{theme:s,cssVarsRoot:l,children:O.jsxs(rb,{colorModeManager:n,options:s.config,children:[o?O.jsx(c5,{scope:i}):O.jsx(u5,{}),!c&&O.jsx(h5,{}),r?O.jsx(sb,{zIndex:r,children:d}):d]})})};function y5(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function Bu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Zd=e=>Array.isArray(e);function ub(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Xh(e,t,n,r){if(typeof t=="function"){const[i,o]=Rg(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=Rg(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function Vu(e,t,n){const r=e.getProps();return Xh(r,t,n!==void 0?n:r.custom,e)}const Yh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Qh=["initial",...Yh],Qs=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jr=new Set(Qs),$n=e=>e*1e3,Rn=e=>e/1e3,v5={type:"spring",stiffness:500,damping:25,restSpeed:10},b5=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),S5={type:"keyframes",duration:.8},x5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},w5=(e,{keyframes:t})=>t.length>2?S5:Jr.has(e)?e.startsWith("scale")?b5(t[1]):v5:x5;function Zh(e,t){return e?e[t]||e.default||e:void 0}const k5={skipAnimations:!1,useManualTiming:!1},C5=e=>e!==null;function Uu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(C5),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const St=e=>e;let Jd=St;function T5(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(u){o.has(u)&&(l.schedule(u),e()),u(s)}const l={schedule:(u,c=!1,d=!1)=>{const p=d&&r?t:n;return c&&o.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),o.delete(u)},process:u=>{if(s=u,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,i&&(i=!1,l.process(u))}};return l}const _a=["read","resolveKeyframes","update","preRender","render","postRender"],P5=40;function cb(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=_a.reduce((m,h)=>(m[h]=T5(o),m),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=s,p=()=>{const m=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(m-i.timestamp,P5),1),i.timestamp=m,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},v=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:_a.reduce((m,h)=>{const g=s[h];return m[h]=(k,T=!1,$=!1)=>(n||v(),g.schedule(k,T,$)),m},{}),cancel:m=>{for(let h=0;h<_a.length;h++)s[_a[h]].cancel(m)},state:i,steps:s}}const{schedule:he,cancel:fr,state:Fe,steps:Bc}=cb(typeof requestAnimationFrame<"u"?requestAnimationFrame:St,!0),db=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,E5=1e-7,_5=12;function $5(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=db(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>E5&&++a<_5);return s}function Zs(e,t,n,r){if(e===t&&n===r)return St;const i=o=>$5(o,0,1,e,n);return o=>o===0||o===1?o:db(i(o),t,r)}const fb=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,hb=e=>t=>1-e(1-t),pb=Zs(.33,1.53,.69,.99),Jh=hb(pb),mb=fb(Jh),gb=e=>(e*=2)<1?.5*Jh(e):.5*(2-Math.pow(2,-10*(e-1))),ep=e=>1-Math.sin(Math.acos(e)),yb=hb(ep),vb=fb(ep),bb=e=>/^0[^.\s]+$/u.test(e);function R5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||bb(e):!0}const Sb=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),xb=e=>t=>typeof t=="string"&&t.startsWith(e),wb=xb("--"),A5=xb("var(--"),tp=e=>A5(e)?O5.test(e.split("/*")[0].trim()):!1,O5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,L5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function M5(e){const t=L5.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function kb(e,t,n=1){const[r,i]=M5(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return Sb(s)?parseFloat(s):s}return tp(i)?kb(i,t,n+1):i}const Mn=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},ks={...co,transform:e=>Mn(0,1,e)},$a={...co,default:1},Js=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Kn=Js("deg"),hn=Js("%"),W=Js("px"),D5=Js("vh"),z5=Js("vw"),Ag={...hn,parse:e=>hn.parse(e)/100,transform:e=>hn.transform(e*100)},I5=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Og=e=>e===co||e===W,Lg=(e,t)=>parseFloat(e.split(", ")[t]),Mg=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Lg(i[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?Lg(o[1],e):0}},j5=new Set(["x","y","z"]),N5=Qs.filter(e=>!j5.has(e));function F5(e){const t=[];return N5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Yi={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Mg(4,13),y:Mg(5,14)};Yi.translateX=Yi.x;Yi.translateY=Yi.y;const Cb=e=>t=>t.test(e),B5={test:e=>e==="auto",parse:e=>e},Tb=[co,W,hn,Kn,z5,D5,B5],Dg=e=>Tb.find(Cb(e)),Vr=new Set;let ef=!1,tf=!1;function Pb(){if(tf){const e=Array.from(Vr).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=F5(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,s])=>{var a;(a=r.getValue(o))===null||a===void 0||a.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}tf=!1,ef=!1,Vr.forEach(e=>e.complete()),Vr.clear()}function Eb(){Vr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(tf=!0)})}function V5(){Eb(),Pb()}class np{constructor(t,n,r,i,o,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Vr.add(this),ef||(ef=!0,he.read(Eb),he.resolveKeyframes(Pb))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let o=0;oMath.round(e*1e5)/1e5,rp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function U5(e){return e==null}const W5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ip=(e,t)=>n=>!!(typeof n=="string"&&W5.test(n)&&n.startsWith(e)||t&&!U5(n)&&Object.prototype.hasOwnProperty.call(n,t)),_b=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,a]=r.match(rp);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},H5=e=>Mn(0,255,e),Vc={...co,transform:e=>Math.round(H5(e))},Mr={test:ip("rgb","red"),parse:_b("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Vc.transform(e)+", "+Vc.transform(t)+", "+Vc.transform(n)+", "+es(ks.transform(r))+")"};function K5(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const nf={test:ip("#"),parse:K5,transform:Mr.transform},gi={test:ip("hsl","hue"),parse:_b("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+hn.transform(es(t))+", "+hn.transform(es(n))+", "+es(ks.transform(r))+")"},Ge={test:e=>Mr.test(e)||nf.test(e)||gi.test(e),parse:e=>Mr.test(e)?Mr.parse(e):gi.test(e)?gi.parse(e):nf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Mr.transform(e):gi.transform(e)},G5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function q5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(rp))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(G5))===null||n===void 0?void 0:n.length)||0)>0}const $b="number",Rb="color",X5="var",Y5="var(",zg="${}",Q5=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Cs(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(Q5,l=>(Ge.test(l)?(r.color.push(o),i.push(Rb),n.push(Ge.parse(l))):l.startsWith(Y5)?(r.var.push(o),i.push(X5),n.push(l)):(r.number.push(o),i.push($b),n.push(parseFloat(l))),++o,zg)).split(zg);return{values:n,split:a,indexes:r,types:i}}function Ab(e){return Cs(e).values}function Ob(e){const{split:t,types:n}=Cs(e),r=t.length;return i=>{let o="";for(let s=0;stypeof e=="number"?0:e;function J5(e){const t=Ab(e);return Ob(e)(t.map(Z5))}const hr={test:q5,parse:Ab,createTransformer:Ob,getAnimatableNone:J5},eL=new Set(["brightness","contrast","saturate","opacity"]);function tL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(rp)||[];if(!r)return e;const i=n.replace(r,"");let o=eL.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const nL=/\b([a-z-]*)\(.*?\)/gu,rf={...hr,getAnimatableNone:e=>{const t=e.match(nL);return t?t.map(tL).join(" "):e}},rL={borderWidth:W,borderTopWidth:W,borderRightWidth:W,borderBottomWidth:W,borderLeftWidth:W,borderRadius:W,radius:W,borderTopLeftRadius:W,borderTopRightRadius:W,borderBottomRightRadius:W,borderBottomLeftRadius:W,width:W,maxWidth:W,height:W,maxHeight:W,top:W,right:W,bottom:W,left:W,padding:W,paddingTop:W,paddingRight:W,paddingBottom:W,paddingLeft:W,margin:W,marginTop:W,marginRight:W,marginBottom:W,marginLeft:W,backgroundPositionX:W,backgroundPositionY:W},iL={rotate:Kn,rotateX:Kn,rotateY:Kn,rotateZ:Kn,scale:$a,scaleX:$a,scaleY:$a,scaleZ:$a,skew:Kn,skewX:Kn,skewY:Kn,distance:W,translateX:W,translateY:W,translateZ:W,x:W,y:W,z:W,perspective:W,transformPerspective:W,opacity:ks,originX:Ag,originY:Ag,originZ:W},Ig={...co,transform:Math.round},op={...rL,...iL,zIndex:Ig,size:W,fillOpacity:ks,strokeOpacity:ks,numOctaves:Ig},oL={...op,color:Ge,backgroundColor:Ge,outlineColor:Ge,fill:Ge,stroke:Ge,borderColor:Ge,borderTopColor:Ge,borderRightColor:Ge,borderBottomColor:Ge,borderLeftColor:Ge,filter:rf,WebkitFilter:rf},sp=e=>oL[e];function Lb(e,t){let n=sp(e);return n!==rf&&(n=hr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const sL=new Set(["auto","none","0"]);function aL(e,t,n){let r=0,i;for(;r{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function ap(e){return typeof e=="function"}let fl;function lL(){fl=void 0}const pn={now:()=>(fl===void 0&&pn.set(Fe.isProcessing||k5.useManualTiming?Fe.timestamp:performance.now()),fl),set:e=>{fl=e,queueMicrotask(lL)}},jg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hr.test(e)||e==="0")&&!e.startsWith("url("));function uL(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ndL?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&V5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=pn.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:o,delay:s,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!cL(t,r,i,o))if(s)this.options.duration=0;else{l==null||l(Uu(t,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Qi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},zb=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o{const c=u*s,d=c*e,f=c-n,p=of(u,s),v=Math.exp(-d);return Uc-f/p*v},o=u=>{const d=u*s*e,f=d*n+n,p=Math.pow(s,2)*Math.pow(u,2)*e,v=Math.exp(-d),y=of(Math.pow(u,2),s);return(-i(u)+Uc>0?-1:1)*((f-p)*v)/y}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Uc+c*d},o=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const a=5/e,l=mL(i,o,a);if(e=$n(e),isNaN(l))return{stiffness:ke.stiffness,damping:ke.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}const pL=12;function mL(e,t,n){let r=n;for(let i=1;i=sf?1/0:t}const gL=["duration","bounce"],yL=["stiffness","damping","mass"];function Ng(e,t){return t.some(n=>e[n]!==void 0)}function vL(e){let t={velocity:ke.velocity,stiffness:ke.stiffness,damping:ke.damping,mass:ke.mass,isResolvedFromDuration:!1,...e};if(!Ng(e,yL)&&Ng(e,gL))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*Mn(.05,1,1-e.bounce)*Math.sqrt(i);t={...t,mass:ke.mass,stiffness:i,damping:o}}else{const n=hL(e);t={...t,...n,mass:ke.mass},t.isResolvedFromDuration=!0}return t}function Fb(e=ke.visualDuration,t=ke.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:p}=vL({...n,velocity:-Rn(n.velocity||0)}),v=f||0,y=u/(2*Math.sqrt(l*c)),S=s-o,m=Rn(Math.sqrt(l/c)),h=Math.abs(S)<5;r||(r=h?ke.restSpeed.granular:ke.restSpeed.default),i||(i=h?ke.restDelta.granular:ke.restDelta.default);let g;if(y<1){const T=of(m,y);g=$=>{const _=Math.exp(-y*m*$);return s-_*((v+y*m*S)/T*Math.sin(T*$)+S*Math.cos(T*$))}}else if(y===1)g=T=>s-Math.exp(-m*T)*(S+(v+m*S)*T);else{const T=m*Math.sqrt(y*y-1);g=$=>{const _=Math.exp(-y*m*$),R=Math.min(T*$,300);return s-_*((v+y*m*S)*Math.sinh(R)+T*S*Math.cosh(R))/T}}const k={calculatedDuration:p&&d||null,next:T=>{const $=g(T);if(p)a.done=T>=d;else{let _=0;y<1&&(_=T===0?$n(v):jb(g,T,$));const R=Math.abs(_)<=r,F=Math.abs(s-$)<=i;a.done=R&&F}return a.value=a.done?s:$,a},toString:()=>{const T=Math.min(Nb(k),sf),$=zb(_=>k.next(T*_).value,T,30);return T+"ms "+$}};return k}function Fg({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},p=R=>a!==void 0&&Rl,v=R=>a===void 0?l:l===void 0||Math.abs(a-R)-y*Math.exp(-R/r),g=R=>m+h(R),k=R=>{const F=h(R),j=g(R);f.done=Math.abs(F)<=u,f.value=f.done?m:j};let T,$;const _=R=>{p(f.value)&&(T=R,$=Fb({keyframes:[f.value,v(f.value)],velocity:jb(g,R,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return _(0),{calculatedDuration:null,next:R=>{let F=!1;return!$&&T===void 0&&(F=!0,k(R),_(R)),T!==void 0&&R>=T?$.next(R-T):(!F&&k(R),f)}}}const bL=Zs(.42,0,1,1),SL=Zs(0,0,.58,1),Bb=Zs(.42,0,.58,1),xL=e=>Array.isArray(e)&&typeof e[0]!="number",lp=e=>Array.isArray(e)&&typeof e[0]=="number",Bg={linear:St,easeIn:bL,easeInOut:Bb,easeOut:SL,circIn:ep,circInOut:vb,circOut:yb,backIn:Jh,backInOut:mb,backOut:pb,anticipate:gb},Vg=e=>{if(lp(e)){Jd(e.length===4);const[t,n,r,i]=e;return Zs(t,n,r,i)}else if(typeof e=="string")return Jd(Bg[e]!==void 0),Bg[e];return e},wL=(e,t)=>n=>t(e(n)),ea=(...e)=>e.reduce(wL),ve=(e,t,n)=>e+(t-e)*n;function Wc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function kL({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Wc(l,a,e+1/3),o=Wc(l,a,e),s=Wc(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function Ll(e,t){return n=>n>0?t:e}const Hc=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},CL=[nf,Mr,gi],TL=e=>CL.find(t=>t.test(e));function Ug(e){const t=TL(e);if(!t)return!1;let n=t.parse(e);return t===gi&&(n=kL(n)),n}const Wg=(e,t)=>{const n=Ug(e),r=Ug(t);if(!n||!r)return Ll(e,t);const i={...n};return o=>(i.red=Hc(n.red,r.red,o),i.green=Hc(n.green,r.green,o),i.blue=Hc(n.blue,r.blue,o),i.alpha=ve(n.alpha,r.alpha,o),Mr.transform(i))},af=new Set(["none","hidden"]);function PL(e,t){return af.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function EL(e,t){return n=>ve(e,t,n)}function up(e){return typeof e=="number"?EL:typeof e=="string"?tp(e)?Ll:Ge.test(e)?Wg:RL:Array.isArray(e)?Vb:typeof e=="object"?Ge.test(e)?Wg:_L:Ll}function Vb(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>up(o)(o,t[s]));return o=>{for(let s=0;s{for(const o in r)n[o]=r[o](i);return n}}function $L(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let o=0;o{const n=hr.createTransformer(t),r=Cs(e),i=Cs(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?af.has(e)&&!i.values.length||af.has(t)&&!r.values.length?PL(e,t):ea(Vb($L(r,i),i.values),n):Ll(e,t)};function Ub(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ve(e,t,n):up(e)(e,t)}function AL(e,t,n){const r=[],i=n||Ub,o=e.length-1;for(let s=0;st[0];if(o===2&&e[0]===e[1])return()=>t[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=AL(t,r,i),a=s.length,l=u=>{let c=0;if(a>1)for(;cl(Mn(e[0],e[o-1],u)):l}function LL(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Qi(0,t,r);e.push(ve(n,1,i))}}function ML(e){const t=[0];return LL(t,e.length-1),t}function DL(e,t){return e.map(n=>n*t)}function zL(e,t){return e.map(()=>t||Bb).splice(0,e.length-1)}function Ml({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=xL(r)?r.map(Vg):Vg(r),o={done:!1,value:t[0]},s=DL(n&&n.length===t.length?n:ML(t),e),a=OL(s,t,{ease:Array.isArray(i)?i:zL(t,i)});return{calculatedDuration:e,next:l=>(o.value=a(l),o.done=l>=e,o)}}const IL=e=>{const t=({timestamp:n})=>e(n);return{start:()=>he.update(t,!0),stop:()=>fr(t),now:()=>Fe.isProcessing?Fe.timestamp:pn.now()}},jL={decay:Fg,inertia:Fg,tween:Ml,keyframes:Ml,spring:Fb},NL=e=>e/100;class cp extends Db{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:o}=this.options,s=(i==null?void 0:i.KeyframeResolver)||np,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(o,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=this.options,a=ap(n)?n:jL[n]||Ml;let l,u;a!==Ml&&typeof t[0]!="number"&&(l=ea(NL,Ub(t[0],t[1])),t=[0,100]);const c=a({...this.options,keyframes:t});o==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Nb(c));const{calculatedDuration:d}=c,f=d+i,p=f*(r+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:s,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=r;if(this.startTime===null)return o.next(0);const{delay:f,repeat:p,repeatType:v,repeatDelay:y,onUpdate:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const m=this.currentTime-f*(this.speed>=0?1:-1),h=this.speed>=0?m<0:m>c;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let g=this.currentTime,k=o;if(p){const R=Math.min(this.currentTime,c)/d;let F=Math.floor(R),j=R%1;!j&&R>=1&&(j=1),j===1&&F--,F=Math.min(F,p+1),!!(F%2)&&(v==="reverse"?(j=1-j,y&&(j-=y/d)):v==="mirror"&&(k=s)),g=Mn(0,1,j)*d}const T=h?{done:!1,value:l[0]}:k.next(g);a&&(T.value=a(T.value));let{done:$}=T;!h&&u!==null&&($=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return _&&i!==void 0&&(T.value=Uu(l,this.options,i)),S&&S(T.value),_&&this.finish(),T}get duration(){const{resolved:t}=this;return t?Rn(t.calculatedDuration):0}get time(){return Rn(this.currentTime)}set time(t){t=$n(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Rn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=IL,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const FL=new Set(["opacity","clipPath","filter","transform"]);function dp(e){let t;return()=>(t===void 0&&(t=e()),t)}const BL={linearEasing:void 0};function VL(e,t){const n=dp(e);return()=>{var r;return(r=BL[t])!==null&&r!==void 0?r:n()}}const Dl=VL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function Wb(e){return!!(typeof e=="function"&&Dl()||!e||typeof e=="string"&&(e in lf||Dl())||lp(e)||Array.isArray(e)&&e.every(Wb))}const Bo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,lf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Bo([0,.65,.55,1]),circOut:Bo([.55,0,1,.45]),backIn:Bo([.31,.01,.66,-.59]),backOut:Bo([.33,1.53,.69,.99])};function Hb(e,t){if(e)return typeof e=="function"&&Dl()?zb(e,t):lp(e)?Bo(e):Array.isArray(e)?e.map(n=>Hb(n,t)||lf.easeOut):lf[e]}function UL(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=Hb(a,i);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}function Hg(e,t){e.timeline=t,e.onfinish=null}const WL=dp(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),zl=10,HL=2e4;function KL(e){return ap(e.type)||e.type==="spring"||!Wb(e.ease)}function GL(e,t){const n=new cp({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let o=0;for(;!r.done&&othis.onKeyframesResolved(s,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:i=300,times:o,ease:s,type:a,motionValue:l,name:u,startTime:c}=this.options;if(!(!((r=l.owner)===null||r===void 0)&&r.current))return!1;if(typeof s=="string"&&Dl()&&qL(s)&&(s=Kb[s]),KL(this.options)){const{onComplete:f,onUpdate:p,motionValue:v,element:y,...S}=this.options,m=GL(t,S);t=m.keyframes,t.length===1&&(t[1]=t[0]),i=m.duration,o=m.times,s=m.ease,a="keyframes"}const d=UL(l.owner.current,u,t,{...this.options,duration:i,times:o,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(Hg(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Uu(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:o,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Rn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Rn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=$n(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return St;const{animation:r}=n;Hg(r,t)}return St}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:o,ease:s,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:d,element:f,...p}=this.options,v=new cp({...p,keyframes:r,duration:i,type:o,ease:s,times:a,isGenerator:!0}),y=$n(this.time);u.setWithVelocity(v.sample(y-zl).value,v.sample(y).value,zl)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:o,damping:s,type:a}=t;return WL()&&r&&FL.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&o!=="mirror"&&s!==0&&a!=="inertia"}}const XL=dp(()=>window.ScrollTimeline!==void 0);class YL{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;rXL()&&i.attachTimeline?i.attachTimeline(t):n(i));return()=>{r.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function QL({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const fp=(e,t,n,r={},i,o)=>s=>{const a=Zh(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-$n(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};QL(a)||(c={...c,...w5(e,c)}),c.duration&&(c.duration=$n(c.duration)),c.repeatDelay&&(c.repeatDelay=$n(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),d&&!o&&t.get()!==void 0){const f=Uu(c.keyframes,a);if(f!==void 0)return he.update(()=>{c.onUpdate(f),c.onComplete()}),new YL([])}return!o&&Kg.supports(c)?new Kg(c):new cp(c)},ZL=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),JL=e=>Zd(e)?e[e.length-1]||0:e;function hp(e,t){e.indexOf(t)===-1&&e.push(t)}function pp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class mp{constructor(){this.subscriptions=[]}add(t){return hp(this.subscriptions,t),()=>pp(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class tM{constructor(t,n={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const o=pn.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=pn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=eM(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new mp);const r=this.events[t].add(n);return t==="change"?()=>{r(),he.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=pn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Gg)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Gg);return Ib(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ts(e,t){return new tM(e,t)}function nM(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ts(n))}function rM(e,t){const n=Vu(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=JL(o[s]);nM(e,s,a)}}const gp=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),iM="framerAppearId",Gb="data-"+gp(iM);function qb(e){return e.props[Gb]}const Xe=e=>!!(e&&e.getVelocity);function oM(e){return!!(Xe(e)&&e.add)}function uf(e,t){const n=e.getValue("willChange");if(oM(n))return n.add(t)}function sM({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Xb(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in l){const f=e.getValue(d,(o=e.latestValues[d])!==null&&o!==void 0?o:null),p=l[d];if(p===void 0||c&&sM(c,d))continue;const v={delay:n,...Zh(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const m=qb(e);if(m){const h=window.MotionHandoffAnimation(m,d,he);h!==null&&(v.startTime=h,y=!0)}}uf(e,d),f.start(fp(d,f,p,e.shouldReduceMotion&&Jr.has(d)?{type:!1}:v,e,y));const S=f.animation;S&&u.push(S)}return a&&Promise.all(u).then(()=>{he.update(()=>{a&&rM(e,a)})}),u}function cf(e,t,n={}){var r;const i=Vu(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(Xb(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=o;return aM(e,t,c+u,d,f,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,c]=l==="beforeChildren"?[s,a]:[a,s];return u().then(()=>c())}else return Promise.all([s(),a(n.delay)])}function aM(e,t,n=0,r=0,i=1,o){const s=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(lM).forEach((u,c)=>{u.notify("AnimationStart",t),s.push(cf(u,t,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function lM(e,t){return e.sortNodePosition(t)}function uM(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>cf(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=cf(e,t,n);else{const i=typeof t=="function"?Vu(e,t,n.custom):t;r=Promise.all(Xb(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const cM=Qh.length;function Yb(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Yb(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>uM(e,n,r)))}function pM(e){let t=hM(e),n=qg(),r=!0;const i=l=>(u,c)=>{var d;const f=Vu(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:v,...y}=f;u={...u,...y,...v}}return u};function o(l){t=l(e)}function s(l){const{props:u}=e,c=Yb(e.parent)||{},d=[],f=new Set;let p={},v=1/0;for(let S=0;Sv&&k,F=!1;const j=Array.isArray(g)?g:[g];let H=j.reduce(i(m),{});T===!1&&(H={});const{prevResolvedValues:ue={}}=h,Ze={...ue,...H},Ae=L=>{R=!0,f.has(L)&&(F=!0,f.delete(L)),h.needsAnimating[L]=!0;const A=e.getValue(L);A&&(A.liveStyle=!1)};for(const L in Ze){const A=H[L],I=ue[L];if(p.hasOwnProperty(L))continue;let z=!1;Zd(A)&&Zd(I)?z=!ub(A,I):z=A!==I,z?A!=null?Ae(L):f.add(L):A!==void 0&&f.has(L)?Ae(L):h.protectedKeys[L]=!0}h.prevProp=g,h.prevResolvedValues=H,h.isActive&&(p={...p,...H}),r&&e.blockInitialAnimation&&(R=!1),R&&(!($&&_)||F)&&d.push(...j.map(L=>({animation:L,options:{type:m}})))}if(f.size){const S={};f.forEach(m=>{const h=e.getBaseTarget(m),g=e.getValue(m);g&&(g.liveStyle=!0),S[m]=h??null}),d.push({animation:S})}let y=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(d):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=s(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=qg(),r=!0}}}function mM(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ub(t,e):!1}function Tr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qg(){return{animate:Tr(!0),whileInView:Tr(),whileHover:Tr(),whileTap:Tr(),whileDrag:Tr(),whileFocus:Tr(),exit:Tr()}}class gr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class gM extends gr{constructor(t){super(t),t.animationState||(t.animationState=pM(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let yM=0;class vM extends gr{constructor(){super(...arguments),this.id=yM++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const bM={animation:{Feature:gM},exit:{Feature:vM}},Bt={x:!1,y:!1};function Qb(){return Bt.x||Bt.y}function SM(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const o=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function Zb(e,t){const n=SM(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Xg(e){return t=>{t.pointerType==="touch"||Qb()||e(t)}}function xM(e,t,n={}){const[r,i,o]=Zb(e,n),s=Xg(a=>{const{target:l}=a,u=t(a);if(!u||!l)return;const c=Xg(d=>{u(d),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,i)});return r.forEach(a=>{a.addEventListener("pointerenter",s,i)}),o}const yp=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Vo=new WeakSet;function Yg(e){return t=>{t.key==="Enter"&&e(t)}}function Kc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const wM=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Yg(()=>{if(Vo.has(n))return;Kc(n,"down");const i=Yg(()=>{Kc(n,"up")}),o=()=>Kc(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)},kM=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function CM(e){return kM.has(e.tagName)||e.tabIndex!==-1}const Jb=(e,t)=>t?e===t?!0:Jb(e,t.parentElement):!1;function Qg(e){return yp(e)&&!Qb()}function TM(e,t,n={}){const[r,i,o]=Zb(e,n),s=a=>{const l=a.currentTarget;if(!Qg(a)||Vo.has(l))return;Vo.add(l);const u=t(a),c=(p,v)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!Qg(p)||!Vo.has(l))&&(Vo.delete(l),u&&u(p,{success:v}))},d=p=>{c(p,n.useGlobalTarget||Jb(l,p.target))},f=p=>{c(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{CM(a)||(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,i),a.addEventListener("focus",u=>wM(u,i),i)}),o}function PM(e){return e==="x"||e==="y"?Bt[e]?null:(Bt[e]=!0,()=>{Bt[e]=!1}):Bt.x||Bt.y?null:(Bt.x=Bt.y=!0,()=>{Bt.x=Bt.y=!1})}function ta(e){return{point:{x:e.pageX,y:e.pageY}}}const EM=e=>t=>yp(t)&&e(t,ta(t));function Ps(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ts(e,t,n,r){return Ps(e,t,EM(n),r)}const Zg=(e,t)=>Math.abs(e-t);function _M(e,t){const n=Zg(e.x,t.x),r=Zg(e.y,t.y);return Math.sqrt(n**2+r**2)}class eS{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=qc(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=_M(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:v}=d,{timestamp:y}=Fe;this.history.push({...v,timestamp:y});const{onStart:S,onMove:m}=this.handlers;f||(S&&S(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Gc(f,this.transformPagePoint),he.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:v,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=qc(d.type==="pointercancel"?this.lastMoveEventInfo:Gc(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,S),v&&v(d,S)},!yp(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=ta(t),a=Gc(s,this.transformPagePoint),{point:l}=a,{timestamp:u}=Fe;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(t,qc(a,this.history)),this.removeListeners=ea(ts(this.contextWindow,"pointermove",this.handlePointerMove),ts(this.contextWindow,"pointerup",this.handlePointerUp),ts(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),fr(this.updatePoint)}}function Gc(e,t){return t?{point:t(e.point)}:e}function Jg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function qc({point:e},t){return{point:e,delta:Jg(e,tS(t)),offset:Jg(e,$M(t)),velocity:RM(t,.1)}}function $M(e){return e[0]}function tS(e){return e[e.length-1]}function RM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=tS(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>$n(t)));)n--;if(!r)return{x:0,y:0};const o=Rn(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function yi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const nS=1e-4,AM=1-nS,OM=1+nS,rS=.01,LM=0-rS,MM=0+rS;function wt(e){return e.max-e.min}function DM(e,t,n){return Math.abs(e-t)<=n}function ey(e,t,n,r=.5){e.origin=r,e.originPoint=ve(t.min,t.max,e.origin),e.scale=wt(n)/wt(t),e.translate=ve(n.min,n.max,e.origin)-e.originPoint,(e.scale>=AM&&e.scale<=OM||isNaN(e.scale))&&(e.scale=1),(e.translate>=LM&&e.translate<=MM||isNaN(e.translate))&&(e.translate=0)}function ns(e,t,n,r){ey(e.x,t.x,n.x,r?r.originX:void 0),ey(e.y,t.y,n.y,r?r.originY:void 0)}function ty(e,t,n){e.min=n.min+t.min,e.max=e.min+wt(t)}function zM(e,t,n){ty(e.x,t.x,n.x),ty(e.y,t.y,n.y)}function ny(e,t,n){e.min=t.min-n.min,e.max=e.min+wt(t)}function rs(e,t,n){ny(e.x,t.x,n.x),ny(e.y,t.y,n.y)}function IM(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?ve(n,e,r.max):Math.min(e,n)),e}function ry(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function jM(e,{top:t,left:n,bottom:r,right:i}){return{x:ry(e.x,n,i),y:ry(e.y,t,r)}}function iy(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Qi(t.min,t.max-r,e.min):r>i&&(n=Qi(e.min,e.max-i,t.min)),Mn(0,1,n)}function BM(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const df=.35;function VM(e=df){return e===!1?e=0:e===!0&&(e=df),{x:oy(e,"left","right"),y:oy(e,"top","bottom")}}function oy(e,t,n){return{min:sy(e,t),max:sy(e,n)}}function sy(e,t){return typeof e=="number"?e:e[t]||0}const ay=()=>({translate:0,scale:1,origin:0,originPoint:0}),vi=()=>({x:ay(),y:ay()}),ly=()=>({min:0,max:0}),Te=()=>({x:ly(),y:ly()});function Rt(e){return[e("x"),e("y")]}function iS({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function UM({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function WM(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Xc(e){return e===void 0||e===1}function ff({scale:e,scaleX:t,scaleY:n}){return!Xc(e)||!Xc(t)||!Xc(n)}function Er(e){return ff(e)||oS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function oS(e){return uy(e.x)||uy(e.y)}function uy(e){return e&&e!=="0%"}function Il(e,t,n){const r=e-n,i=t*r;return n+i}function cy(e,t,n,r,i){return i!==void 0&&(e=Il(e,i,r)),Il(e,n,r)+t}function hf(e,t=0,n=1,r,i){e.min=cy(e.min,t,n,r,i),e.max=cy(e.max,t,n,r,i)}function sS(e,{x:t,y:n}){hf(e.x,t.translate,t.scale,t.originPoint),hf(e.y,n.translate,n.scale,n.originPoint)}const dy=.999999999999,fy=1.0000000000001;function HM(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;ady&&(t.x=1),t.ydy&&(t.y=1)}function bi(e,t){e.min=e.min+t,e.max=e.max+t}function hy(e,t,n,r,i=.5){const o=ve(e.min,e.max,i);hf(e,t,n,o,r)}function Si(e,t){hy(e.x,t.x,t.scaleX,t.scale,t.originX),hy(e.y,t.y,t.scaleY,t.scale,t.originY)}function aS(e,t){return iS(WM(e.getBoundingClientRect(),t))}function KM(e,t,n){const r=aS(e,n),{scroll:i}=t;return i&&(bi(r.x,i.offset.x),bi(r.y,i.offset.y)),r}const lS=({current:e})=>e?e.ownerDocument.defaultView:null,GM=new WeakMap;class qM{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ta(c).point)},o=(c,d)=>{const{drag:f,dragPropagation:p,onDragStart:v}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=PM(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Rt(S=>{let m=this.getAxisMotionValue(S).get()||0;if(hn.test(m)){const{projection:h}=this.visualElement;if(h&&h.layout){const g=h.layout.layoutBox[S];g&&(m=wt(g)*(parseFloat(m)/100))}}this.originPoint[S]=m}),v&&he.postRender(()=>v(c,d)),uf(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},s=(c,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:v,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:S}=d;if(p&&this.currentDirection===null){this.currentDirection=XM(S),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",d.point,S),this.updateAxis("y",d.point,S),this.visualElement.render(),y&&y(c,d)},a=(c,d)=>this.stop(c,d),l=()=>Rt(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new eS(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:lS(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&he.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Ra(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=IM(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&yi(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=jM(i.layoutBox,n):this.constraints=!1,this.elastic=VM(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Rt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=BM(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!yi(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=KM(r,i.root,this.visualElement.getTransformPagePoint());let s=NM(i.layout.layoutBox,o);if(n){const a=n(UM(s));this.hasMutatedConstraints=!!a,a&&(s=iS(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Rt(c=>{if(!Ra(c,n,this.currentDirection))return;let d=l&&l[c]||{};s&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,v={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return uf(this.visualElement,t),r.start(fp(t,r,0,n,this.visualElement,!1))}stopAnimation(){Rt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Rt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Rt(n=>{const{drag:r}=this.getProps();if(!Ra(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-ve(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!yi(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Rt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();i[s]=FM({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Rt(s=>{if(!Ra(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];a.set(ve(l,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;GM.set(this.visualElement,this);const t=this.visualElement.current,n=ts(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();yi(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),he.read(r);const s=Ps(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Rt(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=df,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Ra(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function XM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class YM extends gr{constructor(t){super(t),this.removeGroupControls=St,this.removeListeners=St,this.controls=new qM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||St}unmount(){this.removeGroupControls(),this.removeListeners()}}const py=e=>(t,n)=>{e&&he.postRender(()=>e(t,n))};class QM extends gr{constructor(){super(...arguments),this.removePointerDownListener=St}onPointerDown(t){this.session=new eS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:lS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:py(t),onStart:py(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&he.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=ts(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const na=x.createContext(null);function ZM(){const e=x.useContext(na);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=x.useId();x.useEffect(()=>r(i),[]);const o=x.useCallback(()=>n&&n(i),[i,n]);return!t&&n?[!1,o]:[!0]}function JM(){return eD(x.useContext(na))}function eD(e){return e===null?!0:e.isPresent}const vp=x.createContext({}),uS=x.createContext({}),hl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function my(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Co={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(W.test(e))e=parseFloat(e);else return e;const n=my(e,t.target.x),r=my(e,t.target.y);return`${n}% ${r}%`}},tD={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=hr.parse(e);if(i.length>5)return r;const o=hr.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const u=ve(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),o(i)}},jl={};function nD(e){Object.assign(jl,e)}const{schedule:bp,cancel:rB}=cb(queueMicrotask,!1);class rD extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;nD(iD),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),hl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||he.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),bp.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function cS(e){const[t,n]=ZM(),r=x.useContext(vp);return O.jsx(rD,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(uS),isPresent:t,safeToRemove:n})}const iD={borderRadius:{...Co,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Co,borderTopRightRadius:Co,borderBottomLeftRadius:Co,borderBottomRightRadius:Co,boxShadow:tD},dS=["TopLeft","TopRight","BottomLeft","BottomRight"],oD=dS.length,gy=e=>typeof e=="string"?parseFloat(e):e,yy=e=>typeof e=="number"||W.test(e);function sD(e,t,n,r,i,o){i?(e.opacity=ve(0,n.opacity!==void 0?n.opacity:1,aD(r)),e.opacityExit=ve(t.opacity!==void 0?t.opacity:1,0,lD(r))):o&&(e.opacity=ve(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;srt?1:n(Qi(e,t,r))}function by(e,t){e.min=t.min,e.max=t.max}function _t(e,t){by(e.x,t.x),by(e.y,t.y)}function Sy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function xy(e,t,n,r,i){return e-=t,e=Il(e,1/n,r),i!==void 0&&(e=Il(e,1/i,r)),e}function uD(e,t=0,n=1,r=.5,i,o=e,s=e){if(hn.test(t)&&(t=parseFloat(t),t=ve(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=ve(o.min,o.max,r);e===o&&(a-=t),e.min=xy(e.min,t,n,a,i),e.max=xy(e.max,t,n,a,i)}function wy(e,t,[n,r,i],o,s){uD(e,t[n],t[r],t[i],t.scale,o,s)}const cD=["x","scaleX","originX"],dD=["y","scaleY","originY"];function ky(e,t,n,r){wy(e.x,t,cD,n?n.x:void 0,r?r.x:void 0),wy(e.y,t,dD,n?n.y:void 0,r?r.y:void 0)}function Cy(e){return e.translate===0&&e.scale===1}function hS(e){return Cy(e.x)&&Cy(e.y)}function Ty(e,t){return e.min===t.min&&e.max===t.max}function fD(e,t){return Ty(e.x,t.x)&&Ty(e.y,t.y)}function Py(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function pS(e,t){return Py(e.x,t.x)&&Py(e.y,t.y)}function Ey(e){return wt(e.x)/wt(e.y)}function _y(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class hD{constructor(){this.members=[]}add(t){hp(this.members,t),t.scheduleRender()}remove(t){if(pp(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function pD(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const mD=(e,t)=>e.depth-t.depth;class gD{constructor(){this.children=[],this.isDirty=!1}add(t){hp(this.children,t),this.isDirty=!0}remove(t){pp(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(mD),this.isDirty=!1,this.children.forEach(t)}}function pl(e){const t=Xe(e)?e.get():e;return ZL(t)?t.toValue():t}function yD(e,t){const n=pn.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(fr(r),e(o-t))};return he.read(r,!0),()=>fr(r)}function vD(e){return e instanceof SVGElement&&e.tagName!=="svg"}function bD(e,t,n){const r=Xe(e)?e:Ts(e);return r.start(fp("",r,t,n)),r.animation}const _r={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Uo=typeof window<"u"&&window.MotionDebug!==void 0,Yc=["","X","Y","Z"],SD={visibility:"hidden"},$y=1e3;let xD=0;function Qc(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function mS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=qb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",he,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&mS(r)}function gS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=xD++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Uo&&(_r.totalNodes=_r.resolvedTargetDeltas=_r.recalculatedProjection=0),this.nodes.forEach(CD),this.nodes.forEach($D),this.nodes.forEach(RD),this.nodes.forEach(TD),Uo&&window.MotionDebug.record(_r)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=yD(f,250),hl.hasAnimatedSinceResize&&(hl.hasAnimatedSinceResize=!1,this.nodes.forEach(Ay))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||DD,{onLayoutAnimationStart:S,onLayoutAnimationComplete:m}=c.getProps(),h=!this.targetLayout||!pS(this.targetLayout,v)||p,g=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,g);const k={...Zh(y,"layout"),onPlay:S,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else f||Ay(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,fr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(AD),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&mS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const T=k/1e3;Oy(d.x,s.x,T),Oy(d.y,s.y,T),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(rs(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),LD(this.relativeTarget,this.relativeTargetOrigin,f,T),g&&fD(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=Te()),_t(g,this.relativeTarget)),y&&(this.animationValues=c,sD(c,u,this.latestValues,T,h,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=he.update(()=>{hl.hasAnimatedSinceResize=!0,this.currentAnimation=bD(0,$y,{...s,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($y),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=s;if(!(!a||!l||!u)){if(this!==s&&this.layout&&u&&yS(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Te();const d=wt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=wt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}_t(a,l),Si(a,c),ns(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new hD),this.sharedNodes.get(s).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Qc("z",s,u,this.animationValues);for(let c=0;c{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Ry),this.root.sharedNodes.clear()}}}function wD(e){e.updateLayout()}function kD(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?Rt(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],p=wt(f);f.min=r[d].min,f.max=f.min+p}):yS(o,n.layoutBox,r)&&Rt(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],p=wt(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=vi();ns(a,r,n.layoutBox);const l=vi();s?ns(l,e.applyTransform(i,!0),n.measuredBox):ns(l,r,n.layoutBox);const u=!hS(a);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const v=Te();rs(v,n.layoutBox,f.layoutBox);const y=Te();rs(y,r,p.layoutBox),pS(v,y)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function CD(e){Uo&&_r.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function TD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function PD(e){e.clearSnapshot()}function Ry(e){e.clearMeasurements()}function ED(e){e.isLayoutDirty=!1}function _D(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ay(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function $D(e){e.resolveTargetDelta()}function RD(e){e.calcProjection()}function AD(e){e.resetSkewAndRotation()}function OD(e){e.removeLeadSnapshot()}function Oy(e,t,n){e.translate=ve(t.translate,0,n),e.scale=ve(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ly(e,t,n,r){e.min=ve(t.min,n.min,r),e.max=ve(t.max,n.max,r)}function LD(e,t,n,r){Ly(e.x,t.x,n.x,r),Ly(e.y,t.y,n.y,r)}function MD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const DD={duration:.45,ease:[.4,0,.1,1]},My=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Dy=My("applewebkit/")&&!My("chrome/")?Math.round:St;function zy(e){e.min=Dy(e.min),e.max=Dy(e.max)}function zD(e){zy(e.x),zy(e.y)}function yS(e,t,n){return e==="position"||e==="preserve-aspect"&&!DM(Ey(t),Ey(n),.2)}function ID(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const jD=gS({attachResizeListener:(e,t)=>Ps(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Zc={current:void 0},vS=gS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Zc.current){const e=new jD({});e.mount(window),e.setOptions({layoutScroll:!0}),Zc.current=e}return Zc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ND={pan:{Feature:QM},drag:{Feature:YM,ProjectionNode:vS,MeasureLayout:cS}};function Iy(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&he.postRender(()=>o(t,ta(t)))}class FD extends gr{mount(){const{current:t}=this.node;t&&(this.unmount=xM(t,n=>(Iy(this.node,n,"Start"),r=>Iy(this.node,r,"End"))))}unmount(){}}class BD extends gr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ea(Ps(this.node.current,"focus",()=>this.onFocus()),Ps(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function jy(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&he.postRender(()=>o(t,ta(t)))}class VD extends gr{mount(){const{current:t}=this.node;t&&(this.unmount=TM(t,n=>(jy(this.node,n,"Start"),(r,{success:i})=>jy(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const pf=new WeakMap,Jc=new WeakMap,UD=e=>{const t=pf.get(e.target);t&&t(e)},WD=e=>{e.forEach(UD)};function HD({root:e,...t}){const n=e||document;Jc.has(n)||Jc.set(n,{});const r=Jc.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(WD,{root:e,...t})),r[i]}function KD(e,t,n){const r=HD(t);return pf.set(e,n),r.observe(e),()=>{pf.delete(e),r.unobserve(e)}}const GD={some:0,all:1};class qD extends gr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:GD[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return KD(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(XD(t,n))&&this.startObserver()}unmount(){}}function XD({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const YD={inView:{Feature:qD},tap:{Feature:VD},focus:{Feature:BD},hover:{Feature:FD}},QD={layout:{ProjectionNode:vS,MeasureLayout:cS}},Sp=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Wu=x.createContext({}),xp=typeof window<"u",bS=xp?x.useLayoutEffect:x.useEffect,SS=x.createContext({strict:!1});function ZD(e,t,n,r,i){var o,s;const{visualElement:a}=x.useContext(Wu),l=x.useContext(SS),u=x.useContext(na),c=x.useContext(Sp).reducedMotion,d=x.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,p=x.useContext(uS);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&JD(d.current,n,i,p);const v=x.useRef(!1);x.useInsertionEffect(()=>{f&&v.current&&f.update(n,u)});const y=n[Gb],S=x.useRef(!!y&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,y))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,y)));return bS(()=>{f&&(v.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),bp.render(f.render),S.current&&f.animationState&&f.animationState.animateChanges())}),x.useEffect(()=>{f&&(!S.current&&f.animationState&&f.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)===null||m===void 0||m.call(window,y)}),S.current=!1))}),f}function JD(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:xS(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&yi(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function xS(e){if(e)return e.options.allowProjection!==!1?e.projection:xS(e.parent)}function ez(e,t,n){return x.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):yi(n)&&(n.current=r))},[t])}function Hu(e){return Bu(e.animate)||Qh.some(t=>ws(e[t]))}function wS(e){return!!(Hu(e)||e.variants)}function tz(e,t){if(Hu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ws(n)?n:void 0,animate:ws(r)?r:void 0}}return e.inherit!==!1?t:{}}function nz(e){const{initial:t,animate:n}=tz(e,x.useContext(Wu));return x.useMemo(()=>({initial:t,animate:n}),[Ny(t),Ny(n)])}function Ny(e){return Array.isArray(e)?e.join(" "):e}const Fy={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Zi={};for(const e in Fy)Zi[e]={isEnabled:t=>Fy[e].some(n=>!!t[n])};function rz(e){for(const t in e)Zi[t]={...Zi[t],...e[t]}}const iz=Symbol.for("motionComponentSymbol");function oz({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&rz(e);function o(a,l){let u;const c={...x.useContext(Sp),...a,layoutId:sz(a)},{isStatic:d}=c,f=nz(a),p=r(a,d);if(!d&&xp){az();const v=lz(c);u=v.MeasureLayout,f.visualElement=ZD(i,p,c,t,v.ProjectionNode)}return O.jsxs(Wu.Provider,{value:f,children:[u&&f.visualElement?O.jsx(u,{visualElement:f.visualElement,...c}):null,n(i,a,ez(p,f.visualElement,l),p,d,f.visualElement)]})}const s=x.forwardRef(o);return s[iz]=i,s}function sz({layoutId:e}){const t=x.useContext(vp).id;return t&&e!==void 0?t+"-"+e:e}function az(e,t){x.useContext(SS).strict}function lz(e){const{drag:t,layout:n}=Zi;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const uz=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function wp(e){return typeof e!="string"||e.includes("-")?!1:!!(uz.indexOf(e)>-1||/[A-Z]/u.test(e))}function kS(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const CS=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function TS(e,t,n,r){kS(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(CS.has(i)?i:gp(i),t.attrs[i])}function PS(e,{layout:t,layoutId:n}){return Jr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!jl[e]||e==="opacity")}function kp(e,t,n){var r;const{style:i}=e,o={};for(const s in i)(Xe(i[s])||t.style&&Xe(t.style[s])||PS(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[s]=i[s]);return o}function ES(e,t,n){const r=kp(e,t,n);for(const i in e)if(Xe(e[i])||Xe(t[i])){const o=Qs.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}function Cp(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}function cz({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const s={latestValues:dz(r,i,o,e),renderState:t()};return n&&(s.mount=a=>n(r,a,s)),s}const _S=e=>(t,n)=>{const r=x.useContext(Wu),i=x.useContext(na),o=()=>cz(e,t,r,i);return n?o():Cp(o)};function dz(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=pl(o[f]);let{initial:s,animate:a}=e;const l=Hu(e),u=wS(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||s===!1;const d=c?a:s;if(d&&typeof d!="boolean"&&!Bu(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p({style:{},transform:{},transformOrigin:{},vars:{}}),$S=()=>({...Tp(),attrs:{}}),RS=(e,t)=>t&&typeof e=="number"?t.transform(e):e,fz={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hz=Qs.length;function pz(e,t,n){let r="",i=!0;for(let o=0;otypeof e=="string"&&e.toLowerCase()==="svg",bz={useVisualState:_S({scrapeMotionValuesFromProps:ES,createRenderState:$S,onMount:(e,t,{renderState:n,latestValues:r})=>{he.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),he.render(()=>{Ep(n,r,_p(t.tagName),e.transformTemplate),TS(t,n)})}})},Sz={useVisualState:_S({scrapeMotionValuesFromProps:kp,createRenderState:Tp})};function AS(e,t,n){for(const r in t)!Xe(t[r])&&!PS(r,n)&&(e[r]=t[r])}function xz({transformTemplate:e},t){return x.useMemo(()=>{const n=Tp();return Pp(n,t,e),Object.assign({},n.vars,n.style)},[t])}function wz(e,t){const n=e.style||{},r={};return AS(r,n,e),Object.assign(r,xz(e,t)),r}function kz(e,t){const n={},r=wz(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Cz=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Nl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Cz.has(e)}let OS=e=>!Nl(e);function Tz(e){e&&(OS=t=>t.startsWith("on")?!Nl(t):e(t))}try{Tz(require("@emotion/is-prop-valid").default)}catch{}function Pz(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(OS(i)||n===!0&&Nl(i)||!t&&!Nl(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function Ez(e,t,n,r){const i=x.useMemo(()=>{const o=$S();return Ep(o,t,_p(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};AS(o,e.style,e),i.style={...o,...i.style}}return i}function _z(e=!1){return(n,r,i,{latestValues:o},s)=>{const l=(wp(n)?Ez:kz)(r,o,s,n),u=Pz(r,typeof n=="string",e),c=n!==x.Fragment?{...u,...l,ref:i}:{},{children:d}=r,f=x.useMemo(()=>Xe(d)?d.get():d,[d]);return x.createElement(n,{...c,children:f})}}function $z(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...wp(r)?bz:Sz,preloadedFeatures:e,useRender:_z(i),createVisualElement:t,Component:r};return oz(s)}}const mf={current:null},LS={current:!1};function Rz(){if(LS.current=!0,!!xp)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>mf.current=e.matches;e.addListener(t),t()}else mf.current=!1}function Az(e,t,n){for(const r in t){const i=t[r],o=n[r];if(Xe(i))e.addValue(r,i);else if(Xe(o))e.addValue(r,Ts(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Ts(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Vy=new WeakMap,Oz=[...Tb,Ge,hr],Lz=e=>Oz.find(Cb(e)),Uy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Mz{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=np,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=pn.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),LS.current||Rz(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:mf.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Vy.delete(this.current),this.projection&&this.projection.unmount(),fr(this.notifyUpdate),fr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Jr.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&he.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Zi){const n=Zi[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ts(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Sb(i)||bb(i))?i=parseFloat(i):!Lz(i)&&hr.test(n)&&(i=Lb(t,n)),this.setBaseTarget(t,Xe(i)?i.get():i)),Xe(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=Xh(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Xe(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new mp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class MS extends Mz{constructor(){super(...arguments),this.KeyframeResolver=Mb}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Dz(e){return window.getComputedStyle(e)}class zz extends MS{constructor(){super(...arguments),this.type="html",this.renderInstance=kS}readValueFromInstance(t,n){if(Jr.has(n)){const r=sp(n);return r&&r.default||0}else{const r=Dz(t),i=(wb(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return aS(t,n)}build(t,n,r){Pp(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return kp(t,n,r)}}class Iz extends MS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Jr.has(n)){const r=sp(n);return r&&r.default||0}return n=CS.has(n)?n:gp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ES(t,n,r)}build(t,n,r){Ep(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){TS(t,n,r,i)}mount(t){this.isSVGTag=_p(t.tagName),super.mount(t)}}const jz=(e,t)=>wp(e)?new Iz(t):new zz(t,{allowProjection:e!==x.Fragment}),Nz=$z({...bM,...YD,...ND,...QD},jz),Fz=y5(Nz);class Bz extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Vz({children:e,isPresent:t}){const n=x.useId(),r=x.useRef(null),i=x.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=x.useContext(Sp);return x.useInsertionEffect(()=>{const{width:s,height:a,top:l,left:u}=i.current;if(t||!r.current||!s||!a)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return o&&(c.nonce=o),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` + [data-motion-pop-id="${n}"] { + position: absolute !important; + width: ${s}px !important; + height: ${a}px !important; + top: ${l}px !important; + left: ${u}px !important; + } + `),()=>{document.head.removeChild(c)}},[t]),O.jsx(Bz,{isPresent:t,childRef:r,sizeRef:i,children:x.cloneElement(e,{ref:r})})}const Uz=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const a=Cp(Wz),l=x.useId(),u=x.useCallback(d=>{a.set(d,!0);for(const f of a.values())if(!f)return;r&&r()},[a,r]),c=x.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:u,register:d=>(a.set(d,!1),()=>a.delete(d))}),o?[Math.random(),u]:[n,u]);return x.useMemo(()=>{a.forEach((d,f)=>a.set(f,!1))},[n]),x.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),s==="popLayout"&&(e=O.jsx(Vz,{isPresent:n,children:e})),O.jsx(na.Provider,{value:c,children:e})};function Wz(){return new Map}const Aa=e=>e.key||"";function Wy(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const Hz=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:s="sync"})=>{const a=x.useMemo(()=>Wy(e),[e]),l=a.map(Aa),u=x.useRef(!0),c=x.useRef(a),d=Cp(()=>new Map),[f,p]=x.useState(a),[v,y]=x.useState(a);bS(()=>{u.current=!1,c.current=a;for(let h=0;h{const g=Aa(h),k=a===v||l.includes(g),T=()=>{if(d.has(g))d.set(g,!0);else return;let $=!0;d.forEach(_=>{_||($=!1)}),$&&(m==null||m(),y(c.current),i&&i())};return O.jsx(Uz,{isPresent:k,initial:!u.current||r?void 0:!1,custom:k?void 0:n,presenceAffectsLayout:o,mode:s,onExitComplete:k?void 0:T,children:h},g)})})},Kz=(e,t)=>e.find(n=>n.id===t);function Hy(e,t){const n=DS(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function DS(e,t){for(const[n,r]of Object.entries(e))if(Kz(r,t))return n}function Gz(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function qz(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",s=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:s}}var Xz=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Yz=K1(function(e){return Xz.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Qz=!1,Zz=Yz,Jz=function(t){return t!=="theme"},Ky=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Zz:Jz},Gy=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(s){return t.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},eI=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Wh(n,r,i),tb(function(){return Hh(n,r,i)}),null},tI=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,s;n!==void 0&&(o=n.label,s=n.target);var a=Gy(t,n,r),l=a||Ky(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{var f=c[0];d.push(f[0]);for(var p=c.length,v=1;vt=>{const{theme:n,css:r,__css:i,sx:o,...s}=t,a=vP(n),[l]=LT(s,a),u=ln(e,t),c=ST({},i,u,v1(l),o),d=T1(c)(t.theme);return r?[d,r]:d};function ed(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=oI);const i=aI({baseStyle:n}),o=sI(e,r)(i);return x.forwardRef(function(l,u){const{children:c,...d}=l,{colorMode:f,forced:p}=qh(),v=p?f:void 0;return x.createElement(o,{ref:u,"data-theme":v,...d},c)})}function lI(){const e=new Map;return new Proxy(ed,{apply(t,n,r){return ed(...r)},get(t,n){return e.has(n)||e.set(n,ed(n)),e.get(n)}})}const it=lI(),uI={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},zS=x.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:s="bottom",duration:a=5e3,containerStyle:l,motionVariants:u=uI,toastSpacing:c="0.5rem"}=e,[d,f]=x.useState(a),p=JM();ng(()=>{p||r==null||r()},[p]),ng(()=>{f(a)},[a]);const v=()=>f(null),y=()=>f(a),S=()=>{p&&i()};x.useEffect(()=>{p&&o&&i()},[p,o,i]),IT(S,d);const m=x.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),h=x.useMemo(()=>Gz(s),[s]);return O.jsx(Fz.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:v,onHoverEnd:y,custom:{position:s},style:h,children:O.jsx(it.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:m,children:ln(n,{id:t,onClose:S})})})});zS.displayName="ToastComponent";function Fn(e){return x.forwardRef(e)}var cI=typeof Element<"u",dI=typeof Map=="function",fI=typeof Set=="function",hI=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ml(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ml(e[r],t[r]))return!1;return!0}var o;if(dI&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!ml(r.value[1],t.get(r.value[0])))return!1;return!0}if(fI&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(hI&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(cI&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!ml(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var pI=function(t,n){try{return ml(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const IS=Zr(pI);function mI(){const e=x.useContext(Xi);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function gI(){const e=qh(),t=mI();return{...e,theme:t}}function yI(e,t,n){if(t==null)return t;const r=i=>{var o,s;return(s=(o=e.__cssMap)==null?void 0:o[i])==null?void 0:s.value};return r(t)??r(n)??n}function oB(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const s=i.filter(Boolean),a=r.map((l,u)=>{const c=`${e}.${l}`;return yI(o,c,s[u]??l)});return Array.isArray(t)?a:a[0]}}function jS(e,t={}){const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=gI(),s=e?b1(i,`components.${e}`):void 0,a=n||s,l=un({theme:i,colorMode:o},(a==null?void 0:a.defaultProps)??{},v1(S1(r,["children"]))),u=x.useRef({});if(a){const d=_P(a)(l);IS(u.current,d)||(u.current=d)}return u.current}function $p(e,t={}){return jS(e,t)}function NS(e,t={}){return jS(e,t)}const qy={path:O.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[O.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),O.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),O.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},ra=Fn((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:s,className:a,__css:l,...u}=e,c=Nn("chakra-icon",a),d=$p("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...d},p={ref:t,focusable:o,className:c,__css:f},v=r??qy.viewBox;if(n&&typeof n!="string")return O.jsx(it.svg,{as:n,...p,...u});const y=s??qy.path;return O.jsx(it.svg,{verticalAlign:"middle",viewBox:v,...p,...u,children:y})});ra.displayName="Icon";function vI(e){return O.jsx(ra,{viewBox:"0 0 24 24",...e,children:O.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function bI(e){return O.jsx(ra,{viewBox:"0 0 24 24",...e,children:O.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function Xy(e){return O.jsx(ra,{viewBox:"0 0 24 24",...e,children:O.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}const SI=r5({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),FS=Fn((e,t)=>{const n=$p("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:s="transparent",className:a,...l}=xu(e),u=Nn("chakra-spinner",a),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:s,borderLeftColor:s,animation:`${SI} ${o} linear infinite`,...n};return O.jsx(it.div,{ref:t,__css:c,className:u,...l,children:r&&O.jsx(it.span,{srOnly:!0,children:r})})});FS.displayName="Spinner";const[xI,Rp]=Qt({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[wI,Ap]=Qt({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),BS={info:{icon:bI,colorScheme:"blue"},warning:{icon:Xy,colorScheme:"orange"},success:{icon:vI,colorScheme:"green"},error:{icon:Xy,colorScheme:"red"},loading:{icon:FS,colorScheme:"blue"}};function kI(e){return BS[e].colorScheme}function CI(e){return BS[e].icon}const VS=Fn(function(t,n){const{status:r="info",addRole:i=!0,...o}=xu(t),s=t.colorScheme??kI(r),a=NS("Alert",{...t,colorScheme:s}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...a.container};return O.jsx(xI,{value:{status:r},children:O.jsx(wI,{value:a,children:O.jsx(it.div,{"data-status":r,role:i?"alert":void 0,ref:n,...o,className:Nn("chakra-alert",t.className),__css:l})})})});VS.displayName="Alert";function US(e){const{status:t}=Rp(),n=CI(t),r=Ap(),i=t==="loading"?r.spinner:r.icon;return O.jsx(it.span,{display:"inherit","data-status":t,...e,className:Nn("chakra-alert__icon",e.className),__css:i,children:e.children||O.jsx(n,{h:"100%",w:"100%"})})}US.displayName="AlertIcon";const WS=Fn(function(t,n){const r=Ap(),{status:i}=Rp();return O.jsx(it.div,{ref:n,"data-status":i,...t,className:Nn("chakra-alert__title",t.className),__css:r.title})});WS.displayName="AlertTitle";const HS=Fn(function(t,n){const{status:r}=Rp(),i=Ap(),o={display:"inline",...i.description};return O.jsx(it.div,{ref:n,"data-status":r,...t,className:Nn("chakra-alert__desc",t.className),__css:o})});HS.displayName="AlertDescription";function TI(e){return O.jsx(ra,{focusable:"false","aria-hidden":!0,...e,children:O.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}const KS=Fn(function(t,n){const r=$p("CloseButton",t),{children:i,isDisabled:o,__css:s,...a}=xu(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return O.jsx(it.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...s},...a,children:i||O.jsx(TI,{width:"1em",height:"1em"})})});KS.displayName="CloseButton";const PI=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:s,description:a,colorScheme:l,icon:u}=e,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return O.jsxs(VS,{addRole:!1,status:t,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[O.jsx(US,{children:u}),O.jsxs(it.div,{flex:"1",maxWidth:"100%",children:[i&&O.jsx(WS,{id:c==null?void 0:c.title,children:i}),a&&O.jsx(HS,{id:c==null?void 0:c.description,display:"block",children:a})]}),o&&O.jsx(KS,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1})]})};function EI(e={}){const{render:t,toastComponent:n=PI}=e;return i=>typeof t=="function"?t({...i,...e}):O.jsx(n,{...i,...e})}const _I={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},is=$I(_I);function $I(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(s=>({...s,[o]:s[o].filter(a=>a.id!=i)}))},notify:(i,o)=>{const s=RI(i,o),{position:a,id:l}=s;return r(u=>{const d=a.includes("top")?[s,...u[a]??[]]:[...u[a]??[],s];return{...u,[a]:d}}),l},update:(i,o)=>{i&&r(s=>{const a={...s},{position:l,index:u}=Hy(a,i);return l&&u!==-1&&(a[l][u]={...a[l][u],...o,message:EI(o)}),a})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(c=>({...c,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const s=DS(o,i);return s?{...o,[s]:o[s].map(a=>a.id==i?{...a,requestClose:!0}:a)}:o})},isActive:i=>!!Hy(is.getState(),i).position}}let Yy=0;function RI(e,t={}){Yy+=1;const n=t.id??Yy,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>is.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var GS={exports:{}},Tt={},qS={exports:{}},XS={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t(A,I){var z=A.length;A.push(I);e:for(;0>>1,xe=A[Q];if(0>>1;Qi(mo,z))pti(xr,mo)?(A[Q]=xr,A[pt]=z,Q=pt):(A[Q]=mo,A[Je]=z,Q=Je);else if(pti(xr,z))A[Q]=xr,A[pt]=z,Q=pt;else break e}}return I}function i(A,I){var z=A.sortIndex-I.sortIndex;return z!==0?z:A.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,f=3,p=!1,v=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(A){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=A)r(u),I.sortIndex=I.expirationTime,t(l,I);else break;I=n(u)}}function k(A){if(y=!1,g(A),!v)if(n(l)!==null)v=!0,M(T);else{var I=n(u);I!==null&&L(k,I.startTime-A)}}function T(A,I){v=!1,y&&(y=!1,m(R),R=-1),p=!0;var z=f;try{for(g(I),d=n(l);d!==null&&(!(d.expirationTime>I)||A&&!H());){var Q=d.callback;if(typeof Q=="function"){d.callback=null,f=d.priorityLevel;var xe=Q(d.expirationTime<=I);I=e.unstable_now(),typeof xe=="function"?d.callback=xe:d===n(l)&&r(l),g(I)}else r(l);d=n(l)}if(d!==null)var K=!0;else{var Je=n(u);Je!==null&&L(k,Je.startTime-I),K=!1}return K}finally{d=null,f=z,p=!1}}var $=!1,_=null,R=-1,F=5,j=-1;function H(){return!(e.unstable_now()-jA||125Q?(A.sortIndex=z,t(u,A),n(l)===null&&A===n(u)&&(y?(m(R),R=-1):y=!0,L(k,z-Q))):(A.sortIndex=xe,t(l,A),v||p||(v=!0,M(T))),A},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(A){var I=f;return function(){var z=f;f=I;try{return A.apply(this,arguments)}finally{f=z}}}})(XS);qS.exports=XS;var AI=qS.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var OI=x,kt=AI;function D(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yf=Object.prototype.hasOwnProperty,LI=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Qy={},Zy={};function MI(e){return yf.call(Zy,e)?!0:yf.call(Qy,e)?!1:LI.test(e)?Zy[e]=!0:(Qy[e]=!0,!1)}function DI(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function zI(e,t,n,r){if(t===null||typeof t>"u"||DI(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function st(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ue[e]=new st(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ue[t]=new st(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ue[e]=new st(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ue[e]=new st(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ue[e]=new st(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ue[e]=new st(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ue[e]=new st(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ue[e]=new st(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ue[e]=new st(e,5,!1,e.toLowerCase(),null,!1,!1)});var Op=/[\-:]([a-z])/g;function Lp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Op,Lp);Ue[t]=new st(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Op,Lp);Ue[t]=new st(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Op,Lp);Ue[t]=new st(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ue[e]=new st(e,1,!1,e.toLowerCase(),null,!1,!1)});Ue.xlinkHref=new st("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ue[e]=new st(e,1,!1,e.toLowerCase(),null,!0,!0)});function Mp(e,t,n,r){var i=Ue.hasOwnProperty(t)?Ue[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` +`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{nd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wo(e):""}function II(e){switch(e.tag){case 5:return Wo(e.type);case 16:return Wo("Lazy");case 13:return Wo("Suspense");case 19:return Wo("SuspenseList");case 0:case 2:case 15:return e=rd(e.type,!1),e;case 11:return e=rd(e.type.render,!1),e;case 1:return e=rd(e.type,!0),e;default:return""}}function xf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case wi:return"Fragment";case xi:return"Portal";case vf:return"Profiler";case Dp:return"StrictMode";case bf:return"Suspense";case Sf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ZS:return(e.displayName||"Context")+".Consumer";case QS:return(e._context.displayName||"Context")+".Provider";case zp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ip:return t=e.displayName||null,t!==null?t:xf(e.type)||"Memo";case Xn:t=e._payload,e=e._init;try{return xf(e(t))}catch{}}return null}function jI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xf(t);case 8:return t===Dp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function pr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ex(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function NI(e){var t=ex(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function La(e){e._valueTracker||(e._valueTracker=NI(e))}function tx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ex(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function wf(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function e0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=pr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function nx(e,t){t=t.checked,t!=null&&Mp(e,"checked",t,!1)}function kf(e,t){nx(e,t);var n=pr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Cf(e,t.type,n):t.hasOwnProperty("defaultValue")&&Cf(e,t.type,pr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function t0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Cf(e,t,n){(t!=="number"||Fl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ho=Array.isArray;function ji(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ma.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _s(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var os={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},FI=["Webkit","ms","Moz","O"];Object.keys(os).forEach(function(e){FI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),os[t]=os[e]})});function sx(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||os.hasOwnProperty(e)&&os[e]?(""+t).trim():t+"px"}function ax(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=sx(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var BI=Se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ef(e,t){if(t){if(BI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(D(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(D(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(D(61))}if(t.style!=null&&typeof t.style!="object")throw Error(D(62))}}function _f(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $f=null;function jp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Rf=null,Ni=null,Fi=null;function i0(e){if(e=sa(e)){if(typeof Rf!="function")throw Error(D(280));var t=e.stateNode;t&&(t=Yu(t),Rf(e.stateNode,e.type,t))}}function lx(e){Ni?Fi?Fi.push(e):Fi=[e]:Ni=e}function ux(){if(Ni){var e=Ni,t=Fi;if(Fi=Ni=null,i0(e),t)for(e=0;e>>=0,e===0?32:31-(ZI(e)/JI|0)|0}var Da=64,za=4194304;function Ko(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=Ko(a):(o&=s,o!==0&&(r=Ko(o)))}else s=n&~i,s!==0?r=Ko(s):o!==0&&(r=Ko(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ia(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qt(t),e[t]=n}function r3(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=as),h0=" ",p0=!1;function $x(e,t){switch(e){case"keyup":return A3.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ki=!1;function L3(e,t){switch(e){case"compositionend":return Rx(t);case"keypress":return t.which!==32?null:(p0=!0,h0);case"textInput":return e=t.data,e===h0&&p0?null:e;default:return null}}function M3(e,t){if(ki)return e==="compositionend"||!Kp&&$x(e,t)?(e=Ex(),yl=Up=er=null,ki=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=v0(n)}}function Mx(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mx(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dx(){for(var e=window,t=Fl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fl(e.document)}return t}function Gp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function U3(e){var t=Dx(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Mx(n.ownerDocument.documentElement,n)){if(r!==null&&Gp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=b0(n,o);var s=b0(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ci=null,zf=null,us=null,If=!1;function S0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;If||Ci==null||Ci!==Fl(r)||(r=Ci,"selectionStart"in r&&Gp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),us&&Ms(us,r)||(us=r,r=Gl(zf,"onSelect"),0Ei||(e.current=Uf[Ei],Uf[Ei]=null,Ei--)}function ae(e,t){Ei++,Uf[Ei]=e.current,e.current=t}var mr={},Ye=vr(mr),ct=vr(!1),Kr=mr;function eo(e,t){var n=e.type.contextTypes;if(!n)return mr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function dt(e){return e=e.childContextTypes,e!=null}function Xl(){fe(ct),fe(Ye)}function E0(e,t,n){if(Ye.current!==mr)throw Error(D(168));ae(Ye,t),ae(ct,n)}function Wx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(D(108,jI(e)||"Unknown",i));return Se({},n,r)}function Yl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mr,Kr=Ye.current,ae(Ye,e),ae(ct,ct.current),!0}function _0(e,t,n){var r=e.stateNode;if(!r)throw Error(D(169));n?(e=Wx(e,t,Kr),r.__reactInternalMemoizedMergedChildContext=e,fe(ct),fe(Ye),ae(Ye,e)):fe(ct),ae(ct,n)}var xn=null,Qu=!1,yd=!1;function Hx(e){xn===null?xn=[e]:xn.push(e)}function tj(e){Qu=!0,Hx(e)}function br(){if(!yd&&xn!==null){yd=!0;var e=0,t=ie;try{var n=xn;for(ie=1;e>=s,i-=s,Pn=1<<32-qt(t)+i|n<R?(F=_,_=null):F=_.sibling;var j=f(m,_,g[R],k);if(j===null){_===null&&(_=F);break}e&&_&&j.alternate===null&&t(m,_),h=o(j,h,R),$===null?T=j:$.sibling=j,$=j,_=F}if(R===g.length)return n(m,_),ge&&$r(m,R),T;if(_===null){for(;RR?(F=_,_=null):F=_.sibling;var H=f(m,_,j.value,k);if(H===null){_===null&&(_=F);break}e&&_&&H.alternate===null&&t(m,_),h=o(H,h,R),$===null?T=H:$.sibling=H,$=H,_=F}if(j.done)return n(m,_),ge&&$r(m,R),T;if(_===null){for(;!j.done;R++,j=g.next())j=d(m,j.value,k),j!==null&&(h=o(j,h,R),$===null?T=j:$.sibling=j,$=j);return ge&&$r(m,R),T}for(_=r(m,_);!j.done;R++,j=g.next())j=p(_,m,R,j.value,k),j!==null&&(e&&j.alternate!==null&&_.delete(j.key===null?R:j.key),h=o(j,h,R),$===null?T=j:$.sibling=j,$=j);return e&&_.forEach(function(ue){return t(m,ue)}),ge&&$r(m,R),T}function S(m,h,g,k){if(typeof g=="object"&&g!==null&&g.type===wi&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Oa:e:{for(var T=g.key,$=h;$!==null;){if($.key===T){if(T=g.type,T===wi){if($.tag===7){n(m,$.sibling),h=i($,g.props.children),h.return=m,m=h;break e}}else if($.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Xn&&A0(T)===$.type){n(m,$.sibling),h=i($,g.props),h.ref=Ro(m,$,g),h.return=m,m=h;break e}n(m,$);break}else t(m,$);$=$.sibling}g.type===wi?(h=Wr(g.props.children,m.mode,k,g.key),h.return=m,m=h):(k=Tl(g.type,g.key,g.props,null,m.mode,k),k.ref=Ro(m,h,g),k.return=m,m=k)}return s(m);case xi:e:{for($=g.key;h!==null;){if(h.key===$)if(h.tag===4&&h.stateNode.containerInfo===g.containerInfo&&h.stateNode.implementation===g.implementation){n(m,h.sibling),h=i(h,g.children||[]),h.return=m,m=h;break e}else{n(m,h);break}else t(m,h);h=h.sibling}h=Td(g,m.mode,k),h.return=m,m=h}return s(m);case Xn:return $=g._init,S(m,h,$(g._payload),k)}if(Ho(g))return v(m,h,g,k);if(To(g))return y(m,h,g,k);Ua(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,h!==null&&h.tag===6?(n(m,h.sibling),h=i(h,g),h.return=m,m=h):(n(m,h),h=Cd(g,m.mode,k),h.return=m,m=h),s(m)):n(m,h)}return S}var no=Xx(!0),Yx=Xx(!1),Jl=vr(null),eu=null,Ri=null,Qp=null;function Zp(){Qp=Ri=eu=null}function Jp(e){var t=Jl.current;fe(Jl),e._currentValue=t}function Kf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Vi(e,t){eu=e,Qp=Ri=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ut=!0),e.firstContext=null)}function zt(e){var t=e._currentValue;if(Qp!==e)if(e={context:e,memoizedValue:t,next:null},Ri===null){if(eu===null)throw Error(D(308));Ri=e,eu.dependencies={lanes:0,firstContext:e}}else Ri=Ri.next=e;return t}var zr=null;function em(e){zr===null?zr=[e]:zr.push(e)}function Qx(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,em(t)):(n.next=i.next,i.next=n),t.interleaved=n,In(e,r)}function In(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Yn=!1;function tm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function An(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ar(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Y&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,In(e,n)}return i=r.interleaved,i===null?(t.next=t,em(r)):(t.next=i.next,i.next=t),r.interleaved=t,In(e,n)}function bl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fp(e,n)}}function O0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function tu(e,t,n,r){var i=e.updateQueue;Yn=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;s=0,c=u=l=null,a=o;do{var f=a.lane,p=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,y=a;switch(f=t,p=n,y.tag){case 1:if(v=y.payload,typeof v=="function"){d=v.call(p,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,f=typeof v=="function"?v.call(p,d,f):v,f==null)break e;d=Se({},d,f);break e;case 2:Yn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,s|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Xr|=s,e.lanes=s,e.memoizedState=d}}function L0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=bd.transition;bd.transition={};try{e(!1),t()}finally{ie=n,bd.transition=r}}function mw(){return It().memoizedState}function oj(e,t,n){var r=ur(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gw(e))yw(t,n);else if(n=Qx(e,t,n,r),n!==null){var i=rt();Xt(n,e,r,i),vw(n,t,r)}}function sj(e,t,n){var r=ur(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gw(e))yw(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Yt(a,s)){var l=t.interleaved;l===null?(i.next=i,em(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Qx(e,t,i,r),n!==null&&(i=rt(),Xt(n,e,r,i),vw(n,t,r))}}function gw(e){var t=e.alternate;return e===be||t!==null&&t===be}function yw(e,t){cs=ru=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fp(e,n)}}var iu={readContext:zt,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},aj={readContext:zt,useCallback:function(e,t){return tn().memoizedState=[e,t===void 0?null:t],e},useContext:zt,useEffect:D0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xl(4194308,4,cw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xl(4194308,4,e,t)},useInsertionEffect:function(e,t){return xl(4,2,e,t)},useMemo:function(e,t){var n=tn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=tn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=oj.bind(null,be,e),[r.memoizedState,e]},useRef:function(e){var t=tn();return e={current:e},t.memoizedState=e},useState:M0,useDebugValue:um,useDeferredValue:function(e){return tn().memoizedState=e},useTransition:function(){var e=M0(!1),t=e[0];return e=ij.bind(null,e[1]),tn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=be,i=tn();if(ge){if(n===void 0)throw Error(D(407));n=n()}else{if(n=t(),Ie===null)throw Error(D(349));qr&30||nw(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,D0(iw.bind(null,r,o,e),[e]),r.flags|=2048,Vs(9,rw.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=tn(),t=Ie.identifierPrefix;if(ge){var n=En,r=Pn;n=(r&~(1<<32-qt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Fs++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[sn]=t,e[Is]=r,_w(e,t,!1,!1),t.stateNode=e;e:{switch(s=_f(n,r),n){case"dialog":ce("cancel",e),ce("close",e),i=r;break;case"iframe":case"object":case"embed":ce("load",e),i=r;break;case"video":case"audio":for(i=0;ioo&&(t.flags|=128,r=!0,Ao(o,!1),t.lanes=4194304)}else{if(!r)if(e=nu(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ao(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ge)return He(t),null}else 2*Pe()-o.renderingStartTime>oo&&n!==1073741824&&(t.flags|=128,r=!0,Ao(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Pe(),t.sibling=null,n=ye.current,ae(ye,r?n&1|2:n&1),t):(He(t),null);case 22:case 23:return mm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?gt&1073741824&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(D(156,t.tag))}function mj(e,t){switch(Xp(t),t.tag){case 1:return dt(t.type)&&Xl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ro(),fe(ct),fe(Ye),im(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return rm(t),null;case 13:if(fe(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));to()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(ye),null;case 4:return ro(),null;case 10:return Jp(t.type._context),null;case 22:case 23:return mm(),null;case 24:return null;default:return null}}var Ha=!1,qe=!1,gj=typeof WeakSet=="function"?WeakSet:Set,N=null;function Ai(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ce(e,t,r)}else n.current=null}function th(e,t,n){try{n()}catch(r){Ce(e,t,r)}}var K0=!1;function yj(e,t){if(jf=Hl,e=Dx(),Gp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===i&&(a=s),f===o&&++c===r&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Nf={focusedElem:e,selectionRange:n},Hl=!1,N=t;N!==null;)if(t=N,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,N=e;else for(;N!==null;){t=N;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,S=v.memoizedState,m=t.stateNode,h=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:Vt(t.type,y),S);m.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(k){Ce(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,N=e;break}N=t.return}return v=K0,K0=!1,v}function ds(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&th(t,n,o)}i=i.next}while(i!==r)}}function ec(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function nh(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Aw(e){var t=e.alternate;t!==null&&(e.alternate=null,Aw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[sn],delete t[Is],delete t[Vf],delete t[J3],delete t[ej])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ow(e){return e.tag===5||e.tag===3||e.tag===4}function G0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ow(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ql));else if(r!==4&&(e=e.child,e!==null))for(rh(e,t,n),e=e.sibling;e!==null;)rh(e,t,n),e=e.sibling}function ih(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ih(e,t,n),e=e.sibling;e!==null;)ih(e,t,n),e=e.sibling}var Ne=null,Ut=!1;function Hn(e,t,n){for(n=n.child;n!==null;)Lw(e,t,n),n=n.sibling}function Lw(e,t,n){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(Ku,n)}catch{}switch(n.tag){case 5:qe||Ai(n,t);case 6:var r=Ne,i=Ut;Ne=null,Hn(e,t,n),Ne=r,Ut=i,Ne!==null&&(Ut?(e=Ne,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ne.removeChild(n.stateNode));break;case 18:Ne!==null&&(Ut?(e=Ne,n=n.stateNode,e.nodeType===8?gd(e.parentNode,n):e.nodeType===1&&gd(e,n),Os(e)):gd(Ne,n.stateNode));break;case 4:r=Ne,i=Ut,Ne=n.stateNode.containerInfo,Ut=!0,Hn(e,t,n),Ne=r,Ut=i;break;case 0:case 11:case 14:case 15:if(!qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&th(n,t,s),i=i.next}while(i!==r)}Hn(e,t,n);break;case 1:if(!qe&&(Ai(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ce(n,t,a)}Hn(e,t,n);break;case 21:Hn(e,t,n);break;case 22:n.mode&1?(qe=(r=qe)||n.memoizedState!==null,Hn(e,t,n),qe=r):Hn(e,t,n);break;default:Hn(e,t,n)}}function q0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new gj),t.forEach(function(r){var i=Pj.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ft(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Pe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bj(r/1960))-r,10e?16:e,tr===null)var r=!1;else{if(e=tr,tr=null,au=0,Y&6)throw Error(D(331));var i=Y;for(Y|=4,N=e.current;N!==null;){var o=N,s=o.child;if(N.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lPe()-hm?Ur(e,0):fm|=n),ft(e,t)}function Bw(e,t){t===0&&(e.mode&1?(t=za,za<<=1,!(za&130023424)&&(za=4194304)):t=1);var n=rt();e=In(e,t),e!==null&&(ia(e,t,n),ft(e,n))}function Tj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bw(e,n)}function Pj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(D(314))}r!==null&&r.delete(t),Bw(e,n)}var Vw;Vw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ct.current)ut=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ut=!1,hj(e,t,n);ut=!!(e.flags&131072)}else ut=!1,ge&&t.flags&1048576&&Kx(t,Zl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;wl(e,t),e=t.pendingProps;var i=eo(t,Ye.current);Vi(t,n),i=sm(null,t,r,e,i,n);var o=am();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dt(r)?(o=!0,Yl(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,tm(t),i.updater=Ju,t.stateNode=i,i._reactInternals=t,qf(t,r,e,n),t=Qf(null,t,r,!0,o,n)):(t.tag=0,ge&&o&&qp(t),et(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(wl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=_j(r),e=Vt(r,e),i){case 0:t=Yf(null,t,r,e,n);break e;case 1:t=U0(null,t,r,e,n);break e;case 11:t=B0(null,t,r,e,n);break e;case 14:t=V0(null,t,r,Vt(r.type,e),n);break e}throw Error(D(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),Yf(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),U0(e,t,r,i,n);case 3:e:{if(Tw(t),e===null)throw Error(D(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Zx(e,t),tu(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=io(Error(D(423)),t),t=W0(e,t,r,n,i);break e}else if(r!==i){i=io(Error(D(424)),t),t=W0(e,t,r,n,i);break e}else for(yt=sr(t.stateNode.containerInfo.firstChild),xt=t,ge=!0,Wt=null,n=Yx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(to(),r===i){t=jn(e,t,n);break e}et(e,t,r,n)}t=t.child}return t;case 5:return Jx(t),e===null&&Hf(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Ff(r,i)?s=null:o!==null&&Ff(r,o)&&(t.flags|=32),Cw(e,t),et(e,t,s,n),t.child;case 6:return e===null&&Hf(t),null;case 13:return Pw(e,t,n);case 4:return nm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=no(t,null,r,n):et(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),B0(e,t,r,i,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,ae(Jl,r._currentValue),r._currentValue=s,o!==null)if(Yt(o.value,s)){if(o.children===i.children&&!ct.current){t=jn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=An(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Kf(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(D(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Kf(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}et(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Vi(t,n),i=zt(i),r=r(i),t.flags|=1,et(e,t,r,n),t.child;case 14:return r=t.type,i=Vt(r,t.pendingProps),i=Vt(r.type,i),V0(e,t,r,i,n);case 15:return ww(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),wl(e,t),t.tag=1,dt(r)?(e=!0,Yl(t)):e=!1,Vi(t,n),bw(t,r,i),qf(t,r,i,n),Qf(null,t,r,!0,e,n);case 19:return Ew(e,t,n);case 22:return kw(e,t,n)}throw Error(D(156,t.tag))};function Uw(e,t){return gx(e,t)}function Ej(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mt(e,t,n,r){return new Ej(e,t,n,r)}function ym(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _j(e){if(typeof e=="function")return ym(e)?1:0;if(e!=null){if(e=e.$$typeof,e===zp)return 11;if(e===Ip)return 14}return 2}function cr(e,t){var n=e.alternate;return n===null?(n=Mt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Tl(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")ym(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case wi:return Wr(n.children,i,o,t);case Dp:s=8,i|=8;break;case vf:return e=Mt(12,n,t,i|2),e.elementType=vf,e.lanes=o,e;case bf:return e=Mt(13,n,t,i),e.elementType=bf,e.lanes=o,e;case Sf:return e=Mt(19,n,t,i),e.elementType=Sf,e.lanes=o,e;case JS:return nc(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case QS:s=10;break e;case ZS:s=9;break e;case zp:s=11;break e;case Ip:s=14;break e;case Xn:s=16,r=null;break e}throw Error(D(130,e==null?e:typeof e,""))}return t=Mt(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Wr(e,t,n,r){return e=Mt(7,e,r,t),e.lanes=n,e}function nc(e,t,n,r){return e=Mt(22,e,r,t),e.elementType=JS,e.lanes=n,e.stateNode={isHidden:!1},e}function Cd(e,t,n){return e=Mt(6,e,null,t),e.lanes=n,e}function Td(e,t,n){return t=Mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $j(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=od(0),this.expirationTimes=od(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=od(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function vm(e,t,n,r,i,o,s,a,l){return e=new $j(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Mt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},tm(o),e}function Rj(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gw)}catch(e){console.error(e)}}Gw(),GS.exports=Tt;var wm=GS.exports;const[qw,Dj]=Qt({strict:!1,name:"PortalContext"}),km="chakra-portal",zj=".chakra-portal",Ij=e=>O.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),jj=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=x.useState(null),o=x.useRef(null),[,s]=x.useState({});x.useEffect(()=>s({}),[]);const a=Dj(),l=m5();Nd(()=>{if(!r)return;const c=r.ownerDocument,d=t?a??c.body:c.body;if(!d)return;o.current=c.createElement("div"),o.current.className=km,d.appendChild(o.current),s({});const f=o.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const u=l!=null&&l.zIndex?O.jsx(Ij,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return o.current?wm.createPortal(O.jsx(qw,{value:o.current,children:u}),o.current):O.jsx("span",{ref:c=>{c&&i(c)}})},Nj=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),s=x.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=km),l},[i]),[,a]=x.useState({});return Nd(()=>a({}),[]),Nd(()=>{if(!(!s||!o))return o.appendChild(s),()=>{o.removeChild(s)}},[s,o]),o&&s?wm.createPortal(O.jsx(qw,{value:r?s:null,children:t}),s):null};function ac(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?O.jsx(Nj,{containerRef:n,...r}):O.jsx(jj,{...r})}ac.className=km;ac.selector=zj;ac.displayName="Portal";const[Fj,sB]=Qt({name:"ToastOptionsContext",strict:!1}),Bj=e=>{const t=x.useSyncExternalStore(is.subscribe,is.getState,is.getState),{motionVariants:n,component:r=zS,portalProps:i,animatePresenceProps:o}=e,a=Object.keys(t).map(l=>{const u=t[l];return O.jsx("div",{role:"region","aria-live":"polite","aria-label":`Notifications-${l}`,id:`chakra-toast-manager-${l}`,style:qz(l),children:O.jsx(Hz,{...o,initial:!1,children:u.map(c=>O.jsx(r,{motionVariants:n,...c},c.id))})},l)});return O.jsx(ac,{...i,children:a})},Vj=e=>function({children:n,theme:r=e,toastOptions:i,...o}){return O.jsxs(g5,{theme:r,...o,children:[O.jsx(Fj,{value:i==null?void 0:i.defaultOptions,children:n}),O.jsx(Bj,{...i})]})},Uj=Vj(eO);function nv(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}const Wj=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function rv(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function iv(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}const uh=typeof window<"u"?x.useLayoutEffect:x.useEffect,cu=e=>e;var Hj=Object.defineProperty,Kj=(e,t,n)=>t in e?Hj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,we=(e,t,n)=>(Kj(e,typeof t!="symbol"?t+"":t,n),n);class Gj{constructor(){we(this,"descendants",new Map),we(this,"register",t=>{if(t!=null)return Wj(t)?this.registerNode(t):n=>{this.registerNode(n,t)}}),we(this,"unregister",t=>{this.descendants.delete(t);const n=nv(Array.from(this.descendants.keys()));this.assignIndex(n)}),we(this,"destroy",()=>{this.descendants.clear()}),we(this,"assignIndex",t=>{this.descendants.forEach(n=>{const r=t.indexOf(n.node);n.index=r,n.node.dataset.index=n.index.toString()})}),we(this,"count",()=>this.descendants.size),we(this,"enabledCount",()=>this.enabledValues().length),we(this,"values",()=>Array.from(this.descendants.values()).sort((n,r)=>n.index-r.index)),we(this,"enabledValues",()=>this.values().filter(t=>!t.disabled)),we(this,"item",t=>{if(this.count()!==0)return this.values()[t]}),we(this,"enabledItem",t=>{if(this.enabledCount()!==0)return this.enabledValues()[t]}),we(this,"first",()=>this.item(0)),we(this,"firstEnabled",()=>this.enabledItem(0)),we(this,"last",()=>this.item(this.descendants.size-1)),we(this,"lastEnabled",()=>{const t=this.enabledValues().length-1;return this.enabledItem(t)}),we(this,"indexOf",t=>{var n;return t?((n=this.descendants.get(t))==null?void 0:n.index)??-1:-1}),we(this,"enabledIndexOf",t=>t==null?-1:this.enabledValues().findIndex(n=>n.node.isSameNode(t))),we(this,"next",(t,n=!0)=>{const r=rv(t,this.count(),n);return this.item(r)}),we(this,"nextEnabled",(t,n=!0)=>{const r=this.item(t);if(!r)return;const i=this.enabledIndexOf(r.node),o=rv(i,this.enabledCount(),n);return this.enabledItem(o)}),we(this,"prev",(t,n=!0)=>{const r=iv(t,this.count()-1,n);return this.item(r)}),we(this,"prevEnabled",(t,n=!0)=>{const r=this.item(t);if(!r)return;const i=this.enabledIndexOf(r.node),o=iv(i,this.enabledCount()-1,n);return this.enabledItem(o)}),we(this,"registerNode",(t,n)=>{if(!t||this.descendants.has(t))return;const r=Array.from(this.descendants.keys()).concat(t),i=nv(r);n!=null&&n.disabled&&(n.disabled=!!n.disabled);const o={node:t,index:-1,...n};this.descendants.set(t,o),this.assignIndex(i)})}}function qj(){const e=x.useRef(new Gj);return uh(()=>()=>e.current.destroy()),e.current}const[Xj,Xw]=Qt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function Yj(e){const t=Xw(),[n,r]=x.useState(-1),i=x.useRef(null);uh(()=>()=>{i.current&&t.unregister(i.current)},[]),uh(()=>{if(!i.current)return;const s=Number(i.current.dataset.index);n!=s&&!Number.isNaN(s)&&r(s)});const o=cu(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:bu(o,i)}}function Qj(){return[cu(Xj),()=>cu(Xw()),()=>qj(),i=>Yj(i)]}const ch=it("div");ch.displayName="Box";var Yw={exports:{}},Zj="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Jj=Zj,eN=Jj;function Qw(){}function Zw(){}Zw.resetWarningCache=Qw;var tN=function(){function e(r,i,o,s,a,l){if(l!==eN){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Zw,resetWarningCache:Qw};return n.PropTypes=n,n};Yw.exports=tN();var nN=Yw.exports;const Pr=Zr(nN);function rN(){const e=x.useRef(new Map),t=e.current,n=x.useCallback((i,o,s,a)=>{e.current.set(s,{type:o,el:i,options:a}),i.addEventListener(o,s,a)},[]),r=x.useCallback((i,o,s,a)=>{i.removeEventListener(o,s,a),e.current.delete(s)},[]);return x.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function Pd(e){var i,o;const t=((o=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:o[0])??e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function iN(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:s,onMouseUp:a,onClick:l,onKeyDown:u,onKeyUp:c,tabIndex:d,onMouseOver:f,onMouseLeave:p,...v}=e,[y,S]=x.useState(!0),[m,h]=x.useState(!1),g=rN(),k=L=>{L&&L.tagName!=="BUTTON"&&S(!1)},T=y?d:d||0,$=n&&!r,_=x.useCallback(L=>{if(n){L.stopPropagation(),L.preventDefault();return}L.currentTarget.focus(),l==null||l(L)},[n,l]),R=x.useCallback(L=>{m&&Pd(L)&&(L.preventDefault(),L.stopPropagation(),h(!1),g.remove(document,"keyup",R,!1))},[m,g]),F=x.useCallback(L=>{if(u==null||u(L),n||L.defaultPrevented||L.metaKey||!Pd(L.nativeEvent)||y)return;const A=i&&L.key==="Enter";o&&L.key===" "&&(L.preventDefault(),h(!0)),A&&(L.preventDefault(),L.currentTarget.click()),g.add(document,"keyup",R,!1)},[n,y,u,i,o,g,R]),j=x.useCallback(L=>{if(c==null||c(L),n||L.defaultPrevented||L.metaKey||!Pd(L.nativeEvent)||y)return;o&&L.key===" "&&(L.preventDefault(),h(!1),L.currentTarget.click())},[o,y,n,c]),H=x.useCallback(L=>{L.button===0&&(h(!1),g.remove(document,"mouseup",H,!1))},[g]),ue=x.useCallback(L=>{if(L.button!==0)return;if(n){L.stopPropagation(),L.preventDefault();return}y||h(!0),L.currentTarget.focus({preventScroll:!0}),g.add(document,"mouseup",H,!1),s==null||s(L)},[n,y,s,g,H]),Ze=x.useCallback(L=>{L.button===0&&(y||h(!1),a==null||a(L))},[a,y]),Ae=x.useCallback(L=>{if(n){L.preventDefault();return}f==null||f(L)},[n,f]),P=x.useCallback(L=>{m&&(L.preventDefault(),h(!1)),p==null||p(L)},[m,p]),M=bu(t,k);return y?{...v,ref:M,type:"button","aria-disabled":$?void 0:n,disabled:$,onClick:_,onMouseDown:s,onMouseUp:a,onKeyUp:c,onKeyDown:u,onMouseOver:f,onMouseLeave:p}:{...v,ref:M,role:"button","data-active":xT(m),"aria-disabled":n?"true":void 0,tabIndex:$?void 0:T,onClick:_,onMouseDown:ue,onMouseUp:Ze,onKeyUp:j,onKeyDown:F,onMouseOver:Ae,onMouseLeave:P}}const[oN,sN,aN,lN]=Qj();function uN(e){const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:s="unmount",orientation:a="horizontal",direction:l="ltr",...u}=e,[c,d]=x.useState(t??0),[f,p]=DT({defaultValue:t??0,value:r,onChange:n});x.useEffect(()=>{r!=null&&d(r)},[r]);const v=aN(),y=x.useId();return{id:`tabs-${e.id??y}`,selectedIndex:f,focusedIndex:c,setSelectedIndex:p,setFocusedIndex:d,isManual:i,isLazy:o,lazyBehavior:s,orientation:a,descendants:v,direction:l,htmlProps:u}}const[cN,Jw]=Qt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function dN(e){const{focusedIndex:t,orientation:n,direction:r}=Jw(),i=sN(),o=x.useCallback(s=>{const a=()=>{var g;const h=i.nextEnabled(t);h&&((g=h.node)==null||g.focus())},l=()=>{var g;const h=i.prevEnabled(t);h&&((g=h.node)==null||g.focus())},u=()=>{var g;const h=i.firstEnabled();h&&((g=h.node)==null||g.focus())},c=()=>{var g;const h=i.lastEnabled();h&&((g=h.node)==null||g.focus())},d=n==="horizontal",f=n==="vertical",p=s.key,v=r==="ltr"?"ArrowLeft":"ArrowRight",y=r==="ltr"?"ArrowRight":"ArrowLeft",m={[v]:()=>d&&l(),[y]:()=>d&&a(),ArrowDown:()=>f&&a(),ArrowUp:()=>f&&l(),Home:u,End:c}[p];m&&(s.preventDefault(),m(s))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:jd(e.onKeyDown,o)}}function fN(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:i,isManual:o,id:s,setFocusedIndex:a,selectedIndex:l}=Jw(),{index:u,register:c}=lN({disabled:t&&!n}),d=u===l,f=()=>{i(u)},p=()=>{a(u),!o&&!(t&&n)&&i(u)};return{...iN({...r,ref:bu(c,e.ref),isDisabled:t,isFocusable:n,onClick:jd(e.onClick,f)}),id:hN(s,u),role:"tab",tabIndex:d?0:-1,type:"button","aria-selected":d,"aria-controls":pN(s,u),onFocus:t?void 0:jd(e.onFocus,p)}}Qt({});function hN(e,t){return`${e}--tab-${t}`}function pN(e,t){return`${e}--tabpanel-${t}`}const[mN,ek]=Qt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),tk=Fn(function(t,n){const r=NS("Tabs",t),{children:i,className:o,...s}=xu(t),{htmlProps:a,descendants:l,...u}=uN(s),c=x.useMemo(()=>u,[u]),{isFitted:d,...f}=a,p={position:"relative",...r.root};return O.jsx(oN,{value:l,children:O.jsx(cN,{value:c,children:O.jsx(mN,{value:r,children:O.jsx(it.div,{className:Nn("chakra-tabs",o),ref:n,...f,__css:p,children:i})})})})});tk.displayName="Tabs";const dh=Fn(function(t,n){const r=ek(),i=fN({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return O.jsx(it.button,{...i,className:Nn("chakra-tabs__tab",t.className),__css:o})});dh.displayName="Tab";const nk=Fn(function(t,n){const r=dN({...t,ref:n}),i=ek(),o={display:"flex",...i.tablist};return O.jsx(it.div,{...r,className:Nn("chakra-tabs__tablist",t.className),__css:o})});nk.displayName="TabList";var rk,ik,ov=wm;ik=ov.createRoot,rk=ov.hydrateRoot;/** + * @remix-run/router v1.20.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ws(){return Ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ok(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function yN(){return Math.random().toString(36).substr(2,8)}function av(e,t){return{usr:e.state,key:e.key,idx:t}}function fh(e,t,n,r){return n===void 0&&(n=null),Ws({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?po(t):t,{state:n,key:t&&t.key||r||yN()})}function du(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function po(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function vN(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=nr.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(Ws({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){a=nr.Pop;let S=c(),m=S==null?null:S-u;u=S,l&&l({action:a,location:y.location,delta:m})}function f(S,m){a=nr.Push;let h=fh(y.location,S,m);u=c()+1;let g=av(h,u),k=y.createHref(h);try{s.pushState(g,"",k)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(k)}o&&l&&l({action:a,location:y.location,delta:1})}function p(S,m){a=nr.Replace;let h=fh(y.location,S,m);u=c();let g=av(h,u),k=y.createHref(h);s.replaceState(g,"",k),o&&l&&l({action:a,location:y.location,delta:0})}function v(S){let m=i.location.origin!=="null"?i.location.origin:i.location.href,h=typeof S=="string"?S:du(S);return h=h.replace(/ $/,"%20"),Re(m,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,m)}let y={get action(){return a},get location(){return e(i,s)},listen(S){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(sv,d),l=S,()=>{i.removeEventListener(sv,d),l=null}},createHref(S){return t(i,S)},createURL:v,encodeLocation(S){let m=v(S);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:p,go(S){return s.go(S)}};return y}var lv;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(lv||(lv={}));function bN(e,t,n){return n===void 0&&(n="/"),SN(e,t,n,!1)}function SN(e,t,n,r){let i=typeof t=="string"?po(t):t,o=Cm(i.pathname||"/",n);if(o==null)return null;let s=sk(e);xN(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(Re(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=dr([r,l.relativePath]),c=n.concat(l);o.children&&o.children.length>0&&(Re(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),sk(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:_N(u,o.index),routesMeta:c})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of ak(o.path))i(o,s,l)}),t}function ak(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=ak(r.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function xN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$N(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const wN=/^:[\w-]+$/,kN=3,CN=2,TN=1,PN=10,EN=-2,uv=e=>e==="*";function _N(e,t){let n=e.split("/"),r=n.length;return n.some(uv)&&(r+=EN),t&&(r+=CN),n.filter(i=>!uv(i)).reduce((i,o)=>i+(wN.test(o)?kN:o===""?TN:PN),r)}function $N(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function RN(e,t,n){let{routesMeta:r}=e,i={},o="/",s=[];for(let a=0;a{let{paramName:f,isOptional:p}=c;if(f==="*"){let y=a[d]||"";s=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const v=a[d];return p&&!v?u[f]=void 0:u[f]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:s,pattern:e}}function AN(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ok(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function ON(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ok(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Cm(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function LN(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?po(e):e;return{pathname:n?n.startsWith("/")?n:MN(n,t):t,search:IN(r),hash:jN(i)}}function MN(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Ed(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function DN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function lk(e,t){let n=DN(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function uk(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=po(e):(i=Ws({},e),Re(!i.pathname||!i.pathname.includes("?"),Ed("?","pathname","search",i)),Re(!i.pathname||!i.pathname.includes("#"),Ed("#","pathname","hash",i)),Re(!i.search||!i.search.includes("#"),Ed("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=LN(i,a),u=s&&s!=="/"&&s.endsWith("/"),c=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const dr=e=>e.join("/").replace(/\/\/+/g,"/"),zN=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),IN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function NN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ck=["post","put","patch","delete"];new Set(ck);const FN=["get",...ck];new Set(FN);/** + * React Router v6.27.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Hs(){return Hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),x.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=uk(u,JSON.parse(s),o,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:dr([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,s,o,e])}function aB(){let{matches:e}=x.useContext(Sr),t=e[e.length-1];return t?t.params:{}}function hk(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(ni),{matches:i}=x.useContext(Sr),{pathname:o}=ua(),s=JSON.stringify(lk(i,r.v7_relativeSplatPath));return x.useMemo(()=>uk(e,JSON.parse(s),o,n==="path"),[e,s,o,n])}function HN(e,t){return KN(e,t)}function KN(e,t,n,r){la()||Re(!1);let{navigator:i}=x.useContext(ni),{matches:o}=x.useContext(Sr),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=ua(),c;if(t){var d;let S=typeof t=="string"?po(t):t;l==="/"||(d=S.pathname)!=null&&d.startsWith(l)||Re(!1),c=S}else c=u;let f=c.pathname||"/",p=f;if(l!=="/"){let S=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=bN(e,{pathname:p}),y=QN(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:dr([l,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?l:dr([l,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&y?x.createElement(lc.Provider,{value:{location:Hs({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:nr.Pop}},y):y}function GN(){let e=t4(),t=NN(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:i},n):null,null)}const qN=x.createElement(GN,null);class XN extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement(Sr.Provider,{value:this.props.routeContext},x.createElement(dk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function YN(e){let{routeContext:t,match:n,children:r}=e,i=x.useContext(Tm);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Sr.Provider,{value:t},r)}function QN(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let c=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||Re(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,f)=>{let p,v=!1,y=null,S=null;n&&(p=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||qN,l&&(u<0&&f===0?(v=!0,S=null):u===f&&(v=!0,S=d.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,f+1)),h=()=>{let g;return p?g=y:v?g=S:d.route.Component?g=x.createElement(d.route.Component,null):d.route.element?g=d.route.element:g=c,x.createElement(YN,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:n!=null},children:g})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?x.createElement(XN,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):h()},null)}var pk=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(pk||{}),fu=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(fu||{});function ZN(e){let t=x.useContext(Tm);return t||Re(!1),t}function JN(e){let t=x.useContext(BN);return t||Re(!1),t}function e4(e){let t=x.useContext(Sr);return t||Re(!1),t}function mk(e){let t=e4(),n=t.matches[t.matches.length-1];return n.route.id||Re(!1),n.route.id}function t4(){var e;let t=x.useContext(dk),n=JN(fu.UseRouteError),r=mk(fu.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function n4(){let{router:e}=ZN(pk.UseNavigateStable),t=mk(fu.UseNavigateStable),n=x.useRef(!1);return fk(()=>{n.current=!0}),x.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Hs({fromRouteId:t},o)))},[e,t])}function Gn(e){Re(!1)}function r4(e){let{basename:t="/",children:n=null,location:r,navigationType:i=nr.Pop,navigator:o,static:s=!1,future:a}=e;la()&&Re(!1);let l=t.replace(/^\/*/,"/"),u=x.useMemo(()=>({basename:l,navigator:o,static:s,future:Hs({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof r=="string"&&(r=po(r));let{pathname:c="/",search:d="",hash:f="",state:p=null,key:v="default"}=r,y=x.useMemo(()=>{let S=Cm(c,l);return S==null?null:{location:{pathname:S,search:d,hash:f,state:p,key:v},navigationType:i}},[l,c,d,f,p,v,i]);return y==null?null:x.createElement(ni.Provider,{value:u},x.createElement(lc.Provider,{children:n,value:y}))}function i4(e){let{children:t,location:n}=e;return HN(hh(t),n)}new Promise(()=>{});function hh(e,t){t===void 0&&(t=[]);let n=[];return x.Children.forEach(e,(r,i)=>{if(!x.isValidElement(r))return;let o=[...t,i];if(r.type===x.Fragment){n.push.apply(n,hh(r.props.children,o));return}r.type!==Gn&&Re(!1),!r.props.index||!r.props.children||Re(!1);let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=hh(r.props.children,o)),n.push(s)}),n}/** + * React Router DOM v6.27.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ph(){return ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function s4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function a4(e,t){return e.button===0&&(!t||t==="_self")&&!s4(e)}const l4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],u4="6";try{window.__reactRouterVersion=u4}catch{}const c4="startTransition",dv=zd[c4];function d4(e){let{basename:t,children:n,future:r,window:i}=e,o=x.useRef();o.current==null&&(o.current=gN({window:i,v5Compat:!0}));let s=o.current,[a,l]=x.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=x.useCallback(d=>{u&&dv?dv(()=>l(d)):l(d)},[l,u]);return x.useLayoutEffect(()=>s.listen(c),[s,c]),x.createElement(r4,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const f4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",h4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fv=x.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=t,f=o4(t,l4),{basename:p}=x.useContext(ni),v,y=!1;if(typeof u=="string"&&h4.test(u)&&(v=u,f4))try{let g=new URL(window.location.href),k=u.startsWith("//")?new URL(g.protocol+u):new URL(u),T=Cm(k.pathname,p);k.origin===g.origin&&T!=null?u=T+k.search+k.hash:y=!0}catch{}let S=VN(u,{relative:i}),m=p4(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:d});function h(g){r&&r(g),g.defaultPrevented||m(g)}return x.createElement("a",ph({},f,{href:v||S,onClick:y||o?r:h,ref:n,target:l}))});var hv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(hv||(hv={}));var pv;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(pv||(pv={}));function p4(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,viewTransition:a}=t===void 0?{}:t,l=UN(),u=ua(),c=hk(e,{relative:s});return x.useCallback(d=>{if(a4(d,n)){d.preventDefault();let f=r!==void 0?r:du(u)===du(c);l(e,{replace:f,state:i,preventScrollReset:o,relative:s,viewTransition:a})}},[u,l,c,r,i,n,e,o,s,a])}const m4={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 hu{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||m4,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-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 n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},mv=e=>e==null?"":""+e,g4=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},y4=/###/g,gv=e=>e&&e.indexOf("###")>-1?e.replace(y4,"."):e,yv=e=>!e||typeof e=="string",ps=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let i=0;for(;i{const{obj:r,k:i}=ps(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],s=t.slice(0,t.length-1),a=ps(e,s,Object);for(;a.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),a=ps(e,s,Object),a&&a.obj&&typeof a.obj[`${a.k}.${o}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=n},v4=(e,t,n,r)=>{const{obj:i,k:o}=ps(e,t,Object);i[o]=i[o]||[],i[o].push(n)},pu=(e,t)=>{const{obj:n,k:r}=ps(e,t);if(n)return n[r]},b4=(e,t,n)=>{const r=pu(e,n);return r!==void 0?r:pu(t,n)},gk=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):gk(e[r],t[r],n):e[r]=t[r]);return e},ai=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var S4={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const x4=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>S4[t]):e;class w4{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const k4=[" ",",","?","!",";"],C4=new w4(20),T4=(e,t,n)=>{t=t||"",n=n||"";const r=k4.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=C4.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o},mh=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let o=0;o-1&&le&&e.indexOf("_")>0?e.replace("_","-"):e;class bv extends uc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,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 n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){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,n],r&&(Array.isArray(r)?a.push(...r):typeof r=="string"&&o?a.push(...r.split(o)):a.push(r)));const l=pu(this.data,a);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),l||!s||typeof r!="string"?l:mh(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,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,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(a=t.split("."),i=n,n=a[1]),this.addNamespaces(n),vv(this.data,a,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),i=r,r=n,n=a[1]),this.addNamespaces(n);let l=pu(this.data,a)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?gk(l,r,o):l={...l,...r},vv(this.data,a,l),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var yk={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,i))}),t}};const Sv={};class gu extends uc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),g4(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=cn.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!T4(t,r,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(r);(r!==i||r===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,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],n),l=a[a.length-1],u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const k=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${k}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${k}${s}`}return i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s}const d=this.resolve(t,n);let f=d&&d.res;const p=d&&d.usedKey||s,v=d&&d.exactUsedKey||s,y=Object.prototype.toString.apply(f),S=["[object Number]","[object Function]","[object RegExp]"],m=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,h=!this.i18nFormat||this.i18nFormat.handleAsObject;if(h&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&S.indexOf(y)<0&&!(typeof m=="string"&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,{...n,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(d.res=k,d.usedParams=this.getUsedParamsDetails(n),d):k}if(o){const k=Array.isArray(f),T=k?[]:{},$=k?v:p;for(const _ in f)if(Object.prototype.hasOwnProperty.call(f,_)){const R=`${$}${o}${_}`;T[_]=this.translate(R,{...n,joinArrays:!1,ns:a}),T[_]===R&&(T[_]=f[_])}f=T}}else if(h&&typeof m=="string"&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,t,n,r));else{let k=!1,T=!1;const $=n.count!==void 0&&typeof n.count!="string",_=gu.hasDefaultValue(n),R=$?this.pluralResolver.getSuffix(u,n.count,n):"",F=n.ordinal&&$?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",j=$&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),H=j&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${F}`]||n.defaultValue;!this.isValidLookup(f)&&_&&(k=!0,f=H),this.isValidLookup(f)||(T=!0,f=s);const Ze=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&T?void 0:f,Ae=_&&H!==f&&this.options.updateMissing;if(T||k||Ae){if(this.logger.log(Ae?"updateKey":"missingKey",u,l,s,Ae?H:f),o){const A=this.resolve(s,{...n,keySeparator:!1});A&&A.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 P=[];const M=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&M&&M[0])for(let A=0;A{const Q=_&&z!==f?z:Ze;this.options.missingKeyHandler?this.options.missingKeyHandler(A,l,I,Q,Ae,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(A,l,I,Q,Ae,n),this.emit("missingKey",A,l,I,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&$?P.forEach(A=>{const I=this.pluralResolver.getSuffixes(A,n);j&&n[`defaultValue${this.options.pluralSeparator}zero`]&&I.indexOf(`${this.options.pluralSeparator}zero`)<0&&I.push(`${this.options.pluralSeparator}zero`),I.forEach(z=>{L([A],s+z,n[`defaultValue${z}`]||H)})}):L(P,s,H))}f=this.extendTranslation(f,t,n,d,r),T&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${s}`),(T||k)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,k?f:void 0):f=this.options.parseMissingKeyHandler(f))}return i?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(t,n,r,i,o){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const f=t.match(this.interpolator.nestingRegexp);c=f&&f.length}let d=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language||i.usedLng,r),u){const f=t.match(this.interpolator.nestingRegexp),p=f&&f.length;c1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,s,a;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",p=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),v=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(S=>{this.isValidLookup(r)||(a=S,!Sv[`${y[0]}-${S}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(Sv[`${y[0]}-${S}`]=!0,this.logger.warn(`key "${i}" for languages "${y.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!!!")),y.forEach(m=>{if(this.isValidLookup(r))return;s=m;const h=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(h,c,m,S,n);else{let k;f&&(k=this.pluralResolver.getSuffix(m,n.count,n));const T=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(h.push(c+k),n.ordinal&&k.indexOf($)===0&&h.push(c+k.replace($,this.options.pluralSeparator)),p&&h.push(c+T)),v){const _=`${c}${this.options.contextSeparator}${n.context}`;h.push(_),f&&(h.push(_+k),n.ordinal&&k.indexOf($)===0&&h.push(_+k.replace($,this.options.pluralSeparator)),p&&h.push(_+T))}}let g;for(;g=h.pop();)this.isValidLookup(r)||(o=g,r=this.getResource(m,S,g,n))}))})}),{res:r,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,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const _d=e=>e.charAt(0).toUpperCase()+e.slice(1);class xv{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=cn.create("languageUtils")}getScriptPartFromCode(t){if(t=mu(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=mu(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=_d(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=_d(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=_d(r[2].toLowerCase()))),r.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 n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=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})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||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)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}let P4=[{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}],E4={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 _4=["v1","v2","v3"],$4=["v4"],wv={zero:0,one:1,two:2,few:3,many:4,other:5},R4=()=>{const e={};return P4.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:E4[t.fc]}})}),e};class A4{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=cn.create("pluralResolver"),(!this.options.compatibilityJSON||$4.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=R4(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=mu(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const s=new Intl.PluralRules(r,{type:i});return this.pluralRulesCache[o]=s,s}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,o)=>wv[i]-wv[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(t,i,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let i=t.numbers[r];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&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!_4.includes(this.options.compatibilityJSON)}}const kv=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=b4(e,t,n);return!o&&i&&typeof n=="string"&&(o=mh(e,n,r),o===void 0&&(o=mh(t,n,r))),o},$d=e=>e.replace(/\$/g,"$$$$");class O4{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=cn.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:s,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:v,nestingSuffixEscaped:y,nestingOptionsSeparator:S,maxReplaces:m,alwaysFormat:h}=t.interpolation;this.escape=n!==void 0?n:x4,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?ai(o):s||"{{",this.suffix=a?ai(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=f?ai(f):p||ai("$t("),this.nestingSuffix=v?ai(v):y||ai(")"),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=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"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,n,r,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=kv(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(m,void 0,r,{...i,...n,interpolationkey:p}):m}const v=p.split(this.formatSeparator),y=v.shift().trim(),S=v.join(this.formatSeparator).trim();return this.format(kv(n,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...i,...n,interpolationkey:y})};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=>$d(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?$d(this.escape(p)):$d(p)}].forEach(p=>{for(a=0;o=p.regex.exec(t);){const v=o[1].trim();if(s=u(v),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,v))s="";else if(d){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=mv(s));const y=p.safeValue(s);if(t=t.replace(o[0],y),d?(p.regex.lastIndex+=s.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=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),v=f.match(/"/g);(p&&p.length%2===0&&!v||v.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),u&&(s={...u,...s})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${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={...r},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=n(a.call(this,i[1].trim(),s),s),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=mv(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const L4=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(s=>{if(s){const[a,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();n[c]||(n[c]=u),u==="false"&&(n[c]=!1),u==="true"&&(n[c]=!0),isNaN(u)||(n[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},li=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let a=t[s];return a||(a=e(mu(r),i),t[s]=a),a(n)}};class M4{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=cn.create("formatter"),this.options=t,this.formats={number:li((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:li((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:li((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:li((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:li((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=li(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.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}=L4(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||r;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 D4=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class z4 extends uc{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=cn.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(r,i.backend,i)}queueLoad(t,n,r,i){const o={},s={},a={},l={};return t.forEach(u=>{let c=!0;n.forEach(d=>{const f=`${u}|${d}`;!r.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,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),!n&&r&&this.store.addResourceBundle(o,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(l=>{v4(l.loaded,[o],s),D4(l,t),n&&l.errors.push(n),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,n,r){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:n,fcName:r,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,n,r,i+1,o*2,s)},o);return}s(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>a(null,c)).catch(a):a(null,u)}catch(u){a(u)}return}return l(t,n,a)}prepareLoading(t,n){let r=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 n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,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(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){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,n,r,i,l):c=u(t,n,r,i),c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}else u(t,n,r,i,a,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const Cv=()=>({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 n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Tv=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),qa=()=>{},I4=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Ks extends uc{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Tv(t),this.services={},this.logger=cn,this.modules={external:[]},I4(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=Cv();this.options={...i,...this.options,...Tv(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?cn.init(o(this.modules.logger),this.options):cn.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=M4);const d=new xv(this.options);this.store=new bv(this.options.resources,this.options);const f=this.services;f.logger=cn,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new A4(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 O4(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new z4(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var v=arguments.length,y=new Array(v>1?v-1:0),S=1;S1?v-1:0),S=1;S{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=qa),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=Lo(),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),r(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 r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qa;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();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),r(a)})}else r(null)}reloadResources(t,n,r){const i=Lo();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=qa),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(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"&&yk.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 n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Lo();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 r.t(...arguments)}),n&&n(l,function(){return r.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,n,r){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}${v}`):p=l.keyPrefix?`${l.keyPrefix}${f}${s}`:s,i.t(p,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,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 n=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 r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=Lo();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=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Lo();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=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["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"],r=this.services&&this.services.languageUtils||new xv(Cv());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Ks(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qa;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Ks(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)},r&&(o.store=new bv(this.store.data,i),o.services.resourceStore=o.store),o.translator=new gu(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&&(Hr(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},Pv={},gh=(...e)=>{Hr(e[0])&&Pv[e[0]]||(Hr(e[0])&&(Pv[e[0]]=new Date),j4(...e))},vk=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},yh=(e,t,n)=>{e.loadNamespaces(t,vk(e,n))},Ev=(e,t,n,r)=>{if(Hr(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return yh(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,vk(e,r))},N4=(e,t,n={})=>!t.languages||!t.languages.length?(gh("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{var o;if(((o=n.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Hr=e=>typeof e=="string",F4=e=>typeof e=="object"&&e!==null,B4=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,V4={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},U4=e=>V4[e],W4=e=>e.replace(B4,U4);let vh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:W4};const H4=(e={})=>{vh={...vh,...e}},K4=()=>vh;let bk;const G4=e=>{bk=e},q4=()=>bk,X4={type:"3rdParty",init(e){H4(e.options.react),G4(e)}},Y4=x.createContext();class Q4{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Z4=(e,t)=>{const n=x.useRef();return x.useEffect(()=>{n.current=e},[e,t]),n.current},Sk=(e,t,n,r)=>e.getFixedT(t,n,r),J4=(e,t,n,r)=>x.useCallback(Sk(e,t,n,r),[e,t,n,r]),eF=(e,t={})=>{var k,T,$,_;const{i18n:n}=t,{i18n:r,defaultNS:i}=x.useContext(Y4)||{},o=n||r||q4();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Q4),!o){gh("You will need to pass in an i18next instance by using initReactI18next");const R=(j,H)=>Hr(H)?H:F4(H)&&Hr(H.defaultValue)?H.defaultValue:Array.isArray(j)?j[j.length-1]:j,F=[R,{},!1];return F.t=R,F.i18n={},F.ready=!1,F}(k=o.options.react)!=null&&k.wait&&gh("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...K4(),...o.options.react,...t},{useSuspense:a,keyPrefix:l}=s;let u=i||((T=o.options)==null?void 0:T.defaultNS);u=Hr(u)?[u]:u||["translation"],(_=($=o.reportNamespaces).addUsedNamespaces)==null||_.call($,u);const c=(o.isInitialized||o.initializedStoreOnce)&&u.every(R=>N4(R,o,s)),d=J4(o,t.lng||null,s.nsMode==="fallback"?u:u[0],l),f=()=>d,p=()=>Sk(o,t.lng||null,s.nsMode==="fallback"?u:u[0],l),[v,y]=x.useState(f);let S=u.join();t.lng&&(S=`${t.lng}${S}`);const m=Z4(S),h=x.useRef(!0);x.useEffect(()=>{const{bindI18n:R,bindI18nStore:F}=s;h.current=!0,!c&&!a&&(t.lng?Ev(o,t.lng,u,()=>{h.current&&y(p)}):yh(o,u,()=>{h.current&&y(p)})),c&&m&&m!==S&&h.current&&y(p);const j=()=>{h.current&&y(p)};return R&&(o==null||o.on(R,j)),F&&(o==null||o.store.on(F,j)),()=>{h.current=!1,o&&(R==null||R.split(" ").forEach(H=>o.off(H,j))),F&&o&&F.split(" ").forEach(H=>o.store.off(H,j))}},[o,S]),x.useEffect(()=>{h.current&&c&&y(f)},[o,l,c]);const g=[v,o,c];if(g.t=v,g.i18n=o,g.ready=c,c||!c&&!a)return g;throw new Promise(R=>{t.lng?Ev(o,t.lng,u,()=>R()):yh(o,u,()=>R())})};function bh(e){"@babel/helpers - typeof";return bh=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},bh(e)}function xk(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":bh(XMLHttpRequest))==="object"}function tF(e){return!!e&&typeof e.then=="function"}function nF(e){return tF(e)?e:Promise.resolve(e)}function rF(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 Sh={exports:{}},Xa={exports:{}},_v;function iF(){return _v||(_v=1,function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Cn<"u"&&Cn,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,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(P){return P&&DataView.prototype.isPrototypeOf(P)}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(P){return P&&c.indexOf(Object.prototype.toString.call(P))>-1};function f(P){if(typeof P!="string"&&(P=String(P)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(P)||P==="")throw new TypeError('Invalid character in header field name: "'+P+'"');return P.toLowerCase()}function p(P){return typeof P!="string"&&(P=String(P)),P}function v(P){var M={next:function(){var L=P.shift();return{done:L===void 0,value:L}}};return l.iterable&&(M[Symbol.iterator]=function(){return M}),M}function y(P){this.map={},P instanceof y?P.forEach(function(M,L){this.append(L,M)},this):Array.isArray(P)?P.forEach(function(M){this.append(M[0],M[1])},this):P&&Object.getOwnPropertyNames(P).forEach(function(M){this.append(M,P[M])},this)}y.prototype.append=function(P,M){P=f(P),M=p(M);var L=this.map[P];this.map[P]=L?L+", "+M:M},y.prototype.delete=function(P){delete this.map[f(P)]},y.prototype.get=function(P){return P=f(P),this.has(P)?this.map[P]:null},y.prototype.has=function(P){return this.map.hasOwnProperty(f(P))},y.prototype.set=function(P,M){this.map[f(P)]=p(M)},y.prototype.forEach=function(P,M){for(var L in this.map)this.map.hasOwnProperty(L)&&P.call(M,this.map[L],L,this)},y.prototype.keys=function(){var P=[];return this.forEach(function(M,L){P.push(L)}),v(P)},y.prototype.values=function(){var P=[];return this.forEach(function(M){P.push(M)}),v(P)},y.prototype.entries=function(){var P=[];return this.forEach(function(M,L){P.push([L,M])}),v(P)},l.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function S(P){if(P.bodyUsed)return Promise.reject(new TypeError("Already read"));P.bodyUsed=!0}function m(P){return new Promise(function(M,L){P.onload=function(){M(P.result)},P.onerror=function(){L(P.error)}})}function h(P){var M=new FileReader,L=m(M);return M.readAsArrayBuffer(P),L}function g(P){var M=new FileReader,L=m(M);return M.readAsText(P),L}function k(P){for(var M=new Uint8Array(P),L=new Array(M.length),A=0;A-1?M:P}function F(P,M){if(!(this instanceof F))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');M=M||{};var L=M.body;if(P instanceof F){if(P.bodyUsed)throw new TypeError("Already read");this.url=P.url,this.credentials=P.credentials,M.headers||(this.headers=new y(P.headers)),this.method=P.method,this.mode=P.mode,this.signal=P.signal,!L&&P._bodyInit!=null&&(L=P._bodyInit,P.bodyUsed=!0)}else this.url=String(P);if(this.credentials=M.credentials||this.credentials||"same-origin",(M.headers||!this.headers)&&(this.headers=new y(M.headers)),this.method=R(M.method||this.method||"GET"),this.mode=M.mode||this.mode||null,this.signal=M.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&L)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(L),(this.method==="GET"||this.method==="HEAD")&&(M.cache==="no-store"||M.cache==="no-cache")){var A=/([?&])_=[^&]*/;if(A.test(this.url))this.url=this.url.replace(A,"$1_="+new Date().getTime());else{var I=/\?/;this.url+=(I.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}F.prototype.clone=function(){return new F(this,{body:this._bodyInit})};function j(P){var M=new FormData;return P.trim().split("&").forEach(function(L){if(L){var A=L.split("="),I=A.shift().replace(/\+/g," "),z=A.join("=").replace(/\+/g," ");M.append(decodeURIComponent(I),decodeURIComponent(z))}}),M}function H(P){var M=new y,L=P.replace(/\r?\n[\t ]+/g," ");return L.split("\r").map(function(A){return A.indexOf(` +`)===0?A.substr(1,A.length):A}).forEach(function(A){var I=A.split(":"),z=I.shift().trim();if(z){var Q=I.join(":").trim();M.append(z,Q)}}),M}$.call(F.prototype);function ue(P,M){if(!(this instanceof ue))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');M||(M={}),this.type="default",this.status=M.status===void 0?200:M.status,this.ok=this.status>=200&&this.status<300,this.statusText=M.statusText===void 0?"":""+M.statusText,this.headers=new y(M.headers),this.url=M.url||"",this._initBody(P)}$.call(ue.prototype),ue.prototype.clone=function(){return new ue(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},ue.error=function(){var P=new ue(null,{status:0,statusText:""});return P.type="error",P};var Ze=[301,302,303,307,308];ue.redirect=function(P,M){if(Ze.indexOf(M)===-1)throw new RangeError("Invalid status code");return new ue(null,{status:M,headers:{location:P}})},s.DOMException=a.DOMException;try{new s.DOMException}catch{s.DOMException=function(M,L){this.message=M,this.name=L;var A=Error(M);this.stack=A.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function Ae(P,M){return new Promise(function(L,A){var I=new F(P,M);if(I.signal&&I.signal.aborted)return A(new s.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function Q(){z.abort()}z.onload=function(){var K={status:z.status,statusText:z.statusText,headers:H(z.getAllResponseHeaders()||"")};K.url="responseURL"in z?z.responseURL:K.headers.get("X-Request-URL");var Je="response"in z?z.response:z.responseText;setTimeout(function(){L(new ue(Je,K))},0)},z.onerror=function(){setTimeout(function(){A(new TypeError("Network request failed"))},0)},z.ontimeout=function(){setTimeout(function(){A(new TypeError("Network request failed"))},0)},z.onabort=function(){setTimeout(function(){A(new s.DOMException("Aborted","AbortError"))},0)};function xe(K){try{return K===""&&a.location.href?a.location.href:K}catch{return K}}z.open(I.method,xe(I.url),!0),I.credentials==="include"?z.withCredentials=!0:I.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&(l.blob?z.responseType="blob":l.arrayBuffer&&I.headers.get("Content-Type")&&I.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(z.responseType="arraybuffer")),M&&typeof M.headers=="object"&&!(M.headers instanceof y)?Object.getOwnPropertyNames(M.headers).forEach(function(K){z.setRequestHeader(K,p(M.headers[K]))}):I.headers.forEach(function(K,Je){z.setRequestHeader(Je,K)}),I.signal&&(I.signal.addEventListener("abort",Q),z.onreadystatechange=function(){z.readyState===4&&I.signal.removeEventListener("abort",Q)}),z.send(typeof I._bodyInit>"u"?null:I._bodyInit)})}return Ae.polyfill=!0,a.fetch||(a.fetch=Ae,a.Headers=y,a.Request=F,a.Response=ue),s.Headers=y,s.Request=F,s.Response=ue,s.fetch=Ae,s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;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}(Xa,Xa.exports)),Xa.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof Cn<"u"&&Cn.fetch?n=Cn.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof rF<"u"&&typeof window>"u"){var r=n||iF();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(Sh,Sh.exports);var wk=Sh.exports;const kk=Zr(wk),$v=o1({__proto__:null,default:kk},[wk]);function Rv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Av(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,")")),r&&(o["Content-Type"]="application/json");var s=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,a=Av({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},Lv?{}:s),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{Ov(n,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]}),Ov(n,a,i,l),Lv=!0}catch(c){i(c)}}},uF=function(t,n,r,i){r&&Qr(r)==="object"&&(r=xh("",r).slice(1)),t.queryStringParams&&(n=xh(n,t.queryStringParams));try{var o;Gs?o=new Gs:o=new yu("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&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(r)}catch(l){console&&console.log(l)}},cF=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},On&&n.indexOf("file:")!==0)return lF(t,n,r,i);if(xk()||typeof ActiveXObject=="function")return uF(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function so(e){"@babel/helpers - typeof";return so=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},so(e)}function Mv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rd(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};dF(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return hF(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=Rd(Rd(Rd({},mF()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var s=setInterval(function(){return r.reload()},this.options.reloadInterval);so(s)==="object"&&typeof s.unref=="function"&&s.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,s){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=nF(l),l.then(function(u){if(!u)return s(null,{});var c=a.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});a.loadUrl(c,s,r,o)})}},{key:"loadUrl",value:function(n,r,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,n,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&c&&c.message){var f=c.message.toLowerCase(),p=["failed","fetch","network","load"].find(function(S){return f.indexOf(S)>-1});if(p)return r("failed loading "+n+": "+c.message,!0)}if(c)return r(c,!1);var v,y;try{typeof d.data=="string"?v=s.options.parse(d.data,i,o):v=d.data}catch{y="failed parsing "+n+" to json"}if(y)return r(y,!1);r(null,v)})}},{key:"create",value:function(n,r,i,o,s){var a=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,c=[],d=[];n.forEach(function(f){var p=a.options.addPath;typeof a.options.addPath=="function"&&(p=a.options.addPath(f,r));var v=a.services.interpolator.interpolate(p,{lng:f,ns:r});a.options.request(a.options,v,l,function(y,S){u+=1,c.push(y),d.push(S),u===n.length&&typeof s=="function"&&s(c,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,s=r.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){n.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)})})})}}}])}();Pk.type="backend";Qe.use(Pk).use(X4).init({fallbackLng:"de"});var gF=function(e,t,n,r,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=[n,r,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}},yF=gF;const Dv=Zr(yF);var vF=function(t,n,r,i){var o=r?r.call(i,t,n):void 0;if(o!==void 0)return!!o;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var s=Object.keys(t),a=Object.keys(n);if(s.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),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))(Ek||{}),Ad={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"]}},zv=Object.values(Ek),Pm={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},SF=Object.entries(Pm).reduce((e,[t,n])=>(e[n]=t,e),{}),Kt="data-rh",Wi={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Hi=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},xF=e=>{let t=Hi(e,"title");const n=Hi(e,Wi.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=Hi(e,Wi.DEFAULT_TITLE);return t||r||void 0},wF=e=>Hi(e,Wi.ON_CHANGE_CLIENT_STATE)||(()=>{}),Od=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),kF=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const i=Object.keys(r);for(let o=0;oconsole&&typeof console.warn=="function"&&console.warn(e),Mo=(e,t,n)=>{const r={};return n.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&CF(`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 n=0;n({baseTag:kF(["href"],e),bodyAttributes:Od("bodyAttributes",e),defer:Hi(e,Wi.DEFER),encode:Hi(e,Wi.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Od("htmlAttributes",e),linkTags:Mo("link",["rel","href"],e),metaTags:Mo("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Mo("noscript",["innerHTML"],e),onChangeClientState:wF(e),scriptTags:Mo("script",["src","innerHTML"],e),styleTags:Mo("style",["cssText"],e),title:xF(e),titleAttributes:Od("titleAttributes",e),prioritizeSeoTags:TF(e,Wi.PRIORITIZE_SEO_TAGS)}),_k=e=>Array.isArray(e)?e.join(""):e,EF=(e,t)=>{const n=Object.keys(e);for(let r=0;rArray.isArray(e)?e.reduce((n,r)=>(EF(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},Iv=(e,t)=>({...e,[t]:void 0}),_F=["noscript","script","style"],wh=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),$k=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),$F=(e,t,n,r)=>{const i=$k(n),o=_k(t);return i?`<${e} ${Kt}="true" ${i}>${wh(o,r)}`:`<${e} ${Kt}="true">${wh(o,r)}`},RF=(e,t,n=!0)=>t.reduce((r,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}="${wh(o[c],n)}"`;return u?`${u} ${d}`:d},""),a=o.innerHTML||o.cssText||"",l=_F.indexOf(e)===-1;return`${r}<${e} ${Kt}="true" ${s}${l?"/>":`>${a}`}`},""),Rk=(e,t={})=>Object.keys(e).reduce((n,r)=>{const i=Pm[r];return n[i||r]=e[r],n},t),AF=(e,t,n)=>{const r={key:t,[Kt]:!0},i=Rk(n,r);return[an.createElement("title",i,t)]},Pl=(e,t)=>t.map((n,r)=>{const i={key:r,[Kt]:!0};return Object.keys(n).forEach(o=>{const a=Pm[o]||o;if(a==="innerHTML"||a==="cssText"){const l=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[a]=n[o]}),an.createElement(e,i)}),At=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>AF(e,t.title,t.titleAttributes),toString:()=>$F(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Rk(t),toString:()=>$k(t)};default:return{toComponent:()=>Pl(e,t),toString:()=>RF(e,t,n)}}},OF=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const i=Ld(e,Ad.meta),o=Ld(t,Ad.link),s=Ld(n,Ad.script);return{priorityMethods:{toComponent:()=>[...Pl("meta",i.priority),...Pl("link",o.priority),...Pl("script",s.priority)],toString:()=>`${At("meta",i.priority,r)} ${At("link",o.priority,r)} ${At("script",s.priority,r)}`},metaTags:i.default,linkTags:o.default,scriptTags:s.default}},LF=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!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}=OF(e)),{priority:p,base:At("base",t,r),bodyAttributes:At("bodyAttributes",n,r),htmlAttributes:At("htmlAttributes",i,r),link:At("link",c,r),meta:At("meta",d,r),noscript:At("noscript",o,r),script:At("script",f,r),style:At("style",s,r),title:At("title",{title:a,titleAttributes:l},r)}},kh=LF,Ya=[],Ak=!!(typeof window<"u"&&window.document&&window.document.createElement),Ch=class{constructor(e,t){vn(this,"instances",[]);vn(this,"canUseDOM",Ak);vn(this,"context");vn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Ya:this.instances,add:e=>{(this.canUseDOM?Ya:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Ya:this.instances).indexOf(e);(this.canUseDOM?Ya:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=kh({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},MF={},Ok=an.createContext(MF),jr,Lk=(jr=class extends x.Component{constructor(n){super(n);vn(this,"helmetData");this.helmetData=new Ch(this.props.context||{},jr.canUseDOM)}render(){return an.createElement(Ok.Provider,{value:this.helmetData.value},this.props.children)}},vn(jr,"canUseDOM",Ak),jr),ui=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${Kt}]`),i=[].slice.call(r),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(Kt,"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=>n.appendChild(a)),{oldTags:i,newTags:o}},Th=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(Kt),i=r?r.split(","):[],o=[...i],s=Object.keys(t);for(const a of s){const l=t[a]||"";n.getAttribute(a)!==l&&n.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)n.removeAttribute(o[a]);i.length===o.length?n.removeAttribute(Kt):n.getAttribute(Kt)!==s.join(",")&&n.setAttribute(Kt,s.join(","))},DF=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=_k(e)),Th("title",t)},jv=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:o,metaTags:s,noscriptTags:a,onChangeClientState:l,scriptTags:u,styleTags:c,title:d,titleAttributes:f}=e;Th("body",r),Th("html",i),DF(d,f);const p={baseTag:ui("base",n),linkTags:ui("link",o),metaTags:ui("meta",s),noscriptTags:ui("noscript",a),scriptTags:ui("script",u),styleTags:ui("style",c)},v={},y={};Object.keys(p).forEach(S=>{const{newTags:m,oldTags:h}=p[S];m.length&&(v[S]=m),h.length&&(y[S]=p[S].oldTags)}),t&&t(),l(e,v,y)},Do=null,zF=e=>{Do&&cancelAnimationFrame(Do),e.defer?Do=requestAnimationFrame(()=>{jv(e,()=>{Do=null})}):(jv(e),Do=null)},IF=zF,Nv=class extends x.Component{constructor(){super(...arguments);vn(this,"rendered",!1)}shouldComponentUpdate(t){return!bF(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const i=PF(t.get().map(o=>{const s={...o.props};return delete s.context,s}));Lk.canUseDOM?IF(i):kh&&(r=kh(i)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},Dd,jF=(Dd=class extends x.Component{shouldComponentUpdate(e){return!IS(Iv(this.props,"helmetData"),Iv(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,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return Dv(zv.some(n=>e.type===n),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 ${zv.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),Dv(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="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 n={};return an.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:i,...o}=r.props,s=Object.keys(o).reduce((l,u)=>(l[SF[u]||u]=o[u],l),{});let{type:a}=r;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(r,i),a){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,s,i);break;default:t=this.mapObjectTypeChildren(r,t,s,i);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof Ch)){const i=r;r=new Ch(i.context,!0),delete n.helmetData}return r?an.createElement(Nv,{...n,context:r.value}):an.createElement(Ok.Consumer,null,i=>an.createElement(Nv,{...n,context:i}))}},vn(Dd,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Dd);const NF=()=>{const{t:e}=eF(),t=ua(),n=r=>t.pathname===r;return O.jsx(tk,{as:"nav",className:"links",index:n("/")?0:n("/about")?1:-1,children:O.jsxs(nk,{children:[O.jsx(dh,{as:fv,to:"/",isSelected:n("/"),fontSize:"xl",fontWeight:"bold",p:4,children:"OpenPV"},"/"),O.jsx(dh,{as:fv,to:"/about",isSelected:n("/about"),children:e("about.title")},"/about")]})})},Em=e=>O.jsxs(Lk,{children:[O.jsxs(jF,{titleTemplate:"%s | OpenPV",defaultTitle:"OpenPV",defer:!1,children:[e.title&&O.jsx("title",{children:e.title}),O.jsx("meta",{name:"description",content:e.description}),O.jsx("meta",{name:"Beschreibung",content:e.description})]}),O.jsxs(FF,{children:[O.jsx(NF,{}),e.children]})]});Em.propTypes={children:Pr.oneOfType([Pr.arrayOf(Pr.node),Pr.node]),fullPage:Pr.bool,title:Pr.string,description:Pr.string};Em.defaultProps={children:null,fullPage:!1,title:null,description:"Ermittle das Potential für eine Solaranlage."};const FF=({children:e})=>O.jsx(ch,{as:"div",display:"flex",margin:"0",maxWidth:"100%",opacity:1,padding:0,width:"100vw",height:"100vh",position:"fixed",left:0,top:0,flexDirection:"column",children:O.jsx(ch,{display:"flex",flexDirection:"column",justifyContent:"space-between",minWidth:0,minHeight:0,overflow:"hidden",flexGrow:1,width:"100%",height:"100%",children:e})});var BF={};const{PUBLIC_URL:VF}=BF,UF=x.lazy(()=>ao(()=>import("./Map-B8jw3anQ.js"),__vite__mapDeps([0,1,2,3,4]))),WF=x.lazy(()=>ao(()=>import("./Simulation-Bjnv8os2.js").then(e=>e.S),__vite__mapDeps([5,6,1,2,7]))),HF=x.lazy(()=>ao(()=>import("./NotFound-DujQ5K-T.js"),[])),KF=x.lazy(()=>ao(()=>import("./Impressum-B9uORefi.js"),__vite__mapDeps([8,6]))),GF=x.lazy(()=>ao(()=>import("./Datenschutz-BrIseX2Y.js"),__vite__mapDeps([9,6]))),Fv=x.lazy(()=>ao(()=>import("./About-BJ53y4VU.js"),__vite__mapDeps([10,1,6,7,3])));window.isTouchDevice=qF();const Bv=()=>O.jsx(Uj,{children:O.jsx(an.StrictMode,{children:O.jsx(d4,{basename:VF,children:O.jsx(x.Suspense,{fallback:O.jsx(Em,{}),children:O.jsxs(i4,{children:[O.jsx(Gn,{path:"/",element:O.jsx(UF,{})}),O.jsx(Gn,{path:"/simulation/:lon/:lat",element:O.jsx(WF,{})}),O.jsx(Gn,{path:"/anleitung",element:O.jsx(Fv,{})}),O.jsx(Gn,{path:"/about",element:O.jsx(Fv,{})}),O.jsx(Gn,{path:"/impressum",element:O.jsx(KF,{})}),O.jsx(Gn,{path:"/datenschutz",element:O.jsx(GF,{})}),O.jsx(Gn,{path:"*",element:O.jsx(HF,{})})]})})})})}),Md=document.getElementById("root");Md.hasChildNodes()?rk(Md,O.jsx(Bv,{})):ik(Md).render(O.jsx(Bv,{}));function qF(){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{FS as $,Hz as A,ch as B,r5 as C,NS as D,DT as E,JF as F,AT as G,Zr as H,Ol as I,ra as J,VS as K,KS as L,Em as M,HS as N,aB as O,ac as P,tB as Q,an as R,Lk as S,jF as T,fv as U,oB as V,Gt as W,bT as X,ZF as Y,QF as Z,ao as _,EI as a,eB as a0,ZM as a1,v1 as a2,Qe as a3,nB as a4,Cn as a5,sB as b,it as c,x as d,wm as e,Fn as f,eF as g,UN as h,YF as i,O as j,Ja as k,Nn as l,Fz as m,Nd as n,S1 as o,ng as p,xT as q,ln as r,jd as s,is as t,gI as u,bu as v,$p as w,xu as x,Qt as y,mI as z}; diff --git a/assets/lerc-DtKC9ro-.js b/assets/lerc-BoocAjbe.js similarity index 99% rename from assets/lerc-DtKC9ro-.js rename to assets/lerc-BoocAjbe.js index 57d718e..d6fe110 100644 --- a/assets/lerc-DtKC9ro-.js +++ b/assets/lerc-BoocAjbe.js @@ -1 +1 @@ -import{L as oA,a as gA,i as sA}from"./Simulation-x5IYgVeF.js";import{H as DA}from"./index-CtCGTwpN.js";import{B as nA}from"./basedecoder-DvumDe3Y.js";import"./heading-eSNaMiYV.js";import"./Footer-BC_OGLFm.js";import"./location-Bzn15Ms3.js";import"./stack-DvvG7f8C.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-Bjnv8os2.js";import{H as DA}from"./index-DZP_WaxS.js";import{B as nA}from"./basedecoder-DvumDe3Y.js";import"./heading-D46BZoGw.js";import"./Footer-C3QM0Uoc.js";import"./location-BMuwxVaI.js";import"./stack-D-KFs-Nt.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-Bzn15Ms3.js b/assets/location-BMuwxVaI.js similarity index 97% rename from assets/location-Bzn15Ms3.js rename to assets/location-BMuwxVaI.js index d63682a..daa0dbe 100644 --- a/assets/location-Bzn15Ms3.js +++ b/assets/location-BMuwxVaI.js @@ -1 +1 @@ -import{y as q,f as b,D as N,x as j,l as C,j as y,c as I,d as u,v as g,q as m,F as k,s as M,Q as B}from"./index-CtCGTwpN.js";import{j as E}from"./Footer-BC_OGLFm.js";const[A,W]=q({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[G,w]=q({strict:!1,name:"FormControlContext"});function Q(s){const{id:e,isRequired:a,isInvalid:t,isDisabled:o,isReadOnly:r,...l}=s,c=u.useId(),n=e||`field-${c}`,h=`${n}-label`,f=`${n}-feedback`,x=`${n}-helptext`,[v,p]=u.useState(!1),[S,P]=u.useState(!1),[F,R]=u.useState(!1),D=u.useCallback((i={},d=null)=>({id:x,...i,ref:g(d,_=>{_&&P(!0)})}),[x]),O=u.useCallback((i={},d=null)=>({...i,ref:d,"data-focus":m(F),"data-disabled":m(o),"data-invalid":m(t),"data-readonly":m(r),id:i.id!==void 0?i.id:h,htmlFor:i.htmlFor!==void 0?i.htmlFor:n}),[n,o,F,t,r,h]),$=u.useCallback((i={},d=null)=>({id:f,...i,ref:g(d,_=>{_&&p(!0)}),"aria-live":"polite"}),[f]),L=u.useCallback((i={},d=null)=>({...i,...l,ref:d,role:"group","data-focus":m(F),"data-disabled":m(o),"data-invalid":m(t),"data-readonly":m(r)}),[l,o,F,t,r]),z=u.useCallback((i={},d=null)=>({...i,ref:d,role:"presentation","aria-hidden":!0,children:i.children||"*"}),[]);return{isRequired:!!a,isInvalid:!!t,isReadOnly:!!r,isDisabled:!!o,isFocused:!!F,onFocus:()=>R(!0),onBlur:()=>R(!1),hasFeedbackText:v,setHasFeedbackText:p,hasHelpText:S,setHasHelpText:P,id:n,labelId:h,feedbackId:f,helpTextId:x,htmlProps:l,getHelpTextProps:D,getErrorMessageProps:$,getRootProps:L,getLabelProps:O,getRequiredIndicatorProps:z}}const X=b(function(e,a){const t=N("Form",e),o=j(e),{getRootProps:r,htmlProps:l,...c}=Q(o),n=C("chakra-form-control",e.className);return y.jsx(G,{value:c,children:y.jsx(A,{value:t,children:y.jsx(I.div,{...r({},a),className:n,__css:t.container})})})});X.displayName="FormControl";const Y=b(function(e,a){const t=w(),o=W(),r=C("chakra-form__helper-text",e.className);return y.jsx(I.div,{...t==null?void 0:t.getHelpTextProps(e,a),__css:o.helperText,className:r})});Y.displayName="FormHelperText";function J(s){const{isDisabled:e,isInvalid:a,isReadOnly:t,isRequired:o,...r}=K(s);return{...r,disabled:e,readOnly:t,required:o,"aria-invalid":k(a),"aria-required":k(o),"aria-readonly":k(t)}}function K(s){const e=w(),{id:a,disabled:t,readOnly:o,required:r,isRequired:l,isInvalid:c,isReadOnly:n,isDisabled:h,onFocus:f,onBlur:x,...v}=s,p=s["aria-describedby"]?[s["aria-describedby"]]:[];return e!=null&&e.hasFeedbackText&&(e!=null&&e.isInvalid)&&p.push(e.feedbackId),e!=null&&e.hasHelpText&&p.push(e.helpTextId),{...v,"aria-describedby":p.join(" ")||void 0,id:a??(e==null?void 0:e.id),isDisabled:t??h??(e==null?void 0:e.isDisabled),isReadOnly:o??n??(e==null?void 0:e.isReadOnly),isRequired:r??l??(e==null?void 0:e.isRequired),isInvalid:c??(e==null?void 0:e.isInvalid),onFocus:M(e==null?void 0:e.onFocus,f),onBlur:M(e==null?void 0:e.onBlur,x)}}const H=b(function(e,a){const{htmlSize:t,...o}=e,r=N("Input",o),l=j(o),c=J(l),n=C("chakra-input",e.className);return y.jsx(I.input,{size:t,...c,__css:r.field,ref:a,className:n})});H.displayName="Input";H.id="Input";const U=b((s,e)=>{const{className:a,...t}=s,o=C("chakra-modal__footer",a),r=E(),l=B({display:"flex",alignItems:"center",justifyContent:"flex-end",...r.footer});return y.jsx(I.footer,{ref:e,...t,__css:l,className:o})});U.displayName="ModalFooter";var V,Z,ee;async function ne(s){let e=te(s);return e.length==0&&(e=se(s)),e}function te(s){if(/^[-]?(\d+(\.\d+)?),\s*[-]?(\d+(\.\d+)?)$/.test(s)){const[e,a]=s.split(",").map(t=>parseFloat(t.trim()));return[{lat:e,lon:a,display_name:`${e},${a}`,key:"coordinates"}]}else return[]}async function se(s){let e="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(s).concat("+Germany"),a=await T(e);return a||(e="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(s.split(" ").join("+")),a=await T(e)),a.map(t=>({lat:t.lat,lon:t.lon,key:t.place_id,display_name:oe(t.address)}))}function oe(s){return(s.road||"")+" "+(s.house_number||"")+", "+(s.postcode||"")+" "+(s.city||"")}async function T(s){try{const e=await fetch(s);if(!e.ok)throw new Error(`Request failed with status ${e.status}`);return await e.json()}catch(e){return console.error("Error:",e),[]}}function ie(s,e){Z=[s,e];const a=e*Math.PI/180,t=Math.pow(2,15),o=t*((s+180)/360),r=t*(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2;return V=[o,r],ee=[1222.992452*o-2003750834e-2,2003750834e-2-1222.992452*r],[o,r]}function le(s,e,a){const t=4007501668e-2,o=t/Math.pow(2,a),r=o*s-t/2,l=r+o,c=t/2-o*e,n=c-o;return[r,c,l,n]}export{X as F,H as I,U as M,w as a,W as b,Z as c,ee as d,V as e,ie as p,ne as r,K as u,le as x}; +import{y as q,f as b,D as N,x as j,l as C,j as y,c as I,d as u,v as g,q as m,F as k,s as M,Q as B}from"./index-DZP_WaxS.js";import{j as E}from"./Footer-C3QM0Uoc.js";const[A,W]=q({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[G,w]=q({strict:!1,name:"FormControlContext"});function Q(s){const{id:e,isRequired:a,isInvalid:t,isDisabled:o,isReadOnly:r,...l}=s,c=u.useId(),n=e||`field-${c}`,h=`${n}-label`,f=`${n}-feedback`,x=`${n}-helptext`,[v,p]=u.useState(!1),[S,P]=u.useState(!1),[F,R]=u.useState(!1),D=u.useCallback((i={},d=null)=>({id:x,...i,ref:g(d,_=>{_&&P(!0)})}),[x]),O=u.useCallback((i={},d=null)=>({...i,ref:d,"data-focus":m(F),"data-disabled":m(o),"data-invalid":m(t),"data-readonly":m(r),id:i.id!==void 0?i.id:h,htmlFor:i.htmlFor!==void 0?i.htmlFor:n}),[n,o,F,t,r,h]),$=u.useCallback((i={},d=null)=>({id:f,...i,ref:g(d,_=>{_&&p(!0)}),"aria-live":"polite"}),[f]),L=u.useCallback((i={},d=null)=>({...i,...l,ref:d,role:"group","data-focus":m(F),"data-disabled":m(o),"data-invalid":m(t),"data-readonly":m(r)}),[l,o,F,t,r]),z=u.useCallback((i={},d=null)=>({...i,ref:d,role:"presentation","aria-hidden":!0,children:i.children||"*"}),[]);return{isRequired:!!a,isInvalid:!!t,isReadOnly:!!r,isDisabled:!!o,isFocused:!!F,onFocus:()=>R(!0),onBlur:()=>R(!1),hasFeedbackText:v,setHasFeedbackText:p,hasHelpText:S,setHasHelpText:P,id:n,labelId:h,feedbackId:f,helpTextId:x,htmlProps:l,getHelpTextProps:D,getErrorMessageProps:$,getRootProps:L,getLabelProps:O,getRequiredIndicatorProps:z}}const X=b(function(e,a){const t=N("Form",e),o=j(e),{getRootProps:r,htmlProps:l,...c}=Q(o),n=C("chakra-form-control",e.className);return y.jsx(G,{value:c,children:y.jsx(A,{value:t,children:y.jsx(I.div,{...r({},a),className:n,__css:t.container})})})});X.displayName="FormControl";const Y=b(function(e,a){const t=w(),o=W(),r=C("chakra-form__helper-text",e.className);return y.jsx(I.div,{...t==null?void 0:t.getHelpTextProps(e,a),__css:o.helperText,className:r})});Y.displayName="FormHelperText";function J(s){const{isDisabled:e,isInvalid:a,isReadOnly:t,isRequired:o,...r}=K(s);return{...r,disabled:e,readOnly:t,required:o,"aria-invalid":k(a),"aria-required":k(o),"aria-readonly":k(t)}}function K(s){const e=w(),{id:a,disabled:t,readOnly:o,required:r,isRequired:l,isInvalid:c,isReadOnly:n,isDisabled:h,onFocus:f,onBlur:x,...v}=s,p=s["aria-describedby"]?[s["aria-describedby"]]:[];return e!=null&&e.hasFeedbackText&&(e!=null&&e.isInvalid)&&p.push(e.feedbackId),e!=null&&e.hasHelpText&&p.push(e.helpTextId),{...v,"aria-describedby":p.join(" ")||void 0,id:a??(e==null?void 0:e.id),isDisabled:t??h??(e==null?void 0:e.isDisabled),isReadOnly:o??n??(e==null?void 0:e.isReadOnly),isRequired:r??l??(e==null?void 0:e.isRequired),isInvalid:c??(e==null?void 0:e.isInvalid),onFocus:M(e==null?void 0:e.onFocus,f),onBlur:M(e==null?void 0:e.onBlur,x)}}const H=b(function(e,a){const{htmlSize:t,...o}=e,r=N("Input",o),l=j(o),c=J(l),n=C("chakra-input",e.className);return y.jsx(I.input,{size:t,...c,__css:r.field,ref:a,className:n})});H.displayName="Input";H.id="Input";const U=b((s,e)=>{const{className:a,...t}=s,o=C("chakra-modal__footer",a),r=E(),l=B({display:"flex",alignItems:"center",justifyContent:"flex-end",...r.footer});return y.jsx(I.footer,{ref:e,...t,__css:l,className:o})});U.displayName="ModalFooter";var V,Z,ee;async function ne(s){let e=te(s);return e.length==0&&(e=se(s)),e}function te(s){if(/^[-]?(\d+(\.\d+)?),\s*[-]?(\d+(\.\d+)?)$/.test(s)){const[e,a]=s.split(",").map(t=>parseFloat(t.trim()));return[{lat:e,lon:a,display_name:`${e},${a}`,key:"coordinates"}]}else return[]}async function se(s){let e="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(s).concat("+Germany"),a=await T(e);return a||(e="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(s.split(" ").join("+")),a=await T(e)),a.map(t=>({lat:t.lat,lon:t.lon,key:t.place_id,display_name:oe(t.address)}))}function oe(s){return(s.road||"")+" "+(s.house_number||"")+", "+(s.postcode||"")+" "+(s.city||"")}async function T(s){try{const e=await fetch(s);if(!e.ok)throw new Error(`Request failed with status ${e.status}`);return await e.json()}catch(e){return console.error("Error:",e),[]}}function ie(s,e){Z=[s,e];const a=e*Math.PI/180,t=Math.pow(2,15),o=t*((s+180)/360),r=t*(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2;return V=[o,r],ee=[1222.992452*o-2003750834e-2,2003750834e-2-1222.992452*r],[o,r]}function le(s,e,a){const t=4007501668e-2,o=t/Math.pow(2,a),r=o*s-t/2,l=r+o,c=t/2-o*e,n=c-o;return[r,c,l,n]}export{X as F,H as I,U as M,w as a,W as b,Z as c,ee as d,V as e,ie as p,ne as r,K as u,le as x}; diff --git a/assets/maplibre-gl-CZHzs_cP.js b/assets/maplibre-gl-w1doICML.js similarity index 99% rename from assets/maplibre-gl-CZHzs_cP.js rename to assets/maplibre-gl-w1doICML.js index 6a5a463..293f2f4 100644 --- a/assets/maplibre-gl-CZHzs_cP.js +++ b/assets/maplibre-gl-w1doICML.js @@ -1,4 +1,4 @@ -import{H as zp,a5 as Ep}from"./index-CtCGTwpN.js";function Dp(Ta,Fl){for(var Fr=0;Frki[Or]})}}}return Object.freeze(Object.defineProperty(Ta,Symbol.toStringTag,{value:"Module"}))}var Bu={exports:{}};/** +import{H as zp,a5 as Ep}from"./index-DZP_WaxS.js";function Dp(Ta,Fl){for(var Fr=0;Frki[Or]})}}}return Object.freeze(Object.defineProperty(Ta,Symbol.toStringTag,{value:"Module"}))}var Bu={exports:{}};/** * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt */(function(Ta,Fl){(function(Fr,ki){Ta.exports=ki()})(Ep,function(){var Fr={},ki={};function Or(L,p,zi){if(ki[L]=zi,L==="index"){var Xi="var sharedModule = {}; ("+ki.shared+")(sharedModule); ("+ki.worker+")(sharedModule);",Gt={};return ki.shared(Gt),ki.index(Fr,Gt),typeof window<"u"&&Fr.setWorkerUrl(window.URL.createObjectURL(new Blob([Xi],{type:"text/javascript"}))),Fr}}Or("shared",["exports"],function(L){function p(i,t,r,s){return new(r||(r=Promise))(function(l,u){function d(x){try{_(s.next(x))}catch(v){u(v)}}function f(x){try{_(s.throw(x))}catch(v){u(v)}}function _(x){var v;x.done?l(x.value):(v=x.value,v instanceof r?v:new r(function(w){w(v)})).then(d,f)}_((s=s.apply(i,t||[])).next())})}function zi(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Xi=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 me=zi(Xi),se=Vr;function Vr(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}Vr.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 br=zi(se);let Wi,wr;function hr(){return Wi==null&&(Wi=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Wi}function Hn(){if(wr==null&&(wr=!1,hr())){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){wr=!0;break}}}return wr||!1}function hi(i,t,r,s){const l=new br(i,t,r,s);return u=>l.solve(u)}const Ia=hi(.25,.1,.25,1);function Ei(i,t,r){return Math.min(r,Math.max(t,i))}function Ki(i,t,r){const s=r-t,l=((i-t)%s+s)%s+t;return l===t?r:l}function vi(i,...t){for(const r of t)for(const s in r)i[s]=r[s];return i}let Ps=1;function Ji(i,t,r){const s={};for(const l in i)s[l]=t.call(this,i[l],l,i);return s}function Xn(i,t,r){const s={};for(const l in i)t.call(this,i[l],l,i)&&(s[l]=i[l]);return s}function st(i){return Array.isArray(i)?i.map(st):typeof i=="object"&&i?Ji(i,st):i}const As={};function Ft(i){As[i]||(typeof console<"u"&&console.warn(i),As[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 ur(i){return typeof WorkerGlobalScope<"u"&&i!==void 0&&i instanceof WorkerGlobalScope}let ln=null;function Yi(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const Ms="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Nr(i,t,r,s,l){return p(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const u=new VideoFrame(i,{timestamp:0});try{const d=u==null?void 0:u.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 u.copyTo(_,function(x,v,w,I,M){const k=4*Math.max(-v,0),z=(Math.max(0,w)-w)*I*4+k,F=4*I,j=Math.max(0,v),Q=Math.max(0,w);return{rect:{x:j,y:Q,width:Math.min(x.width,v+I)-j,height:Math.min(x.height,w+M)-Q},layout:[{offset:z,stride:F}]}}(i,t,r,s,l)),f)for(let x=0;x<_.length;x+=4){const v=_[x];_[x]=_[x+2],_[x+2]=v}return _}finally{u.close()}})}let dr,ei;const Di="AbortError";function cn(){return new Error(Di)}const Tr={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Qi(i){return Tr.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))]}const hn="global-dispatcher";class ui 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 Li=()=>ur(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,jr=function(i,t){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const s=Qi(i.url);if(s)return s(i,t);if(ur(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(Li())&&!/^\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 u=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,cache:s.cache,referrer:Li(),signal:l.signal});s.type!=="json"||u.headers.has("Accept")||u.headers.set("Accept","application/json");const d=yield fetch(u);if(!d.ok){const x=yield d.blob();throw new ui(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(ur(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((u,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(v){return void d(v)}u({data:x,cacheControl:_.getResponseHeader("Cache-Control"),expires:_.getResponseHeader("Expires")})}else{const x=new Blob([_.response],{type:_.getResponseHeader("Content-Type")});d(new ui(_.status,_.statusText,s.url,x))}},l.signal.addEventListener("abort",()=>{_.abort(),d(cn())}),_.send(s.body)})}(i,t)};function Ur(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 Wn(i,t,r){r[i]&&r[i].indexOf(t)!==-1||(r[i]=r[i]||[],r[i].push(t))}function pr(i,t,r){if(r&&r[i]){const s=r[i].indexOf(t);s!==-1&&r[i].splice(s,1)}}class Sr{constructor(t,r={}){vi(this,r),this.type=t}}class Ir extends Sr{constructor(t,r={}){super("error",vi({error:t},r))}}class un{on(t,r){return this._listeners=this._listeners||{},Wn(t,r,this._listeners),this}off(t,r){return pr(t,r,this._listeners),pr(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Wn(t,r,this._oneTimeListeners),this):new Promise(s=>this.once(t,s))}fire(t,r){typeof t=="string"&&(t=new Sr(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 u=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const f of u)pr(s,f,this._oneTimeListeners),f.call(this,t);const d=this._eventedParent;d&&(vi(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(t))}else t instanceof Ir&&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 $r=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Kn(i,t){const r={};for(const s in i)s!=="ref"&&(r[s]=i[s]);return $r.forEach(s=>{s in t&&(r[s]=t[s])}),r}function et(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 D=[Ar,_e,$e,Be,ti,mr,Ri,A(Ne),Mr,rr,N];function O(i,t){if(t.kind==="error")return null;if(i.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!O(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 D)if(!O(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 W(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 Y(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,de=3*te*te,Ee=te*te*te,De=Math.PI/180,Ke=180/Math.PI;function je(i){return(i%=360)<0&&(i+=360),i}function Je([i,t,r,s]){let l,u;const d=Pt((.2225045*(i=Ge(i))+.7168786*(t=Ge(t))+.0606169*(r=Ge(r)))/1);i===t&&t===r?l=u=d:(l=Pt((.4360747*i+.3850649*t+.1430804*r)/q),u=Pt((.0139322*i+.0971045*t+.7141733*r)/ne));const f=116*d-16;return[f<0?0:f,500*(l-d),200*(d-u),s]}function Ge(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Pt(i){return i>Ee?Math.pow(i,1/3):i/de+le}function xt([i,t,r,s]){let l=(i+16)/116,u=isNaN(t)?l:l+t/500,d=isNaN(r)?l:l-r/200;return l=1*rt(l),u=q*rt(u),d=ne*rt(d),[qe(3.1338561*u-1.6168667*l-.4906146*d),qe(-.9787684*u+1.9161415*l+.033454*d),qe(.0719453*u-.2289914*l+1.4052427*d),s]}function qe(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function rt(i){return i>te?i*i*i:de*(i-le)}function gt(i){return parseInt(i.padEnd(2,i),16)/255}function kt(i,t){return Lt(t?i/100:i,0,1)}function Lt(i,t,r){return Math.min(Math.max(t,i),r)}function Wt(i){return!i.some(Number.isNaN)}const pn={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 nt{constructor(t,r,s,l=1,u=!0){this.r=t,this.g=r,this.b=s,this.a=l,u||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[t,r,s,l]))}static parse(t){if(t instanceof nt)return t;if(typeof t!="string")return;const r=function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const l=pn[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[gt(s.slice(f,f+=d)),gt(s.slice(f,f+=d)),gt(s.slice(f,f+=d)),gt(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,v,w,I,M,k,z,F,j,Q]=d,G=[v||" ",M||" ",F].join("");if(G===" "||G===" /"||G===",,"||G===",,,"){const J=[x,I,z].join(""),re=J==="%%%"?100:J===""?255:0;if(re){const ce=[Lt(+_/re,0,1),Lt(+w/re,0,1),Lt(+k/re,0,1),j?kt(+j,Q):1];if(Wt(ce))return ce}}return}}const u=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[d,f,_,x,v,w,I,M,k]=u,z=[_||" ",v||" ",I].join("");if(z===" "||z===" /"||z===",,"||z===",,,"){const F=[+f,Lt(+x,0,100),Lt(+w,0,100),M?kt(+M,k):1];if(Wt(F))return function([j,Q,G,J]){function re(ce){const we=(ce+j/30)%12,Le=Q*Math.min(G,1-G);return G-Le*Math.max(-1,Math.min(we-3,9-we,1))}return j=je(j),Q/=100,G/=100,[re(0),re(8),re(4),J]}(F)}}}(t);return r?new nt(...r,!1):void 0}get rgb(){const{r:t,g:r,b:s,a:l}=this,u=l||1/0;return this.overwriteGetter("rgb",[t/u,r/u,s/u,l])}get hcl(){return this.overwriteGetter("hcl",function(t){const[r,s,l,u]=Je(t),d=Math.sqrt(s*s+l*l);return[Math.round(1e4*d)?je(Math.atan2(l,s)*Ke):NaN,d,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Je(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(u=>Math.round(255*u)).join(",")},${l})`}}nt.black=new nt(0,0,0,1),nt.white=new nt(1,1,1,1),nt.transparent=new nt(0,0,0,0),nt.red=new nt(1,0,0,1);class Pa{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 Aa{constructor(t,r,s,l,u){this.text=t,this.image=r,this.scale=s,this.fontStack=l,this.textColor=u}}class di{constructor(t){this.sections=t}static fromString(t){return new di([new Aa(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 di?t:di.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class pi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof pi)return t;if(typeof t=="number")return new pi([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 pi(t)}}toString(){return JSON.stringify(this.values)}}const Ol=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class wi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof wi)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 qr(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof nt||i instanceof Pa||i instanceof di||i instanceof pi||i instanceof wi||i instanceof fi)return!0;if(Array.isArray(i)){for(const t of i)if(!qr(t))return!1;return!0}if(typeof i=="object"){for(const t in i)if(!qr(i[t]))return!1;return!0}return!1}function At(i){if(i===null)return Ar;if(typeof i=="string")return $e;if(typeof i=="boolean")return Be;if(typeof i=="number")return _e;if(i instanceof nt)return ti;if(i instanceof Pa)return ir;if(i instanceof di)return mr;if(i instanceof pi)return Mr;if(i instanceof wi)return N;if(i instanceof fi)return rr;if(Array.isArray(i)){const t=i.length;let r;for(const s of i){const l=At(s);if(r){if(r===l)continue;r=Ne;break}r=l}return A(r||Ne,t)}return Ri}function es(i){const t=typeof i;return i===null?"":t==="string"||t==="number"||t==="boolean"?String(i):i instanceof nt||i instanceof di||i instanceof pi||i instanceof wi||i instanceof fi?i.toString():JSON.stringify(i)}class Bi{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(!qr(t[1]))return r.error("invalid value");const s=t[1];let l=At(s);const u=r.expectedType;return l.kind!=="array"||l.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(l=u),new Bi(l,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class St{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Cs={string:$e,number:_e,boolean:Be,object:Ri};class Fi{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 u=t[0];if(u==="array"){let f,_;if(t.length>2){const x=t[1];if(typeof x!="string"||!(x in Cs)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=Cs[x],l++}else f=Ne;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(!Cs[u])throw new Error(`Types doesn't contain name = ${u}`);s=Cs[u]}const d=[];for(;lt.outputDefined())}}const Ma={"to-boolean":Be,"to-color":ti,"to-number":_e,"to-string":$e};class Oi{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(!Ma[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=Ma[s],u=[];for(let d=1;d4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:fn(r[0],r[1],r[2],r[3]),!s))return new nt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new St(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=pi.parse(r);if(l)return l}throw new St(`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=wi.parse(r);if(l)return l}throw new St(`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 St(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return di.fromString(es(this.args[0].evaluate(t)));case"resolvedImage":return fi.fromString(es(this.args[0].evaluate(t)));default:return es(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Vl=["Unknown","Point","LineString","Polygon"];class ks{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"?Vl[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]=nt.parse(t)),r}}class Zr{constructor(t,r,s=[],l,u=new tr,d=[]){this.registry=t,this.path=s,this.key=s.map(f=>`[${f}]`).join(""),this.scope=u,this.errors=d,this.expectedType=l,this._isConstant=r}parse(t,r,s,l,u={}){return r?this.concat(r,s,l)._parse(t,u):this._parse(t,u)}_parse(t,r){function s(l,u,d){return d==="assert"?new Fi(u,[l]):d==="coerce"?new Oi(u,[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 u=this.registry[l];if(u){let d=u.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 Bi)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new ks;try{d=new Bi(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,u=s?this.scope.concat(s):this.scope;return new Zr(this.registry,this._isConstant,l,r||null,u,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=O(t,r);return s&&this.error(s),s}}class Cr{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 u=1;u=s.length)throw new St(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new St(`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 ka{constructor(t,r){this.type=Be,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,Ne),l=r.parse(t[2],2,Ne);return s&&l?H(s.type,[Be,$e,_e,Ar,Ne])?new ka(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(!W(r,["boolean","string","number","null"]))throw new St(`Expected first argument to be of type boolean, string, number or null, but found ${P(At(r))} instead.`);if(!W(s,["string","array"]))throw new St(`Expected second argument to be of type array or string, but found ${P(At(s))} instead.`);return s.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class mn{constructor(t,r,s){this.type=_e,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,Ne),l=r.parse(t[2],2,Ne);if(!s||!l)return null;if(!H(s.type,[Be,$e,_e,Ar,Ne]))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 u=r.parse(t[3],3,_e);return u?new mn(s,l,u):null}return new mn(s,l)}evaluate(t){const r=this.needle.evaluate(t),s=this.haystack.evaluate(t);if(!W(r,["boolean","string","number","null"]))throw new St(`Expected first argument to be of type boolean, string, number or null, but found ${P(At(r))} instead.`);let l;if(this.fromIndex&&(l=this.fromIndex.evaluate(t)),W(s,["string"])){const u=s.indexOf(r,l);return u===-1?-1:[...s.slice(0,u)].length}if(W(s,["array"]))return s.indexOf(r,l);throw new St(`Expected second argument to be of type array or string, but found ${P(At(s))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class za{constructor(t,r,s,l,u,d){this.inputType=t,this.type=r,this.input=s,this.cases=l,this.outputs=u,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 u={},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,At(k)))return null}else s=At(k);if(u[String(k)]!==void 0)return I.error("Branch labels must be unique.");u[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,Ne);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 za(s,l,f,u,d,_):null}evaluate(t){const r=this.input.evaluate(t);return(At(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 zs{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 ts{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,Ne),l=r.parse(t[2],2,_e);if(!s||!l)return null;if(!H(s.type,[A(Ne),$e,Ne]))return r.error(`Expected first argument to be of type array or string, but found ${P(s.type)} instead`);if(t.length===4){const u=r.parse(t[3],3,_e);return u?new ts(s.type,s,l,u):null}return new ts(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)),W(r,["string"]))return[...r].slice(s,l).join("");if(W(r,["array"]))return r.slice(s,l);throw new St(`Expected first argument to be of type array or string, but found ${P(At(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Es(i,t){const r=i.length-1;let s,l,u=0,d=r,f=0;for(;u<=d;)if(f=Math.floor((u+d)/2),s=i[f],l=i[f+1],s<=t){if(f===r||tt))throw new St("Input is not a number.");d=f-1}return 0}class _n{constructor(t,r,s){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(const[l,u]of s)this.labels.push(l),this.outputs.push(u)}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,_e);if(!s)return null;const l=[];let u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=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(_,v,u);if(!w)return null;u=u||w.type,l.push([f,w])}return new _n(u,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 u=r.length;return l>=r[u-1]?s[u-1].evaluate(t):s[Es(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 Ro(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Nl=Bo;function Bo(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}Bo.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 jl=Ro(Nl);function Gr(i,t,r){return i+r*(t-i)}function is(i,t,r){return i.map((s,l)=>Gr(s,t[l],r))}const ii={number:Gr,color:function(i,t,r,s="rgb"){switch(s){case"rgb":{const[l,u,d,f]=is(i.rgb,t.rgb,r);return new nt(l,u,d,f,!1)}case"hcl":{const[l,u,d,f]=i.hcl,[_,x,v,w]=t.hcl;let I,M;if(isNaN(l)||isNaN(_))isNaN(l)?isNaN(_)?I=NaN:(I=_,d!==1&&d!==0||(M=x)):(I=l,v!==1&&v!==0||(M=u));else{let Q=_-l;_>l&&Q>180?Q-=360:_180&&(Q+=360),I=l+r*Q}const[k,z,F,j]=function([Q,G,J,re]){return Q=isNaN(Q)?0:Q*De,xt([J,Math.cos(Q)*G,Math.sin(Q)*G,re])}([I,M??Gr(u,x,r),Gr(d,v,r),Gr(f,w,r)]);return new nt(k,z,F,j,!1)}case"lab":{const[l,u,d,f]=xt(is(i.lab,t.lab,r));return new nt(l,u,d,f,!1)}}},array:is,padding:function(i,t,r){return new pi(is(i.values,t.values,r))},variableAnchorOffsetCollection:function(i,t,r){const s=i.values,l=t.values;if(s.length!==l.length)throw new St(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${t.toString()}`);const u=[];for(let d=0;dtypeof v!="number"||v<0||v>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(u=r.parse(u,2,_e),!u)return null;const f=[];let _=null;s==="interpolate-hcl"||s==="interpolate-lab"?_=ti:r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType);for(let x=0;x=v)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([v,k])}return Y(_,_e)||Y(_,ti)||Y(_,Mr)||Y(_,N)||Y(_,A(_e))?new ri(_,s,l,u,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 u=r.length;if(l>=r[u-1])return s[u-1].evaluate(t);const d=Es(r,l),f=ri.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 ii[this.type.kind](_,x,f);case"interpolate-hcl":return ii.color(_,x,f,"hcl");case"interpolate-lab":return ii.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 Ds(i,t,r,s){const l=s-r,u=i-r;return l===0?0:t===1?u/l:(Math.pow(t,u)-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 u=[];for(const f of t.slice(1)){const _=r.parse(f,1+u.length,s,void 0,{typeAnnotation:"omit"});if(!_)return null;s=s||_.type,u.push(_)}if(!s)throw new Error("No output type");const d=l&&u.some(f=>O(l,f.type));return new Ls(d?Ne:s,u)}evaluate(t){let r,s=null,l=0;for(const u of this.args)if(l++,s=u.evaluate(t),s&&s instanceof fi&&!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 Rs(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 Fo(i,t,r,s){return s.compare(t,r)===0}function gn(i,t,r){const s=i!=="=="&&i!=="!=";return class Fu{constructor(u,d,f){this.type=Be,this.lhs=u,this.rhs=d,this.collator=f,this.hasUntypedArgument=u.type.kind==="value"||d.type.kind==="value"}static parse(u,d){if(u.length!==3&&u.length!==4)return d.error("Expected two or three arguments.");const f=u[0];let _=d.parse(u[1],1,Ne);if(!_)return null;if(!Rs(f,_.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${P(_.type)}'.`);let x=d.parse(u[2],2,Ne);if(!x)return null;if(!Rs(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 Fi(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new Fi(_.type,[x])));let v=null;if(u.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(v=d.parse(u[3],3,ir),!v)return null}return new Fu(_,x,v)}evaluate(u){const d=this.lhs.evaluate(u),f=this.rhs.evaluate(u);if(s&&this.hasUntypedArgument){const _=At(d),x=At(f);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new St(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const _=At(d),x=At(f);if(_.kind!=="string"||x.kind!=="string")return t(u,d,f)}return this.collator?r(u,d,f,this.collator.evaluate(u)):t(u,d,f)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}const Ul=gn("==",function(i,t,r){return t===r},Fo),Oo=gn("!=",function(i,t,r){return t!==r},function(i,t,r,s){return!Fo(0,t,r,s)}),Vo=gn("<",function(i,t,r){return t",function(i,t,r){return t>r},function(i,t,r,s){return s.compare(t,r)>0}),ql=gn("<=",function(i,t,r){return t<=r},function(i,t,r,s){return s.compare(t,r)<=0}),No=gn(">=",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=ir,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,Be);if(!l)return null;const u=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,Be);if(!u)return null;let d=null;return s.locale&&(d=r.parse(s.locale,1,$e),!d)?null:new rs(l,u,d)}evaluate(t){return new Pa(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 Ea{constructor(t,r,s,l,u){this.type=$e,this.number=t,this.locale=r,this.currency=s,this.minFractionDigits=l,this.maxFractionDigits=u}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");const s=r.parse(t[1],1,_e);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 u=null;if(l.locale&&(u=r.parse(l.locale,1,$e),!u))return null;let d=null;if(l.currency&&(d=r.parse(l.currency,1,$e),!d))return null;let f=null;if(l["min-fraction-digits"]&&(f=r.parse(l["min-fraction-digits"],1,_e),!f))return null;let _=null;return l["max-fraction-digits"]&&(_=r.parse(l["max-fraction-digits"],1,_e),!_)?null:new Ea(s,u,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=mr,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 u=!1;for(let d=1;d<=t.length-1;++d){const f=t[d];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;let _=null;if(f["font-scale"]&&(_=r.parse(f["font-scale"],1,_e),!_))return null;let x=null;if(f["text-font"]&&(x=r.parse(f["text-font"],1,A($e)),!x))return null;let v=null;if(f["text-color"]&&(v=r.parse(f["text-color"],1,ti),!v))return null;const w=l[l.length-1];w.scale=_,w.font=x,w.textColor=v}else{const _=r.parse(t[d],1,Ne);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'.");u=!0,l.push({content:_,scale:null,font:null,textColor:null})}}return new Bs(l)}evaluate(t){return new di(this.sections.map(r=>{const s=r.content.evaluate(t);return At(s)===rr?new Aa("",s,null,null,null):new Aa(es(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 Da{constructor(t){this.type=rr,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");const s=r.parse(t[1],1,$e);return s?new Da(s):r.error("No image name provided.")}evaluate(t){const r=this.input.evaluate(t),s=fi.fromString(r);return s&&t.availableImages&&(s.available=t.availableImages.indexOf(r)>-1),s}eachChild(t){t(this.input)}outputDefined(){return!1}}class La{constructor(t){this.type=_e,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 La(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 St(`Expected value to be of type string or array, but found ${P(At(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const nr=8192;function Zl(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*nr),Math.round(s*l*nr)]}function Ra(i,t){const r=Math.pow(2,t.z);return[(l=(i[0]/nr+t.x)/r,360*l-180),(s=(i[1]/nr+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90)];var s,l}function Hr(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 kr(i,t){return!(i[0]<=t[0]||i[2]>=t[2]||i[1]<=t[1]||i[3]>=t[3])}function it(i,t,r){const s=i[0]-t[0],l=i[1]-t[1],u=i[0]-r[0],d=i[1]-r[1];return s*d-u*l==0&&s*u<=0&&l*d<=0}function Fs(i,t,r,s){return(l=[s[0]-r[0],s[1]-r[1]])[0]*(u=[t[0]-i[0],t[1]-i[1]])[1]-l[1]*u[0]!=0&&!(!Uo(i,t,r,s)||!Uo(r,s,i,t));var l,u}function Gl(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]-u[0])*(l[1]-u[1])/(d[1]-u[1])+u[0]&&(s=!s)}var l,u,d;return s}function Hl(i,t){for(const r of t)if(yn(i,r))return!0;return!1}function jo(i,t){for(const r of i)if(!yn(r,t))return!1;for(let r=0;r0&&f<0||d<0&&f>0}function Ba(i,t,r){const s=[];for(let l=0;lr[2]){const l=.5*s;let u=i[0]-r[0]>l?-s:r[0]-i[0]>l?s:0;u===0&&(u=i[0]-r[2]>l?-s:r[2]-i[0]>l?s:0),i[0]+=u}Hr(t,i)}function Zo(i,t,r,s){const l=Math.pow(2,s.z)*nr,u=[s.x*nr,s.y*nr],d=[];for(const f of i)for(const _ of f){const x=[_.x+u[0],_.y+u[1]];qo(x,t,r,l),d.push(x)}return d}function Go(i,t,r,s){const l=Math.pow(2,s.z)*nr,u=[s.x*nr,s.y*nr],d=[];for(const _ of i){const x=[];for(const v of _){const w=[v.x+u[0],v.y+u[1]];Hr(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 _)qo(x,t,r,l)}var f;return d}class Xr{constructor(t,r){this.type=Be,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(qr(t[1])){const s=t[1];if(s.type==="FeatureCollection"){const l=[];for(const u of s.features){const{type:d,coordinates:f}=u.geometry;d==="Polygon"&&l.push(f),d==="MultiPolygon"&&l.push(...f)}if(l.length)return new Xr(s,{type:"MultiPolygon",coordinates:l})}else if(s.type==="Feature"){const l=s.geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new Xr(s,s.geometry)}else if(s.type==="Polygon"||s.type==="MultiPolygon")return new Xr(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],u=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(s.type==="Polygon"){const f=Ba(s.coordinates,u,d),_=Zo(r.geometry(),l,u,d);if(!kr(l,u))return!1;for(const x of _)if(!yn(x,f))return!1}if(s.type==="MultiPolygon"){const f=$o(s.coordinates,u,d),_=Zo(r.geometry(),l,u,d);if(!kr(l,u))return!1;for(const x of _)if(!Hl(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],u=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(s.type==="Polygon"){const f=Ba(s.coordinates,u,d),_=Go(r.geometry(),l,u,d);if(!kr(l,u))return!1;for(const x of _)if(!jo(x,f))return!1}if(s.type==="MultiPolygon"){const f=$o(s.coordinates,u,d),_=Go(r.geometry(),l,u,d);if(!kr(l,u))return!1;for(const x of _)if(!Xl(x,f))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Ho=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,u=t[l];if(r(s,u)>=0)break;t[i]=u,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[u],i=u}t[i]=l}};function Wl(i,t,r,s,l){Xo(i,t,r,s||i.length-1,l||Kl)}function Xo(i,t,r,s,l){for(;s>r;){if(s-r>600){var u=s-r+1,d=t-r+1,f=Math.log(u),_=.5*Math.exp(2*f/3),x=.5*Math.sqrt(f*_*(u-_)/u)*(d-u/2<0?-1:1);Xo(i,t,Math.max(r,Math.floor(t-d*_/u+x)),Math.min(s,Math.floor(t+(u-d)*_/u+x)),l)}var v=i[t],w=r,I=s;for(ns(i,r,t),l(i[s],v)>0&&ns(i,r,s);w0;)I--}l(i[r],v)===0?ns(i,r,I):ns(i,++I,s),I<=t&&(r=I+1),t<=I&&(s=I-1)}}function ns(i,t,r){var s=i[t];i[t]=i[r],i[r]=s}function Kl(i,t){return it?1:0}function Os(i,t){if(i.length<=1)return[i];const r=[];let s,l;for(const u of i){const d=Yl(u);d!==0&&(u.area=Math.abs(d),l===void 0&&(l=d<0),l===d<0?(s&&r.push(s),s=[u]):s.push(u))}if(s&&r.push(s),t>1)for(let u=0;u1?(x=t[_+1][0],v=t[_+1][1]):M>0&&(x+=w/this.kx*M,v+=I/this.ky*M)),w=this.wrap(r[0]-x)*this.kx,I=(r[1]-v)*this.ky;const k=w*w+I*I;k180;)t-=360;return t}}function Yo(i,t){return t[0]-i[0]}function Vs(i){return i[1]-i[0]+1}function _r(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 Va(i,t){if(!_r(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)Hr(r,i[s]);return r}function Na(i){const t=[1/0,1/0,-1/0,-1/0];for(const r of i)for(const s of r)Hr(t,s);return t}function Ns(i){return i[0]!==-1/0&&i[1]!==-1/0&&i[2]!==1/0&&i[3]!==1/0}function ja(i,t,r){if(!Ns(i)||!Ns(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(kr(l,u)){if(js(i,t))return 0}else if(js(t,i))return 0;let d=1/0;for(const f of i)for(let _=0,x=f.length,v=x-1;_0;){const _=d.pop();if(_[0]>=u)continue;const x=_[1],v=t?50:100;if(Vs(x)<=v){if(!_r(x,i.length))return NaN;if(t){const w=Ze(i,x,r,s);if(isNaN(w)||w===0)return w;u=Math.min(u,w)}else for(let w=x[0];w<=x[1];++w){const I=ec(i[w],r,s);if(u=Math.min(u,I),u===0)return 0}}else{const w=Oa(x,t);at(d,u,s,i,f,w[0]),at(d,u,s,i,f,w[1])}}return u}function as(i,t,r,s,l,u=1/0){let d=Math.min(u,l.distance(i[0],r[0]));if(d===0)return d;const f=new Ho([[0,[0,i.length-1],[0,r.length-1]]],Yo);for(;f.length>0;){const _=f.pop();if(_[0]>=d)continue;const x=_[1],v=_[2],w=t?50:100,I=s?50:100;if(Vs(x)<=w&&Vs(v)<=I){if(!_r(x,i.length)&&_r(v,r.length))return NaN;let M;if(t&&s)M=Ql(i,x,r,v,l),d=Math.min(d,M);else if(t&&!s){const k=i.slice(x[0],x[1]+1);for(let z=v[0];z<=v[1];++z)if(M=Wr(r[z],k,l),d=Math.min(d,M),d===0)return d}else if(!t&&s){const k=r.slice(v[0],v[1]+1);for(let z=x[0];z<=x[1];++z)if(M=Wr(i[z],k,l),d=Math.min(d,M),d===0)return d}else M=bt(i,x,r,v,l),d=Math.min(d,M)}else{const M=Oa(x,t),k=Oa(v,s);Kr(f,d,l,i,r,M[0],k[0]),Kr(f,d,l,i,r,M[0],k[1]),Kr(f,d,l,i,r,M[1],k[0]),Kr(f,d,l,i,r,M[1],k[1])}}return d}function $a(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 Jr{constructor(t,r){this.type=_e,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(qr(t[1])){const s=t[1];if(s.type==="FeatureCollection")return new Jr(s,s.features.map(l=>$a(l.geometry)).flat());if(s.type==="Feature")return new Jr(s,$a(s.geometry));if("type"in s&&"coordinates"in s)return new Jr(s,$a(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(),u=l.flat().map(_=>Ra([_.x,_.y],r.canonical));if(l.length===0)return NaN;const d=new Fa(u[0][1]);let f=1/0;for(const _ of s){switch(_.type){case"Point":f=Math.min(f,as(u,!1,[_.coordinates],!1,d,f));break;case"LineString":f=Math.min(f,as(u,!1,_.coordinates,!0,d,f));break;case"Polygon":f=Math.min(f,ss(u,!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(),u=l.flat().map(_=>Ra([_.x,_.y],r.canonical));if(l.length===0)return NaN;const d=new Fa(u[0][1]);let f=1/0;for(const _ of s){switch(_.type){case"Point":f=Math.min(f,as(u,!0,[_.coordinates],!1,d,f));break;case"LineString":f=Math.min(f,as(u,!0,_.coordinates,!0,d,f));break;case"Polygon":f=Math.min(f,ss(u,!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 u=Os(l,0).map(_=>_.map(x=>x.map(v=>Ra([v.x,v.y],r.canonical)))),d=new Fa(u[0][0][0][1]);let f=1/0;for(const _ of s)for(const x of u){switch(_.type){case"Point":f=Math.min(f,ss([_.coordinates],!1,x,d,f));break;case"LineString":f=Math.min(f,ss(_.coordinates,!0,x,d,f));break;case"Polygon":f=Math.min(f,ht(x,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const xn={"==":Ul,"!=":Oo,">":$l,"<":Vo,">=":No,"<=":ql,array:Fi,at:Ca,boolean:Fi,case:zs,coalesce:Ls,collator:rs,format:Bs,image:Da,in:ka,"index-of":mn,interpolate:ri,"interpolate-hcl":ri,"interpolate-lab":ri,length:La,let:Cr,literal:Bi,match:za,number:Fi,"number-format":Ea,object:Fi,slice:ts,step:_n,string:Fi,"to-boolean":Oi,"to-color":Oi,"to-number":Oi,"to-string":Oi,var:tt,within:Xr,distance:Jr};class Ti{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=Ti.definitions[s];if(!l)return r.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0);const u=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,v]of f){_=new Zr(r.registry,os,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(" | "),v=[];for(let w=1;w{r=t?r&&os(s):r&&s instanceof Bi}),!!r&&ls(i)&&cs(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function ls(i){if(i instanceof Ti&&(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 Xr||i instanceof Jr)return!1;let t=!0;return i.eachChild(r=>{t&&!ls(r)&&(t=!1)}),t}function vn(i){if(i instanceof Ti&&i.name==="feature-state")return!1;let t=!0;return i.eachChild(r=>{t&&!vn(r)&&(t=!1)}),t}function cs(i,t){if(i instanceof Ti&&t.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(s=>{r&&!cs(s,t)&&(r=!1)}),r}function Us(i){return{result:"success",value:i}}function bn(i){return{result:"error",value:i}}function wn(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Qo(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Ha(i){return!!i.expression&&i.expression.interpolated}function Ye(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function $s(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function tc(i){return i}function el(i,t){const r=t.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",l=s||!(s||i.property!==void 0),u=i.type||(Ha(t)?"exponential":"interval");if(r||t.type==="padding"){const v=r?nt.parse:pi.parse;(i=er({},i)).stops&&(i.stops=i.stops.map(w=>[w[0],v(w[1])])),i.default=v(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(u==="exponential")f=il;else if(u==="interval")f=qs;else if(u==="categorical"){f=tl,_=Object.create(null);for(const v of i.stops)_[v[0]]=v[1];x=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);f=rl}if(s){const v={},w=[];for(let k=0;kk[0]),evaluate:({zoom:k},z)=>il({stops:I,base:i.base},t,k).evaluate(k,z)}}if(l){const v=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:ri.interpolationFactor.bind(void 0,v),zoomStops:i.stops.map(w=>w[0]),evaluate:({zoom:w})=>f(i,t,w,_,x)}}return{kind:"source",evaluate(v,w){const I=w&&w.properties?w.properties[i.property]:void 0;return I===void 0?Tn(i.default,t.default):f(i,t,I,_,x)}}}function Tn(i,t,r){return i!==void 0?i:t!==void 0?t:r!==void 0?r:void 0}function tl(i,t,r,s,l){return Tn(typeof r===l?s[r]:void 0,i.default,t.default)}function qs(i,t,r){if(Ye(r)!=="number")return Tn(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=Es(i.stops.map(u=>u[0]),r);return i.stops[l][1]}function il(i,t,r){const s=i.base!==void 0?i.base:1;if(Ye(r)!=="number")return Tn(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 u=Es(i.stops.map(v=>v[0]),r),d=function(v,w,I,M){const k=M-I,z=v-I;return k===0?0:w===1?z/k:(Math.pow(w,z)-1)/(Math.pow(w,k)-1)}(r,s,i.stops[u][0],i.stops[u+1][0]),f=i.stops[u][1],_=i.stops[u+1][1],x=ii[t.type]||tc;return typeof f.evaluate=="function"?{evaluate(...v){const w=f.evaluate.apply(void 0,v),I=_.evaluate.apply(void 0,v);if(w!==void 0&&I!==void 0)return x(w,I,d,i.colorSpace)}}:x(f,_,d,i.colorSpace)}function rl(i,t,r){switch(t.type){case"color":r=nt.parse(r);break;case"formatted":r=di.fromString(r.toString());break;case"resolvedImage":r=fi.fromString(r.toString());break;case"padding":r=pi.parse(r);break;default:Ye(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return Tn(r,i.default,t.default)}Ti.register(xn,{error:[{kind:"error"},[$e],(i,[t])=>{throw new St(t.evaluate(i))}],typeof:[$e,[Ne],(i,[t])=>P(At(t.evaluate(i)))],"to-rgba":[A(_e,4),[ti],(i,[t])=>{const[r,s,l,u]=t.evaluate(i).rgb;return[255*r,255*s,255*l,u]}],rgb:[ti,[_e,_e,_e],qa],rgba:[ti,[_e,_e,_e,_e],qa],has:{type:Be,overloads:[[[$e],(i,[t])=>Za(t.evaluate(i),i.properties())],[[$e,Ri],(i,[t,r])=>Za(t.evaluate(i),r.evaluate(i))]]},get:{type:Ne,overloads:[[[$e],(i,[t])=>Ga(t.evaluate(i),i.properties())],[[$e,Ri],(i,[t,r])=>Ga(t.evaluate(i),r.evaluate(i))]]},"feature-state":[Ne,[$e],(i,[t])=>Ga(t.evaluate(i),i.featureState||{})],properties:[Ri,[],i=>i.properties()],"geometry-type":[$e,[],i=>i.geometryType()],id:[Ne,[],i=>i.id()],zoom:[_e,[],i=>i.globals.zoom],"heatmap-density":[_e,[],i=>i.globals.heatmapDensity||0],"line-progress":[_e,[],i=>i.globals.lineProgress||0],accumulated:[Ne,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[_e,Yr(_e),(i,t)=>{let r=0;for(const s of t)r+=s.evaluate(i);return r}],"*":[_e,Yr(_e),(i,t)=>{let r=1;for(const s of t)r*=s.evaluate(i);return r}],"-":{type:_e,overloads:[[[_e,_e],(i,[t,r])=>t.evaluate(i)-r.evaluate(i)],[[_e],(i,[t])=>-t.evaluate(i)]]},"/":[_e,[_e,_e],(i,[t,r])=>t.evaluate(i)/r.evaluate(i)],"%":[_e,[_e,_e],(i,[t,r])=>t.evaluate(i)%r.evaluate(i)],ln2:[_e,[],()=>Math.LN2],pi:[_e,[],()=>Math.PI],e:[_e,[],()=>Math.E],"^":[_e,[_e,_e],(i,[t,r])=>Math.pow(t.evaluate(i),r.evaluate(i))],sqrt:[_e,[_e],(i,[t])=>Math.sqrt(t.evaluate(i))],log10:[_e,[_e],(i,[t])=>Math.log(t.evaluate(i))/Math.LN10],ln:[_e,[_e],(i,[t])=>Math.log(t.evaluate(i))],log2:[_e,[_e],(i,[t])=>Math.log(t.evaluate(i))/Math.LN2],sin:[_e,[_e],(i,[t])=>Math.sin(t.evaluate(i))],cos:[_e,[_e],(i,[t])=>Math.cos(t.evaluate(i))],tan:[_e,[_e],(i,[t])=>Math.tan(t.evaluate(i))],asin:[_e,[_e],(i,[t])=>Math.asin(t.evaluate(i))],acos:[_e,[_e],(i,[t])=>Math.acos(t.evaluate(i))],atan:[_e,[_e],(i,[t])=>Math.atan(t.evaluate(i))],min:[_e,Yr(_e),(i,t)=>Math.min(...t.map(r=>r.evaluate(i)))],max:[_e,Yr(_e),(i,t)=>Math.max(...t.map(r=>r.evaluate(i)))],abs:[_e,[_e],(i,[t])=>Math.abs(t.evaluate(i))],round:[_e,[_e],(i,[t])=>{const r=t.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[_e,[_e],(i,[t])=>Math.floor(t.evaluate(i))],ceil:[_e,[_e],(i,[t])=>Math.ceil(t.evaluate(i))],"filter-==":[Be,[$e,Ne],(i,[t,r])=>i.properties()[t.value]===r.value],"filter-id-==":[Be,[Ne],(i,[t])=>i.id()===t.value],"filter-type-==":[Be,[$e],(i,[t])=>i.geometryType()===t.value],"filter-<":[Be,[$e,Ne],(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":[Be,[$e,Ne],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s>l}],"filter-id->":[Be,[Ne],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r>s}],"filter-<=":[Be,[$e,Ne],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s<=l}],"filter-id-<=":[Be,[Ne],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r<=s}],"filter->=":[Be,[$e,Ne],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s>=l}],"filter-id->=":[Be,[Ne],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r>=s}],"filter-has":[Be,[Ne],(i,[t])=>t.value in i.properties()],"filter-has-id":[Be,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Be,[A($e)],(i,[t])=>t.value.indexOf(i.geometryType())>=0],"filter-id-in":[Be,[A(Ne)],(i,[t])=>t.value.indexOf(i.id())>=0],"filter-in-small":[Be,[$e,A(Ne)],(i,[t,r])=>r.value.indexOf(i.properties()[t.value])>=0],"filter-in-large":[Be,[$e,A(Ne)],(i,[t,r])=>function(s,l,u,d){for(;u<=d;){const f=u+d>>1;if(l[f]===s)return!0;l[f]>s?d=f-1:u=f+1}return!1}(i.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Be,overloads:[[[Be,Be],(i,[t,r])=>t.evaluate(i)&&r.evaluate(i)],[Yr(Be),(i,t)=>{for(const r of t)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Be,overloads:[[[Be,Be],(i,[t,r])=>t.evaluate(i)||r.evaluate(i)],[Yr(Be),(i,t)=>{for(const r of t)if(r.evaluate(i))return!0;return!1}]]},"!":[Be,[Be],(i,[t])=>!t.evaluate(i)],"is-supported-script":[Be,[$e],(i,[t])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(t.evaluate(i))}],upcase:[$e,[$e],(i,[t])=>t.evaluate(i).toUpperCase()],downcase:[$e,[$e],(i,[t])=>t.evaluate(i).toLowerCase()],concat:[$e,Yr(Ne),(i,t)=>t.map(r=>es(r.evaluate(i))).join("")],"resolved-locale":[$e,[ir],(i,[t])=>t.evaluate(i).resolvedLocale()]});class Zs{constructor(t,r){var s;this.expression=t,this._warningHistory={},this._evaluator=new ks,this._defaultValue=r?(s=r).type==="color"&&$s(s.default)?new nt(0,0,0,0):s.type==="color"?nt.parse(s.default)||null:s.type==="padding"?pi.parse(s.default)||null:s.type==="variableAnchorOffsetCollection"?wi.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,u,d){return this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(t,r,s,l,u,d){this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=l,this._evaluator.availableImages=u||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 St(`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 Gs(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in xn}function Sn(i,t){const r=new Zr(xn,os,[],t?function(l){const u={color:ti,string:$e,number:_e,enum:$e,boolean:Be,formatted:mr,padding:Mr,resolvedImage:rr,variableAnchorOffsetCollection:N};return l.type==="array"?A(u[l.value]||Ne,l.length):u[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?Us(new Zs(s,t)):bn(r.errors)}class In{constructor(t,r){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!vn(r.expression)}evaluateWithoutErrorHandling(t,r,s,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,s,l,u,d)}evaluate(t,r,s,l,u,d){return this._styleExpression.evaluate(t,r,s,l,u,d)}}class Pn{constructor(t,r,s,l){this.kind=t,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!vn(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(t,r,s,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,s,l,u,d)}evaluate(t,r,s,l,u,d){return this._styleExpression.evaluate(t,r,s,l,u,d)}interpolationFactor(t,r,s){return this.interpolationType?ri.interpolationFactor(this.interpolationType,t,r,s):0}}function Xa(i,t){const r=Sn(i,t);if(r.result==="error")return r;const s=r.value.expression,l=ls(s);if(!l&&!wn(t))return bn([new Xt("","data expressions not supported")]);const u=cs(s,["zoom"]);if(!u&&!Qo(t))return bn([new Xt("","zoom expressions not supported")]);const d=hs(s);return d||u?d instanceof Xt?bn([d]):d instanceof ri&&!Ha(t)?bn([new Xt("",'"interpolate" expressions cannot be used with this property')]):Us(d?new Pn(l?"camera":"composite",r.value,d.labels,d instanceof ri?d.interpolation:void 0):new In(l?"constant":"source",r.value)):bn([new Xt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class An{constructor(t,r){this._parameters=t,this._specification=r,er(this,el(this._parameters,this._specification))}static deserialize(t){return new An(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function hs(i){let t=null;if(i instanceof Cr)t=hs(i.result);else if(i instanceof Ls){for(const r of i.args)if(t=hs(r),t)break}else(i instanceof _n||i instanceof ri)&&i.input instanceof Ti&&i.input.name==="zoom"&&(t=i);return t instanceof Xt||i.eachChild(r=>{const s=hs(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 Hs(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(!Hs(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const Xs={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Wa(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Hs(i)||(i=Ws(i));const t=Sn(i,Xs);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:nl(i)}}function ic(i,t){return it?1:0}function nl(i){if(!Array.isArray(i))return!1;if(i[0]==="within"||i[0]==="distance")return!0;for(let t=1;t"||t==="<="||t===">="?Ka(i[1],i[2],t):t==="any"?(r=i.slice(1),["any"].concat(r.map(Ws))):t==="all"?["all"].concat(i.slice(1).map(Ws)):t==="none"?["all"].concat(i.slice(1).map(Ws).map(Ot)):t==="in"?us(i[1],i.slice(2)):t==="!in"?Ot(us(i[1],i.slice(2))):t==="has"?ds(i[1]):t!=="!has"||Ot(ds(i[1]));var r}function Ka(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 us(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(ic)]]:["filter-in-small",i,["literal",t]]}}function ds(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Ot(i){return["!",i]}function Qr(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 u of i)l+=`${Qr(u)},`;return`${l}]`}const r=Object.keys(i).sort();let s="{";for(let l=0;ls.maximum?[new ue(t,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function Ks(i){const t=i.valueSpec,r=wt(i.value.type);let s,l,u,d={};const f=r!=="categorical"&&i.value.property===void 0,_=!f,x=Ye(i.value.stops)==="array"&&Ye(i.value.stops[0])==="array"&&Ye(i.value.stops[0][0])==="object",v=mi({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 ue(M.key,M.value,'identity function may not have a "stops" property')];let k=[];const z=M.value;return k=k.concat(ps({key:M.key,value:z,valueSpec:M.valueSpec,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec,arrayElementValidator:w})),Ye(z)==="array"&&z.length===0&&k.push(new ue(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&&v.push(new ue(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||v.push(new ue(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Ha(i.valueSpec)&&v.push(new ue(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!wn(i.valueSpec)?v.push(new ue(i.key,i.value,"property functions not supported")):f&&!Qo(i.valueSpec)&&v.push(new ue(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||v.push(new ue(i.key,i.value,'"property" property is required')),v;function w(M){let k=[];const z=M.value,F=M.key;if(Ye(z)!=="array")return[new ue(F,z,`array expected, ${Ye(z)} found`)];if(z.length!==2)return[new ue(F,z,`array length 2 expected, length ${z.length} found`)];if(x){if(Ye(z[0])!=="object")return[new ue(F,z,`object expected, ${Ye(z[0])} found`)];if(z[0].zoom===void 0)return[new ue(F,z,"object stop key must have zoom")];if(z[0].value===void 0)return[new ue(F,z,"object stop key must have value")];if(u&&u>wt(z[0].zoom))return[new ue(F,z[0].zoom,"stop zoom values must appear in ascending order")];wt(z[0].zoom)!==u&&(u=wt(z[0].zoom),l=void 0,d={}),k=k.concat(mi({key:`${F}[0]`,value:z[0],valueSpec:{zoom:{}},validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec,objectElementValidators:{zoom:Ja,value:I}}))}else k=k.concat(I({key:`${F}[0]`,value:z[0],valueSpec:{},validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec},z));return Gs(Vi(z[1]))?k.concat([new ue(`${F}[1]`,z[1],"expressions are not allowed in function stops.")]):k.concat(M.validateSpec({key:`${F}[1]`,value:z[1],valueSpec:t,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec}))}function I(M,k){const z=Ye(M.value),F=wt(M.value),j=M.value!==null?M.value:k;if(s){if(z!==s)return[new ue(M.key,j,`${z} stop domain type must match previous stop domain type ${s}`)]}else s=z;if(z!=="number"&&z!=="string"&&z!=="boolean")return[new ue(M.key,j,"stop domain value must be a number, string, or boolean")];if(z!=="number"&&r!=="categorical"){let Q=`number expected, ${z} found`;return wn(t)&&r===void 0&&(Q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ue(M.key,j,Q)]}return r!=="categorical"||z!=="number"||isFinite(F)&&Math.floor(F)===F?r!=="categorical"&&z==="number"&&l!==void 0&&Fnew ue(`${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 ue(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"&&!vn(r))return[new ue(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!vn(r))return[new ue(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!cs(r,["zoom","feature-state"]))return[new ue(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!ls(r))return[new ue(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function gr(i){const t=i.key,r=i.value,s=i.valueSpec,l=[];return Array.isArray(s.values)?s.values.indexOf(wt(r))===-1&&l.push(new ue(t,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf(wt(r))===-1&&l.push(new ue(t,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function Ya(i){return Hs(Vi(i.value))?Mn(er({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Js(i)}function Js(i){const t=i.value,r=i.key;if(Ye(t)!=="array")return[new ue(r,t,`array expected, ${Ye(t)} found`)];const s=i.styleSpec;let l,u=[];if(t.length<1)return[new ue(r,t,"filter array must have at least 1 element")];switch(u=u.concat(gr({key:`${r}[0]`,value:t[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),wt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&wt(t[1])==="$type"&&u.push(new ue(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&u.push(new ue(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(l=Ye(t[1]),l!=="string"&&u.push(new ue(`${r}[1]`,t[1],`string expected, ${l} found`)));for(let d=2;dr===null?null:t(r)):D(e)?Object.keys(e).reduce((r,s)=>(r[s]=t(e[s]),r),{}):e!=null?t(e):null}const p=e=>c.jsx(b.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});p.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])}}const O=I((e,t)=>{const{isInline:r,direction:s,align:d,justify:_,spacing:a="0.5rem",wrap:j,children:f,divider:l,className:g,shouldWrapChildren:m,...S}=e,u=r?"row":s??"column",x=o.useMemo(()=>M({spacing:a,direction:u}),[a,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,W=m?c.jsx(p,{children:n},k):n;if(!i)return W;const L=o.cloneElement(l,{__css:x}),B=N?null:L;return c.jsxs(o.Fragment,{children:[W,B]},k)})},[l,x,i,y,m,f]),C=E("chakra-stack",g);return c.jsx(b.div,{ref:t,display:"flex",alignItems:d,justifyContent:_,flexDirection:u,flexWrap:j,gap:i?void 0:a,className:C,...S,children:w})});O.displayName="Stack";export{O as S,A as m}; +import{W as D,j as c,c as b,f as I,d as o,l as E}from"./index-DZP_WaxS.js";import{m as R}from"./Footer-C3QM0Uoc.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}const p=e=>c.jsx(b.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});p.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])}}const O=I((e,t)=>{const{isInline:r,direction:s,align:d,justify:_,spacing:a="0.5rem",wrap:j,children:f,divider:l,className:g,shouldWrapChildren:m,...S}=e,u=r?"row":s??"column",x=o.useMemo(()=>M({spacing:a,direction:u}),[a,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,W=m?c.jsx(p,{children:n},k):n;if(!i)return W;const L=o.cloneElement(l,{__css:x}),B=N?null:L;return c.jsxs(o.Fragment,{children:[W,B]},k)})},[l,x,i,y,m,f]),C=E("chakra-stack",g);return c.jsx(b.div,{ref:t,display:"flex",alignItems:d,justifyContent:_,flexDirection:u,flexWrap:j,gap:i?void 0:a,className:C,...S,children:w})});O.displayName="Stack";export{O as S,A as m}; diff --git a/index.html b/index.html index e9659af..8bba9b0 100644 --- a/index.html +++ b/index.html @@ -38,7 +38,7 @@ content="/images/favicon/browserconfig.xml" /> - +