diff --git a/dist/assets/PoojaProf-1QPvdp2F.png b/dist/assets/PoojaProf-1QPvdp2F.png new file mode 100644 index 0000000..9c0750e Binary files /dev/null and b/dist/assets/PoojaProf-1QPvdp2F.png differ diff --git a/dist/assets/bird-_WCJ2UsO.glb b/dist/assets/bird-_WCJ2UsO.glb new file mode 100644 index 0000000..2aac517 Binary files /dev/null and b/dist/assets/bird-_WCJ2UsO.glb differ diff --git a/dist/assets/fox-FuRos4rq.glb b/dist/assets/fox-FuRos4rq.glb new file mode 100644 index 0000000..a6a010f Binary files /dev/null and b/dist/assets/fox-FuRos4rq.glb differ diff --git a/dist/assets/hero-_Sk9UN1l.jpg b/dist/assets/hero-_Sk9UN1l.jpg new file mode 100644 index 0000000..a867dcf Binary files /dev/null and b/dist/assets/hero-_Sk9UN1l.jpg differ diff --git a/dist/assets/index-V1bi7MNB.css b/dist/assets/index-V1bi7MNB.css new file mode 100644 index 0000000..1589578 --- /dev/null +++ b/dist/assets/index-V1bi7MNB.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&family=Work+Sans:wght@100;200;300;400;500;600;700;800;900&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#d5dae1}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(43 119 231 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(43 119 231 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.right-0{right:0}.top-10{top:2.5rem}.top-8{top:2rem}.z-10{z-index:10}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-20{margin-top:5rem;margin-bottom:5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-5{margin-left:1.25rem}.mr-2{margin-right:.5rem}.mt-12{margin-top:3rem}.mt-14{margin-top:3.5rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-5{margin-top:1.25rem}.flex{display:flex}.hidden{display:none}.h-1\/2{height:50%}.h-12{height:3rem}.h-16{height:4rem}.h-20{height:5rem}.h-4{height:1rem}.h-\[400px\]{height:400px}.h-\[60\%\]{height:60%}.h-full{height:100%}.h-screen{height:100vh}.w-1\/2{width:50%}.w-12{width:3rem}.w-16{width:4rem}.w-20{width:5rem}.w-4{width:1rem}.w-\[60\%\]{width:60%}.w-full{width:100%}.min-w-\[50\%\]{min-width:50%}.flex-1{flex:1 1 0%}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-12{gap:3rem}.gap-16{gap:4rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.gap-7{gap:1.75rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border-2{border-width:2px}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(43 119 231 / var(--tw-border-opacity))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.border-t-blue-500{--tw-border-opacity: 1;border-top-color:rgb(43 119 231 / var(--tw-border-opacity))}.border-opacity-20{--tw-border-opacity: .2}.bg-blue-800{--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.object-contain{-o-object-fit:contain;object-fit:contain}.p-2{padding:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-1{padding-left:.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-poppins{font-family:Poppins,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.leading-none{line-height:1}.\!text-slate-200{--tw-text-opacity: 1 !important;color:rgb(226 232 240 / var(--tw-text-opacity))!important}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-black-500{--tw-text-opacity: 1;color:rgb(29 34 53 / var(--tw-text-opacity))}.text-black-500\/50{color:#1d223580}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity))}.text-indigo-100{--tw-text-opacity: 1;color:rgb(224 231 255 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.max-container{margin-left:auto;margin-right:auto;min-height:calc(100vh - 80px);max-width:64rem;padding-left:2rem;padding-right:2rem;padding-bottom:3rem;padding-top:126px!important}@media (min-width: 640px){.max-container{padding:4rem}}.head-text{font-family:Poppins,sans-serif;font-size:1.875rem;line-height:2.25rem;font-weight:600}@media (min-width: 640px){.head-text{font-size:3rem;line-height:1.375}}.subhead-text{position:relative;font-family:Poppins,sans-serif;font-size:1.25rem;line-height:1.75rem;font-weight:600}@media (min-width: 640px){.subhead-text{font-size:1.875rem;line-height:2.25rem}}.blue-gradient_text{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #00c6ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 198 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #0072ff var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.input{margin-top:.625rem;display:block;width:100%;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(213 218 225 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:.625rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity));--tw-shadow: 0px 1px 2px 0px rgba(0, 0, 0, .05);--tw-shadow-colored: 0px 1px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input:focus{--tw-border-opacity: 1;border-color:rgb(43 119 231 / var(--tw-border-opacity));--tw-ring-opacity: 1;--tw-ring-color: rgb(43 119 231 / var(--tw-ring-opacity))}.textarea{margin-top:.625rem;display:block;width:100%;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(213 218 225 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:.625rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity));--tw-shadow: 0px 1px 2px 0px rgba(0, 0, 0, .05);--tw-shadow-colored: 0px 1px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.textarea:focus{--tw-border-opacity: 1;border-color:rgb(43 119 231 / var(--tw-border-opacity));--tw-ring-opacity: 1;--tw-ring-color: rgb(43 119 231 / var(--tw-ring-opacity))}.btn{width:100%;border-radius:.5rem;background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #00c6ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 198 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #0072ff var(--tw-gradient-to-position);padding:.625rem 1.25rem;text-align:center;font-size:.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity))}@media (min-width: 640px){.btn{width:auto}}.header{position:absolute;top:0;right:0;left:0;z-index:10;margin-left:auto;margin-right:auto;display:flex;max-width:64rem;align-items:center;justify-content:space-between;background-color:transparent;padding:1rem 2rem}@media (min-width: 640px){.header{padding-left:4rem;padding-right:4rem}}.info-box{margin-left:1.25rem;margin-right:1.25rem;display:flex;max-width:42rem;flex-direction:column;gap:.75rem;padding:1rem 2rem 3rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity));background:#2b77e7;position:relative;border-radius:10px;border:#2b77e7;box-shadow:.6vmin .6vmin #336cc1,1vmin 1vmin #0092db,1vmin 1vmin #0092db,.65vmin 1vmin #0092db,1vmin .65vmin #0092db}.neo-btn{position:absolute;bottom:-1.25rem;right:0;left:0;margin-left:auto;margin-right:auto;display:flex;width:90%;align-items:center;justify-content:center;gap:.75rem;border-radius:.5rem;padding:.75rem 1.5rem;text-align:center;font-weight:600;--tw-text-opacity: 1;color:rgb(43 119 231 / var(--tw-text-opacity))}@media (min-width: 640px){.neo-btn{width:50%}}.cta{margin-top:2rem;display:flex;width:100%;flex-direction:column;align-items:center;gap:1.75rem}@media (min-width: 640px){.cta{margin-top:4rem}}@media (min-width: 768px){.cta{flex-direction:row}}.cta-text{flex:1 1 0%;font-size:1.875rem;line-height:2.25rem;font-weight:800;--tw-text-opacity: 1;color:rgb(29 34 53 / var(--tw-text-opacity))}@media not all and (min-width: 768px){.cta-text{text-align:center}}:root{--blue-rgb: 237 245 255;--green-rgb: 125 161 35}body{font-family:Work Sans,sans-serif}body:has(.card[data-color=blue]:hover){background-color:rgb(var(--blue-rgb) / 25%)}body:has(.card[data-color=green]:hover){background-color:rgb(var(--green-rgb) / 25%)}.glassmorphism{background:rgba(8,116,239,.07);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-radius:10px;border:1px solid rgba(255,255,255,.18)}.logo{border-radius:8.889px;background:#fff;box-shadow:0 10px 35px -4px #4353ff26,0 1.5px 4px -1px #4353ff33}.block-container{position:relative;transition:.25s;perspective:500px}.block-container .btn-back{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;width:inherit;height:inherit;transition:.25s;transform-style:preserve-3d;transform-origin:bottom right;transform:rotate(15deg);will-change:transform;box-shadow:16px 0 40px #e4e4e4}.block-container .btn-back-red{background:linear-gradient(135deg,#ff4b1f -20%,#ff9068 120%)}.block-container .btn-back-green{background:linear-gradient(135deg,#adfda2 -20%,#11d3f3 120%)}.block-container .btn-back-yellow{background:linear-gradient(135deg,#f7971e -20%,#ffd200 120%)}.block-container .btn-back-blue{background:linear-gradient(135deg,#0061ff -20%,#60efff 120%)}.block-container .btn-back-orange{background:linear-gradient(135deg,#ff0f7b -20%,#f89b29 120%)}.block-container .btn-back-pink{background:linear-gradient(135deg,#e81cff -20%,#40c9ff 120%)}.block-container .btn-back-black{background:linear-gradient(135deg,#0a1647 -20%,#e4e7e4 120%)}.block-container .btn-front{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:inherit;height:inherit;background-color:#fff3;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);transition:.25s;transform-style:preserve-3d;transform-origin:top left;overflow:hidden}.block-container:hover>.btn-back{transform:translateZ(20px) rotate(15deg) rotateX(-20deg) rotateY(-20deg)}.block-container:hover>.btn-front{transform:translateZ(80px) translateY(-5px) rotateX(15deg) rotateY(15deg)}.neo-brutalism-blue{background:#2b77e7;position:relative;border-radius:10px;border:#2b77e7;box-shadow:.6vmin .6vmin #336cc1,1vmin 1vmin #0092db,1vmin 1vmin #0092db,.65vmin 1vmin #0092db,1vmin .65vmin #0092db}.neo-brutalism-white{background:#fff;border:#fff;box-shadow:.6vmin .6vmin #fff,1vmin 1vmin #d2e4ff,1vmin 1vmin #d2e4ff,.65vmin 1vmin #d2e4ff,1vmin .65vmin #d2e4ff}@media (min-width: 640px){.sm\:block{display:block}.sm\:leading-snug{line-height:1.375}}@media (min-width: 768px){.md\:h-\[3000px\]{height:3000px}}@media (min-width: 1024px){.lg\:mt-0{margin-top:0}.lg\:h-auto{height:auto}.lg\:w-\[400px\]{width:400px}.lg\:flex-row{flex-direction:row}.lg\:rounded-full{border-radius:9999px}}.vertical-timeline *{-webkit-box-sizing:border-box;box-sizing:border-box}.vertical-timeline{width:95%;max-width:1170px;margin:0 auto;position:relative;padding:2em 0}.vertical-timeline:after{content:"";display:table;clear:both}.vertical-timeline:before{content:"";position:absolute;top:0;left:18px;height:100%;width:4px;background:var(--line-color)}.vertical-timeline.vertical-timeline--one-column-right:before{right:18px;left:unset}@media only screen and (min-width:1170px){.vertical-timeline.vertical-timeline--two-columns{width:90%}.vertical-timeline.vertical-timeline--two-columns:before{left:50%;margin-left:-2px}}.vertical-timeline-element{position:relative;margin:2em 0}.vertical-timeline-element>div{min-height:1px}.vertical-timeline-element:after{content:"";display:table;clear:both}.vertical-timeline-element:first-child{margin-top:0}.vertical-timeline-element:last-child{margin-bottom:0}@media only screen and (min-width:1170px){.vertical-timeline-element{margin:4em 0}.vertical-timeline-element:first-child{margin-top:0}.vertical-timeline-element:last-child{margin-bottom:0}}.vertical-timeline-element-icon{position:absolute;top:0;left:0;width:40px;height:40px;border-radius:50%;-webkit-box-shadow:0 0 0 4px #fff,inset 0 2px 0 rgba(0,0,0,.08),0 3px 0 4px rgba(0,0,0,.05);box-shadow:0 0 0 4px #fff,inset 0 2px #00000014,0 3px 0 4px #0000000d}.vertical-timeline--one-column-right .vertical-timeline-element-icon{right:0;left:unset}.vertical-timeline-element-icon svg{display:block;width:24px;height:24px;position:relative;left:50%;top:50%;margin-left:-12px;margin-top:-12px}@media only screen and (min-width:1170px){.vertical-timeline--two-columns .vertical-timeline-element-icon{width:60px;height:60px;left:50%;margin-left:-30px}}.vertical-timeline-element-icon{-webkit-transform:translateZ(0);-webkit-backface-visibility:hidden}.vertical-timeline--animate .vertical-timeline-element-icon.is-hidden{visibility:hidden}.vertical-timeline--animate .vertical-timeline-element-icon.bounce-in{visibility:visible;-webkit-animation:cd-bounce-1 .6s;animation:cd-bounce-1 .6s}@-webkit-keyframes cd-bounce-1{0%{opacity:0;-webkit-transform:scale(.5)}60%{opacity:1;-webkit-transform:scale(1.2)}to{-webkit-transform:scale(1)}}@keyframes cd-bounce-1{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}60%{opacity:1;-webkit-transform:scale(1.2);transform:scale(1.2)}to{-webkit-transform:scale(1);transform:scale(1)}}.vertical-timeline-element-content{position:relative;margin-left:60px;background:#fff;border-radius:.25em;padding:1em;-webkit-box-shadow:0 3px 0 #ddd;box-shadow:0 3px #ddd}.vertical-timeline--one-column-right .vertical-timeline-element-content{margin-right:60px;margin-left:unset}.vertical-timeline-element--no-children .vertical-timeline-element-content{background:0 0;-webkit-box-shadow:none;box-shadow:none}.vertical-timeline-element-content:after{content:"";display:table;clear:both}.vertical-timeline-element-content h2{color:#303e49}.vertical-timeline-element-content .vertical-timeline-element-date,.vertical-timeline-element-content p{font-size:13px;font-size:.8125rem;font-weight:500}.vertical-timeline-element-content .vertical-timeline-element-date{display:inline-block}.vertical-timeline-element-content p{margin:1em 0 0;line-height:1.6}.vertical-timeline-element-title,.vertical-timeline-element-subtitle{margin:0}.vertical-timeline-element-content .vertical-timeline-element-date{float:left;padding:.8em 0;opacity:.7}.vertical-timeline-element-content-arrow{content:"";position:absolute;top:16px;right:100%;height:0;width:0;border:7px solid transparent;border-right:7px solid #fff}.vertical-timeline--one-column-right .vertical-timeline-element-content-arrow{content:"";position:absolute;top:16px;right:unset;left:100%;height:0;width:0;border:7px solid transparent;border-left:7px solid #fff}.vertical-timeline--one-column-right .vertical-timeline-element-content:before{left:100%;border-left:7px solid #fff;border-right:unset}.vertical-timeline-element--no-children .vertical-timeline-element-content:before{display:none}.vertical-timeline-element--no-children .vertical-timeline-element-content-arrow{display:none}@media only screen and (min-width:768px){.vertical-timeline-element-content h2{font-size:20px;font-size:1.25rem}.vertical-timeline-element-content p{font-size:16px;font-size:1rem}.vertical-timeline-element-content .vertical-timeline-element-date{font-size:14px;font-size:.875rem}}@media only screen and (min-width:1170px){.vertical-timeline--two-columns .vertical-timeline-element-content{margin-left:0;padding:1.5em;width:44%}.vertical-timeline--two-columns .vertical-timeline-element-content-arrow{top:24px;left:100%;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.vertical-timeline--two-columns .vertical-timeline-element-content .vertical-timeline-element-date{position:absolute;width:100%;left:124%;top:6px;font-size:16px;font-size:1rem}.vertical-timeline--two-columns .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content,.vertical-timeline--two-columns .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content{float:right}.vertical-timeline--two-columns .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content-arrow,.vertical-timeline--two-columns .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content-arrow{top:24px;left:auto;right:100%;-webkit-transform:rotate(0);transform:rotate(0)}.vertical-timeline--one-column-right .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content-arrow,.vertical-timeline--one-column-right .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content-arrow{top:24px;left:100%;right:auto;-webkit-transform:rotate(0);transform:rotate(0)}.vertical-timeline--two-columns .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content .vertical-timeline-element-date,.vertical-timeline--two-columns .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content .vertical-timeline-element-date{left:auto;right:124%;text-align:right}}.vertical-timeline--animate .vertical-timeline-element-content.is-hidden{visibility:hidden}.vertical-timeline--animate .vertical-timeline-element-content.bounce-in{visibility:visible;-webkit-animation:cd-bounce-2 .6s;animation:cd-bounce-2 .6s}@media only screen and (min-width:1170px){.vertical-timeline--two-columns.vertical-timeline--animate .vertical-timeline-element.vertical-timeline-element--right .vertical-timeline-element-content.bounce-in,.vertical-timeline--two-columns.vertical-timeline--animate .vertical-timeline-element:nth-child(2n):not(.vertical-timeline-element--left) .vertical-timeline-element-content.bounce-in{-webkit-animation:cd-bounce-2-inverse .6s;animation:cd-bounce-2-inverse .6s}}@media only screen and (max-width:1169px){.vertical-timeline--animate .vertical-timeline-element-content.bounce-in{visibility:visible;-webkit-animation:cd-bounce-2-inverse .6s;animation:cd-bounce-2-inverse .6s}}@-webkit-keyframes cd-bounce-2{0%{opacity:0;-webkit-transform:translateX(-100px)}60%{opacity:1;-webkit-transform:translateX(20px)}to{-webkit-transform:translateX(0)}}@keyframes cd-bounce-2{0%{opacity:0;-webkit-transform:translateX(-100px);transform:translate(-100px)}60%{opacity:1;-webkit-transform:translateX(20px);transform:translate(20px)}to{-webkit-transform:translateX(0);transform:translate(0)}}@-webkit-keyframes cd-bounce-2-inverse{0%{opacity:0;-webkit-transform:translateX(100px)}60%{opacity:1;-webkit-transform:translateX(-20px)}to{-webkit-transform:translateX(0)}}@keyframes cd-bounce-2-inverse{0%{opacity:0;-webkit-transform:translateX(100px);transform:translate(100px)}60%{opacity:1;-webkit-transform:translateX(-20px);transform:translate(-20px)}to{-webkit-transform:translateX(0);transform:translate(0)}} diff --git a/dist/assets/index-puXA6els.js b/dist/assets/index-puXA6els.js new file mode 100644 index 0000000..756b58b --- /dev/null +++ b/dist/assets/index-puXA6els.js @@ -0,0 +1,3760 @@ +function fP(n,e){for(var t=0;ti[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function m1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function dP(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var Lw={exports:{}},Bm={},Iw={exports:{}},Ct={};/** + * @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 Lf=Symbol.for("react.element"),hP=Symbol.for("react.portal"),pP=Symbol.for("react.fragment"),mP=Symbol.for("react.strict_mode"),gP=Symbol.for("react.profiler"),vP=Symbol.for("react.provider"),yP=Symbol.for("react.context"),_P=Symbol.for("react.forward_ref"),xP=Symbol.for("react.suspense"),AP=Symbol.for("react.memo"),SP=Symbol.for("react.lazy"),tS=Symbol.iterator;function MP(n){return n===null||typeof n!="object"?null:(n=tS&&n[tS]||n["@@iterator"],typeof n=="function"?n:null)}var Dw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Nw=Object.assign,Fw={};function Cc(n,e,t){this.props=n,this.context=e,this.refs=Fw,this.updater=t||Dw}Cc.prototype.isReactComponent={};Cc.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=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,n,e,"setState")};Cc.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Uw(){}Uw.prototype=Cc.prototype;function g1(n,e,t){this.props=n,this.context=e,this.refs=Fw,this.updater=t||Dw}var v1=g1.prototype=new Uw;v1.constructor=g1;Nw(v1,Cc.prototype);v1.isPureReactComponent=!0;var nS=Array.isArray,Ow=Object.prototype.hasOwnProperty,y1={current:null},kw={key:!0,ref:!0,__self:!0,__source:!0};function Hw(n,e,t){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)Ow.call(e,i)&&!kw.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1>>1,$=D[Y];if(0>>1;Yr(ge,G))we<$&&0>r(Re,ge)?(D[Y]=Re,D[we]=G,Y=we):(D[Y]=ge,D[ue]=G,Y=ue);else if(we<$&&0>r(Re,G))D[Y]=Re,D[we]=G,Y=we;else break e}}return k}function r(D,k){var G=D.sortIndex-k.sortIndex;return G!==0?G:D.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],f=[],d=1,h=null,p=3,v=!1,y=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(D){for(var k=t(f);k!==null;){if(k.callback===null)i(f);else if(k.startTime<=D)i(f),k.sortIndex=k.expirationTime,e(l,k);else break;k=t(f)}}function w(D){if(S=!1,M(D),!y)if(t(l)!==null)y=!0,re(T);else{var k=t(f);k!==null&&ae(w,k.startTime-D)}}function T(D,k){y=!1,S&&(S=!1,m(I),I=-1),v=!0;var G=p;try{for(M(k),h=t(l);h!==null&&(!(h.expirationTime>k)||D&&!H());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,p=h.priorityLevel;var $=Y(h.expirationTime<=k);k=n.unstable_now(),typeof $=="function"?h.callback=$:h===t(l)&&i(l),M(k)}else i(l);h=t(l)}if(h!==null)var Z=!0;else{var ue=t(f);ue!==null&&ae(w,ue.startTime-k),Z=!1}return Z}finally{h=null,p=G,v=!1}}var b=!1,B=null,I=-1,R=5,P=-1;function H(){return!(n.unstable_now()-PD||125Y?(D.sortIndex=G,e(f,D),t(l)===null&&D===t(f)&&(S?(m(I),I=-1):S=!0,ae(w,G-Y))):(D.sortIndex=$,e(l,D),y||v||(y=!0,re(T))),D},n.unstable_shouldYield=H,n.unstable_wrapCallback=function(D){var k=p;return function(){var G=p;p=k;try{return D.apply(this,arguments)}finally{p=G}}}})(Ww);Vw.exports=Ww;var FP=Vw.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 Xw=j,Ji=FP;function _e(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gy=Object.prototype.hasOwnProperty,UP=/^[: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]*$/,rS={},sS={};function OP(n){return gy.call(sS,n)?!0:gy.call(rS,n)?!1:UP.test(n)?sS[n]=!0:(rS[n]=!0,!1)}function kP(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function HP(n,e,t,i){if(e===null||typeof e>"u"||kP(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ai(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Qn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Qn[n]=new Ai(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Qn[e]=new Ai(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Qn[n]=new Ai(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Qn[n]=new Ai(n,2,!1,n,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(n){Qn[n]=new Ai(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Qn[n]=new Ai(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Qn[n]=new Ai(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Qn[n]=new Ai(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Qn[n]=new Ai(n,5,!1,n.toLowerCase(),null,!1,!1)});var x1=/[\-:]([a-z])/g;function A1(n){return n[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(n){var e=n.replace(x1,A1);Qn[e]=new Ai(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(x1,A1);Qn[e]=new Ai(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(x1,A1);Qn[e]=new Ai(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Qn[n]=new Ai(n,1,!1,n.toLowerCase(),null,!1,!1)});Qn.xlinkHref=new Ai("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Qn[n]=new Ai(n,1,!1,n.toLowerCase(),null,!0,!0)});function S1(n,e,t,i){var r=Qn.hasOwnProperty(e)?Qn[e]:null;(r!==null?r.type!==0:i||!(2a||r[o]!==s[a]){var l=` +`+r[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{Hg=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?wu(n):""}function GP(n){switch(n.tag){case 5:return wu(n.type);case 16:return wu("Lazy");case 13:return wu("Suspense");case 19:return wu("SuspenseList");case 0:case 2:case 15:return n=Gg(n.type,!1),n;case 11:return n=Gg(n.type.render,!1),n;case 1:return n=Gg(n.type,!0),n;default:return""}}function xy(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Nl:return"Fragment";case Dl:return"Portal";case vy:return"Profiler";case M1:return"StrictMode";case yy:return"Suspense";case _y:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case Kw:return(n.displayName||"Context")+".Consumer";case jw:return(n._context.displayName||"Context")+".Provider";case E1:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case w1:return e=n.displayName||null,e!==null?e:xy(n.type)||"Memo";case ro:e=n._payload,n=n._init;try{return xy(n(e))}catch{}}return null}function zP(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xy(e);case 8:return e===M1?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Bo(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Qw(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function VP(n){var e=Qw(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function th(n){n._valueTracker||(n._valueTracker=VP(n))}function Zw(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=Qw(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function Op(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Ay(n,e){var t=e.checked;return on({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function aS(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Bo(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function qw(n,e){e=e.checked,e!=null&&S1(n,"checked",e,!1)}function Sy(n,e){qw(n,e);var t=Bo(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?My(n,e.type,t):e.hasOwnProperty("defaultValue")&&My(n,e.type,Bo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function lS(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function My(n,e,t){(e!=="number"||Op(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Cu=Array.isArray;function Ql(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=nh.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Ku(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Lu={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},WP=["Webkit","ms","Moz","O"];Object.keys(Lu).forEach(function(n){WP.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Lu[e]=Lu[n]})});function nC(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Lu.hasOwnProperty(n)&&Lu[n]?(""+e).trim():e+"px"}function iC(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=nC(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var XP=on({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 Cy(n,e){if(e){if(XP[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(_e(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(_e(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(_e(61))}if(e.style!=null&&typeof e.style!="object")throw Error(_e(62))}}function Ty(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){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 Ry=null;function C1(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var by=null,Zl=null,ql=null;function fS(n){if(n=Nf(n)){if(typeof by!="function")throw Error(_e(280));var e=n.stateNode;e&&(e=Nm(e),by(n.stateNode,n.type,e))}}function rC(n){Zl?ql?ql.push(n):ql=[n]:Zl=n}function sC(){if(Zl){var n=Zl,e=ql;if(ql=Zl=null,fS(n),e)for(n=0;n>>=0,n===0?32:31-(nL(n)/iL|0)|0}var ih=64,rh=4194304;function Tu(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function zp(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=Tu(a):(s&=o,s!==0&&(i=Tu(s)))}else o=t&~r,o!==0?i=Tu(o):s!==0&&(i=Tu(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function If(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Pr(e),n[e]=t}function aL(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=Du),xS=" ",AS=!1;function wC(n,e){switch(n){case"keyup":return NL.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function CC(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Fl=!1;function UL(n,e){switch(n){case"compositionend":return CC(e);case"keypress":return e.which!==32?null:(AS=!0,xS);case"textInput":return n=e.data,n===xS&&AS?null:n;default:return null}}function OL(n,e){if(Fl)return n==="compositionend"||!D1&&wC(n,e)?(n=MC(),Ap=P1=fo=null,Fl=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=wS(t)}}function BC(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?BC(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function PC(){for(var n=window,e=Op();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=Op(n.document)}return e}function N1(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function jL(n){var e=PC(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&BC(t.ownerDocument.documentElement,t)){if(i!==null&&N1(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=CS(t,s);var o=CS(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Ul=null,Ny=null,Fu=null,Fy=!1;function TS(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;Fy||Ul==null||Ul!==Op(i)||(i=Ul,"selectionStart"in i&&N1(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Fu&&ef(Fu,i)||(Fu=i,i=Xp(Ny,"onSelect"),0Hl||(n.current=zy[Hl],zy[Hl]=null,Hl--)}function Vt(n,e){Hl++,zy[Hl]=n.current,n.current=e}var Po={},ci=Uo(Po),Bi=Uo(!1),ba=Po;function ac(n,e){var t=n.type.contextTypes;if(!t)return Po;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function Pi(n){return n=n.childContextTypes,n!=null}function jp(){Kt(Bi),Kt(ci)}function DS(n,e,t){if(ci.current!==Po)throw Error(_e(168));Vt(ci,e),Vt(Bi,t)}function HC(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(_e(108,zP(n)||"Unknown",r));return on({},t,i)}function Kp(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Po,ba=ci.current,Vt(ci,n),Vt(Bi,Bi.current),!0}function NS(n,e,t){var i=n.stateNode;if(!i)throw Error(_e(169));t?(n=HC(n,e,ba),i.__reactInternalMemoizedMergedChildContext=n,Kt(Bi),Kt(ci),Vt(ci,n)):Kt(Bi),Vt(Bi,t)}var xs=null,Fm=!1,tv=!1;function GC(n){xs===null?xs=[n]:xs.push(n)}function sI(n){Fm=!0,GC(n)}function Oo(){if(!tv&&xs!==null){tv=!0;var n=0,e=kt;try{var t=xs;for(kt=1;n>=o,r-=o,Ss=1<<32-Pr(e)+r|t<I?(R=B,B=null):R=B.sibling;var P=p(m,B,M[I],w);if(P===null){B===null&&(B=R);break}n&&B&&P.alternate===null&&e(m,B),A=s(P,A,I),b===null?T=P:b.sibling=P,b=P,B=R}if(I===M.length)return t(m,B),Zt&&la(m,I),T;if(B===null){for(;II?(R=B,B=null):R=B.sibling;var H=p(m,B,P.value,w);if(H===null){B===null&&(B=R);break}n&&B&&H.alternate===null&&e(m,B),A=s(H,A,I),b===null?T=H:b.sibling=H,b=H,B=R}if(P.done)return t(m,B),Zt&&la(m,I),T;if(B===null){for(;!P.done;I++,P=M.next())P=h(m,P.value,w),P!==null&&(A=s(P,A,I),b===null?T=P:b.sibling=P,b=P);return Zt&&la(m,I),T}for(B=i(m,B);!P.done;I++,P=M.next())P=v(B,m,I,P.value,w),P!==null&&(n&&P.alternate!==null&&B.delete(P.key===null?I:P.key),A=s(P,A,I),b===null?T=P:b.sibling=P,b=P);return n&&B.forEach(function(J){return e(m,J)}),Zt&&la(m,I),T}function x(m,A,M,w){if(typeof M=="object"&&M!==null&&M.type===Nl&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case eh:e:{for(var T=M.key,b=A;b!==null;){if(b.key===T){if(T=M.type,T===Nl){if(b.tag===7){t(m,b.sibling),A=r(b,M.props.children),A.return=m,m=A;break e}}else if(b.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===ro&&zS(T)===b.type){t(m,b.sibling),A=r(b,M.props),A.ref=lu(m,b,M),A.return=m,m=A;break e}t(m,b);break}else e(m,b);b=b.sibling}M.type===Nl?(A=Ma(M.props.children,m.mode,w,M.key),A.return=m,m=A):(w=bp(M.type,M.key,M.props,null,m.mode,w),w.ref=lu(m,A,M),w.return=m,m=w)}return o(m);case Dl:e:{for(b=M.key;A!==null;){if(A.key===b)if(A.tag===4&&A.stateNode.containerInfo===M.containerInfo&&A.stateNode.implementation===M.implementation){t(m,A.sibling),A=r(A,M.children||[]),A.return=m,m=A;break e}else{t(m,A);break}else e(m,A);A=A.sibling}A=cv(M,m.mode,w),A.return=m,m=A}return o(m);case ro:return b=M._init,x(m,A,b(M._payload),w)}if(Cu(M))return y(m,A,M,w);if(iu(M))return S(m,A,M,w);fh(m,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,A!==null&&A.tag===6?(t(m,A.sibling),A=r(A,M),A.return=m,m=A):(t(m,A),A=lv(M,m.mode,w),A.return=m,m=A),o(m)):t(m,A)}return x}var cc=YC(!0),QC=YC(!1),Ff={},Zr=Uo(Ff),sf=Uo(Ff),of=Uo(Ff);function ga(n){if(n===Ff)throw Error(_e(174));return n}function W1(n,e){switch(Vt(of,e),Vt(sf,n),Vt(Zr,Ff),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:wy(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=wy(e,n)}Kt(Zr),Vt(Zr,e)}function uc(){Kt(Zr),Kt(sf),Kt(of)}function ZC(n){ga(of.current);var e=ga(Zr.current),t=wy(e,n.type);e!==t&&(Vt(sf,n),Vt(Zr,t))}function X1(n){sf.current===n&&(Kt(Zr),Kt(sf))}var tn=Uo(0);function em(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var nv=[];function J1(){for(var n=0;nt?t:4,n(!0);var i=iv.transition;iv.transition={};try{n(!1),e()}finally{kt=t,iv.transition=i}}function h3(){return mr().memoizedState}function cI(n,e,t){var i=Mo(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},p3(n))m3(e,t);else if(t=XC(n,e,t,i),t!==null){var r=yi();Lr(t,n,i,r),g3(t,e,i)}}function uI(n,e,t){var i=Mo(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(p3(n))m3(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,Ir(a,o)){var l=e.interleaved;l===null?(r.next=r,z1(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=XC(n,e,r,i),t!==null&&(r=yi(),Lr(t,n,i,r),g3(t,e,i))}}function p3(n){var e=n.alternate;return n===sn||e!==null&&e===sn}function m3(n,e){Uu=tm=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function g3(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,R1(n,t)}}var nm={readContext:pr,useCallback:ti,useContext:ti,useEffect:ti,useImperativeHandle:ti,useInsertionEffect:ti,useLayoutEffect:ti,useMemo:ti,useReducer:ti,useRef:ti,useState:ti,useDebugValue:ti,useDeferredValue:ti,useTransition:ti,useMutableSource:ti,useSyncExternalStore:ti,useId:ti,unstable_isNewReconciler:!1},fI={readContext:pr,useCallback:function(n,e){return Kr().memoizedState=[n,e===void 0?null:e],n},useContext:pr,useEffect:WS,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,wp(4194308,4,l3.bind(null,e,n),t)},useLayoutEffect:function(n,e){return wp(4194308,4,n,e)},useInsertionEffect:function(n,e){return wp(4,2,n,e)},useMemo:function(n,e){var t=Kr();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Kr();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=cI.bind(null,sn,n),[i.memoizedState,n]},useRef:function(n){var e=Kr();return n={current:n},e.memoizedState=n},useState:VS,useDebugValue:Z1,useDeferredValue:function(n){return Kr().memoizedState=n},useTransition:function(){var n=VS(!1),e=n[0];return n=lI.bind(null,n[1]),Kr().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=sn,r=Kr();if(Zt){if(t===void 0)throw Error(_e(407));t=t()}else{if(t=e(),Gn===null)throw Error(_e(349));Pa&30||e3(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,WS(n3.bind(null,i,s,n),[n]),i.flags|=2048,cf(9,t3.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=Kr(),e=Gn.identifierPrefix;if(Zt){var t=Ms,i=Ss;t=(i&~(1<<32-Pr(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=af++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[Yr]=e,n[rf]=i,w3(n,e,!1,!1),e.stateNode=n;e:{switch(o=Ty(t,i),t){case"dialog":Jt("cancel",n),Jt("close",n),r=i;break;case"iframe":case"object":case"embed":Jt("load",n),r=i;break;case"video":case"audio":for(r=0;rdc&&(e.flags|=128,i=!0,cu(s,!1),e.lanes=4194304)}else{if(!i)if(n=em(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),cu(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Zt)return ni(e),null}else 2*_n()-s.renderingStartTime>dc&&t!==1073741824&&(e.flags|=128,i=!0,cu(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=_n(),e.sibling=null,t=tn.current,Vt(tn,i?t&1|2:t&1),e):(ni(e),null);case 22:case 23:return i_(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Hi&1073741824&&(ni(e),e.subtreeFlags&6&&(e.flags|=8192)):ni(e),null;case 24:return null;case 25:return null}throw Error(_e(156,e.tag))}function _I(n,e){switch(U1(e),e.tag){case 1:return Pi(e.type)&&jp(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return uc(),Kt(Bi),Kt(ci),J1(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return X1(e),null;case 13:if(Kt(tn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(_e(340));lc()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Kt(tn),null;case 4:return uc(),null;case 10:return G1(e.type._context),null;case 22:case 23:return i_(),null;case 24:return null;default:return null}}var hh=!1,oi=!1,xI=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Wl(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){un(n,e,i)}else t.current=null}function e2(n,e,t){try{t()}catch(i){un(n,e,i)}}var $S=!1;function AI(n,e){if(Uy=Vp,n=PC(),N1(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,f=0,d=0,h=n,p=null;t:for(;;){for(var v;h!==t||r!==0&&h.nodeType!==3||(a=o+r),h!==s||i!==0&&h.nodeType!==3||(l=o+i),h.nodeType===3&&(o+=h.nodeValue.length),(v=h.firstChild)!==null;)p=h,h=v;for(;;){if(h===n)break t;if(p===t&&++f===r&&(a=o),p===s&&++d===i&&(l=o),(v=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=v}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(Oy={focusedElem:n,selectionRange:t},Vp=!1,ke=e;ke!==null;)if(e=ke,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,ke=n;else for(;ke!==null;){e=ke;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var S=y.memoizedProps,x=y.memoizedState,m=e.stateNode,A=m.getSnapshotBeforeUpdate(e.elementType===e.type?S:Sr(e.type,S),x);m.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var M=e.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_e(163))}}catch(w){un(e,e.return,w)}if(n=e.sibling,n!==null){n.return=e.return,ke=n;break}ke=e.return}return y=$S,$S=!1,y}function Ou(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&e2(e,t,s)}r=r.next}while(r!==i)}}function km(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function t2(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function R3(n){var e=n.alternate;e!==null&&(n.alternate=null,R3(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Yr],delete e[rf],delete e[Gy],delete e[iI],delete e[rI])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function b3(n){return n.tag===5||n.tag===3||n.tag===4}function eM(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||b3(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function n2(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Jp));else if(i!==4&&(n=n.child,n!==null))for(n2(n,e,t),n=n.sibling;n!==null;)n2(n,e,t),n=n.sibling}function i2(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(i2(n,e,t),n=n.sibling;n!==null;)i2(n,e,t),n=n.sibling}var Jn=null,Er=!1;function js(n,e,t){for(t=t.child;t!==null;)B3(n,e,t),t=t.sibling}function B3(n,e,t){if(Qr&&typeof Qr.onCommitFiberUnmount=="function")try{Qr.onCommitFiberUnmount(Pm,t)}catch{}switch(t.tag){case 5:oi||Wl(t,e);case 6:var i=Jn,r=Er;Jn=null,js(n,e,t),Jn=i,Er=r,Jn!==null&&(Er?(n=Jn,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Jn.removeChild(t.stateNode));break;case 18:Jn!==null&&(Er?(n=Jn,t=t.stateNode,n.nodeType===8?ev(n.parentNode,t):n.nodeType===1&&ev(n,t),qu(n)):ev(Jn,t.stateNode));break;case 4:i=Jn,r=Er,Jn=t.stateNode.containerInfo,Er=!0,js(n,e,t),Jn=i,Er=r;break;case 0:case 11:case 14:case 15:if(!oi&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&e2(t,e,o),r=r.next}while(r!==i)}js(n,e,t);break;case 1:if(!oi&&(Wl(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){un(t,e,a)}js(n,e,t);break;case 21:js(n,e,t);break;case 22:t.mode&1?(oi=(i=oi)||t.memoizedState!==null,js(n,e,t),oi=i):js(n,e,t);break;default:js(n,e,t)}}function tM(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new xI),e.forEach(function(i){var r=BI.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function yr(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=_n()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*MI(i/1960))-i,10n?16:n,ho===null)var i=!1;else{if(n=ho,ho=null,sm=0,Lt&6)throw Error(_e(331));var r=Lt;for(Lt|=4,ke=n.current;ke!==null;){var s=ke,o=s.child;if(ke.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l_n()-t_?Sa(n,0):e_|=t),Li(n,e)}function O3(n,e){e===0&&(n.mode&1?(e=rh,rh<<=1,!(rh&130023424)&&(rh=4194304)):e=1);var t=yi();n=Ps(n,e),n!==null&&(If(n,e,t),Li(n,t))}function bI(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),O3(n,t)}function BI(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(_e(314))}i!==null&&i.delete(e),O3(n,t)}var k3;k3=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Bi.current)bi=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return bi=!1,vI(n,e,t);bi=!!(n.flags&131072)}else bi=!1,Zt&&e.flags&1048576&&zC(e,Qp,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Cp(n,e),n=e.pendingProps;var r=ac(e,ci.current);ec(e,t),r=K1(null,e,i,n,r,t);var s=Y1();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Pi(i)?(s=!0,Kp(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,V1(e),r.updater=Um,e.stateNode=r,r._reactInternals=e,jy(e,i,n,t),e=Qy(null,e,i,!0,s,t)):(e.tag=0,Zt&&s&&F1(e),gi(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Cp(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=LI(i),n=Sr(i,n),r){case 0:e=Yy(null,e,i,n,t);break e;case 1:e=QS(null,e,i,n,t);break e;case 11:e=KS(null,e,i,n,t);break e;case 14:e=YS(null,e,i,Sr(i.type,n),t);break e}throw Error(_e(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Sr(i,r),Yy(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Sr(i,r),QS(n,e,i,r,t);case 3:e:{if(S3(e),n===null)throw Error(_e(387));i=e.pendingProps,s=e.memoizedState,r=s.element,JC(n,e),$p(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=fc(Error(_e(423)),e),e=ZS(n,e,i,t,r);break e}else if(i!==r){r=fc(Error(_e(424)),e),e=ZS(n,e,i,t,r);break e}else for(zi=xo(e.stateNode.containerInfo.firstChild),Wi=e,Zt=!0,wr=null,t=QC(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(lc(),i===r){e=Ls(n,e,t);break e}gi(n,e,i,t)}e=e.child}return e;case 5:return ZC(e),n===null&&Wy(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,ky(i,r)?o=null:s!==null&&ky(i,s)&&(e.flags|=32),A3(n,e),gi(n,e,o,t),e.child;case 6:return n===null&&Wy(e),null;case 13:return M3(n,e,t);case 4:return W1(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=cc(e,null,i,t):gi(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Sr(i,r),KS(n,e,i,r,t);case 7:return gi(n,e,e.pendingProps,t),e.child;case 8:return gi(n,e,e.pendingProps.children,t),e.child;case 12:return gi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,Vt(Zp,i._currentValue),i._currentValue=o,s!==null)if(Ir(s.value,o)){if(s.children===r.children&&!Bi.current){e=Ls(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Cs(-1,t&-t),l.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var d=f.pending;d===null?l.next=l:(l.next=d.next,d.next=l),f.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),Xy(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(_e(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),Xy(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}gi(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,ec(e,t),r=pr(r),i=i(r),e.flags|=1,gi(n,e,i,t),e.child;case 14:return i=e.type,r=Sr(i,e.pendingProps),r=Sr(i.type,r),YS(n,e,i,r,t);case 15:return _3(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Sr(i,r),Cp(n,e),e.tag=1,Pi(i)?(n=!0,Kp(e)):n=!1,ec(e,t),KC(e,i,r),jy(e,i,r,t),Qy(null,e,i,!0,n,t);case 19:return E3(n,e,t);case 22:return x3(n,e,t)}throw Error(_e(156,e.tag))};function H3(n,e){return dC(n,e)}function PI(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dr(n,e,t,i){return new PI(n,e,t,i)}function s_(n){return n=n.prototype,!(!n||!n.isReactComponent)}function LI(n){if(typeof n=="function")return s_(n)?1:0;if(n!=null){if(n=n.$$typeof,n===E1)return 11;if(n===w1)return 14}return 2}function Eo(n,e){var t=n.alternate;return t===null?(t=dr(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function bp(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")s_(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Nl:return Ma(t.children,r,s,e);case M1:o=8,r|=8;break;case vy:return n=dr(12,t,e,r|2),n.elementType=vy,n.lanes=s,n;case yy:return n=dr(13,t,e,r),n.elementType=yy,n.lanes=s,n;case _y:return n=dr(19,t,e,r),n.elementType=_y,n.lanes=s,n;case Yw:return Gm(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case jw:o=10;break e;case Kw:o=9;break e;case E1:o=11;break e;case w1:o=14;break e;case ro:o=16,i=null;break e}throw Error(_e(130,n==null?n:typeof n,""))}return e=dr(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Ma(n,e,t,i){return n=dr(7,n,i,e),n.lanes=t,n}function Gm(n,e,t,i){return n=dr(22,n,i,e),n.elementType=Yw,n.lanes=t,n.stateNode={isHidden:!1},n}function lv(n,e,t){return n=dr(6,n,null,e),n.lanes=t,n}function cv(n,e,t){return e=dr(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function II(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vg(0),this.expirationTimes=Vg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vg(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function o_(n,e,t,i,r,s,o,a,l){return n=new II(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=dr(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},V1(s),n}function DI(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(W3)}catch(n){console.error(n)}}W3(),zw.exports=Ki;var kI=zw.exports,cM=kI;my.createRoot=cM.createRoot,my.hydrateRoot=cM.hydrateRoot;/** + * @remix-run/router v1.13.1 + * + * 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 ff(){return ff=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u")throw new Error(e)}function u_(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function GI(){return Math.random().toString(36).substr(2,8)}function fM(n,e){return{usr:n.state,key:n.key,idx:e}}function l2(n,e,t,i){return t===void 0&&(t=null),ff({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?bc(e):e,{state:t,key:e&&e.key||i||GI()})}function lm(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function bc(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function zI(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,a=po.Pop,l=null,f=d();f==null&&(f=0,o.replaceState(ff({},o.state,{idx:f}),""));function d(){return(o.state||{idx:null}).idx}function h(){a=po.Pop;let x=d(),m=x==null?null:x-f;f=x,l&&l({action:a,location:S.location,delta:m})}function p(x,m){a=po.Push;let A=l2(S.location,x,m);t&&t(A,x),f=d()+1;let M=fM(A,f),w=S.createHref(A);try{o.pushState(M,"",w)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;r.location.assign(w)}s&&l&&l({action:a,location:S.location,delta:1})}function v(x,m){a=po.Replace;let A=l2(S.location,x,m);t&&t(A,x),f=d();let M=fM(A,f),w=S.createHref(A);o.replaceState(M,"",w),s&&l&&l({action:a,location:S.location,delta:0})}function y(x){let m=r.location.origin!=="null"?r.location.origin:r.location.href,A=typeof x=="string"?x:lm(x);return hn(m,"No window.location.(origin|href) available to create URL for href: "+A),new URL(A,m)}let S={get action(){return a},get location(){return n(r,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(uM,h),l=x,()=>{r.removeEventListener(uM,h),l=null}},createHref(x){return e(r,x)},createURL:y,encodeLocation(x){let m=y(x);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:v,go(x){return o.go(x)}};return S}var dM;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(dM||(dM={}));function VI(n,e,t){t===void 0&&(t="/");let i=typeof e=="string"?bc(e):e,r=df(i.pathname||"/",t);if(r==null)return null;let s=X3(n);WI(s);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(hn(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let f=wo([i,l.relativePath]),d=t.concat(l);s.children&&s.children.length>0&&(hn(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),X3(s.children,e,d,f)),!(s.path==null&&!s.index)&&e.push({path:f,score:ZI(f,s.index),routesMeta:d})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))r(s,o);else for(let l of J3(s.path))r(s,o,l)}),e}function J3(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),s=t.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=J3(i.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),r&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function WI(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:qI(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const XI=/^:\w+$/,JI=3,jI=2,KI=1,YI=10,QI=-2,hM=n=>n==="*";function ZI(n,e){let t=n.split("/"),i=t.length;return t.some(hM)&&(i+=QI),e&&(i+=jI),t.filter(r=>!hM(r)).reduce((r,s)=>r+(XI.test(s)?JI:s===""?KI:YI),i)}function qI(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function $I(n,e){let{routesMeta:t}=n,i={},r="/",s=[];for(let o=0;o{let{paramName:p,isOptional:v}=d;if(p==="*"){let S=a[h]||"";o=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const y=a[h];return v&&!y?f[p]=void 0:f[p]=n4(y||"",p),f},{}),pathname:s,pathnameBase:o,pattern:n}}function e4(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),u_(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(o,a,l)=>(i.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(i.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function t4(n){try{return decodeURI(n)}catch(e){return u_(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function n4(n,e){try{return decodeURIComponent(n)}catch(t){return u_(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+n+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),n}}function df(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function i4(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?bc(n):n;return{pathname:t?t.startsWith("/")?t:r4(t,e):e,search:o4(i),hash:a4(r)}}function r4(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function uv(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function j3(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function K3(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=bc(n):(r=ff({},n),hn(!r.pathname||!r.pathname.includes("?"),uv("?","pathname","search",r)),hn(!r.pathname||!r.pathname.includes("#"),uv("#","pathname","hash",r)),hn(!r.search||!r.search.includes("#"),uv("#","search","hash",r)));let s=n===""||r.pathname==="",o=s?"/":r.pathname,a;if(o==null)a=t;else if(i){let h=e[e.length-1].replace(/^\//,"").split("/");if(o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),h.pop();r.pathname=p.join("/")}a="/"+h.join("/")}else{let h=e.length-1;if(o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),h-=1;r.pathname=p.join("/")}a=h>=0?e[h]:"/"}let l=i4(r,a),f=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(f||d)&&(l.pathname+="/"),l}const wo=n=>n.join("/").replace(/\/\/+/g,"/"),s4=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),o4=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,a4=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function l4(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const Y3=["post","put","patch","delete"];new Set(Y3);const c4=["get",...Y3];new Set(c4);/** + * React Router v6.20.1 + * + * 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 cm(){return cm=Object.assign?Object.assign.bind():function(n){for(var e=1;el.pathnameBase)),o=j.useRef(!1);return q3(()=>{o.current=!0}),j.useCallback(function(l,f){if(f===void 0&&(f={}),!o.current)return;if(typeof l=="number"){t.go(l);return}let d=K3(l,JSON.parse(s),r,f.relative==="path");n==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:wo([e,d.pathname])),(f.replace?t.replace:t.push)(d,f.state,f)},[e,t,s,r,n])}function Km(n,e){let{relative:t}=e===void 0?{}:e,{matches:i}=j.useContext(Ga),{pathname:r}=Of(),s=JSON.stringify(j3(i).map(o=>o.pathnameBase));return j.useMemo(()=>K3(n,JSON.parse(s),r,t==="path"),[n,s,r,t])}function h4(n,e){return p4(n,e)}function p4(n,e,t){Uf()||hn(!1);let{navigator:i}=j.useContext(Ha),{matches:r}=j.useContext(Ga),s=r[r.length-1],o=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let l=Of(),f;if(e){var d;let S=typeof e=="string"?bc(e):e;a==="/"||(d=S.pathname)!=null&&d.startsWith(a)||hn(!1),f=S}else f=l;let h=f.pathname||"/",p=a==="/"?h:h.slice(a.length)||"/",v=VI(n,{pathname:p}),y=_4(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:wo([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:wo([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),r,t);return e&&y?j.createElement(jm.Provider,{value:{location:cm({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:po.Pop}},y):y}function m4(){let n=M4(),e=l4(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},e),t?j.createElement("pre",{style:r},t):null,s)}const g4=j.createElement(m4,null);class v4 extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?j.createElement(Ga.Provider,{value:this.props.routeContext},j.createElement(Z3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function y4(n){let{routeContext:e,match:t,children:i}=n,r=j.useContext(Jm);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Ga.Provider,{value:e},i)}function _4(n,e,t){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),n==null){var r;if((r=t)!=null&&r.errors)n=t.matches;else return null}let s=n,o=(i=t)==null?void 0:i.errors;if(o!=null){let a=s.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id]));a>=0||hn(!1),s=s.slice(0,Math.min(s.length,a+1))}return s.reduceRight((a,l,f)=>{let d=l.route.id?o==null?void 0:o[l.route.id]:null,h=null;t&&(h=l.route.errorElement||g4);let p=e.concat(s.slice(0,f+1)),v=()=>{let y;return d?y=h:l.route.Component?y=j.createElement(l.route.Component,null):l.route.element?y=l.route.element:y=a,j.createElement(y4,{match:l,routeContext:{outlet:a,matches:p,isDataRoute:t!=null},children:y})};return t&&(l.route.ErrorBoundary||l.route.errorElement||f===0)?j.createElement(v4,{location:t.location,revalidation:t.revalidation,component:h,error:d,children:v(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):v()},null)}var $3=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}($3||{}),um=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(um||{});function x4(n){let e=j.useContext(Jm);return e||hn(!1),e}function A4(n){let e=j.useContext(Q3);return e||hn(!1),e}function S4(n){let e=j.useContext(Ga);return e||hn(!1),e}function eT(n){let e=S4(),t=e.matches[e.matches.length-1];return t.route.id||hn(!1),t.route.id}function M4(){var n;let e=j.useContext(Z3),t=A4(um.UseRouteError),i=eT(um.UseRouteError);return e||((n=t.errors)==null?void 0:n[i])}function E4(){let{router:n}=x4($3.UseNavigateStable),e=eT(um.UseNavigateStable),t=j.useRef(!1);return q3(()=>{t.current=!0}),j.useCallback(function(r,s){s===void 0&&(s={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,cm({fromRouteId:e},s)))},[n,e])}function bu(n){hn(!1)}function w4(n){let{basename:e="/",children:t=null,location:i,navigationType:r=po.Pop,navigator:s,static:o=!1}=n;Uf()&&hn(!1);let a=e.replace(/^\/*/,"/"),l=j.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof i=="string"&&(i=bc(i));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:v="default"}=i,y=j.useMemo(()=>{let S=df(f,a);return S==null?null:{location:{pathname:S,search:d,hash:h,state:p,key:v},navigationType:r}},[a,f,d,h,p,v,r]);return y==null?null:j.createElement(Ha.Provider,{value:l},j.createElement(jm.Provider,{children:t,value:y}))}function C4(n){let{children:e,location:t}=n;return h4(u2(e),t)}new Promise(()=>{});function u2(n,e){e===void 0&&(e=[]);let t=[];return j.Children.forEach(n,(i,r)=>{if(!j.isValidElement(i))return;let s=[...e,r];if(i.type===j.Fragment){t.push.apply(t,u2(i.props.children,s));return}i.type!==bu&&hn(!1),!i.props.index||!i.props.children||hn(!1);let o={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(o.children=u2(i.props.children,s)),t.push(o)}),t}/** + * React Router DOM v6.20.1 + * + * 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 fm(){return fm=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}function T4(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function R4(n,e){return n.button===0&&(!e||e==="_self")&&!T4(n)}const b4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],B4=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],P4=j.createContext({isTransitioning:!1}),L4="startTransition",pM=bP[L4];function I4(n){let{basename:e,children:t,future:i,window:r}=n,s=j.useRef();s.current==null&&(s.current=HI({window:r,v5Compat:!0}));let o=s.current,[a,l]=j.useState({action:o.action,location:o.location}),{v7_startTransition:f}=i||{},d=j.useCallback(h=>{f&&pM?pM(()=>l(h)):l(h)},[l,f]);return j.useLayoutEffect(()=>o.listen(d),[o,d]),j.createElement(w4,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o})}const D4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",N4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ym=j.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:s,replace:o,state:a,target:l,to:f,preventScrollReset:d,unstable_viewTransition:h}=e,p=tT(e,b4),{basename:v}=j.useContext(Ha),y,S=!1;if(typeof f=="string"&&N4.test(f)&&(y=f,D4))try{let M=new URL(window.location.href),w=f.startsWith("//")?new URL(M.protocol+f):new URL(f),T=df(w.pathname,v);w.origin===M.origin&&T!=null?f=T+w.search+w.hash:S=!0}catch{}let x=u4(f,{relative:r}),m=U4(f,{replace:o,state:a,target:l,preventScrollReset:d,relative:r,unstable_viewTransition:h});function A(M){i&&i(M),M.defaultPrevented||m(M)}return j.createElement("a",fm({},p,{href:y||x,onClick:S||s?i:A,ref:t,target:l}))}),fv=j.forwardRef(function(e,t){let{"aria-current":i="page",caseSensitive:r=!1,className:s="",end:o=!1,style:a,to:l,unstable_viewTransition:f,children:d}=e,h=tT(e,B4),p=Km(l,{relative:h.relative}),v=Of(),y=j.useContext(Q3),{navigator:S}=j.useContext(Ha),x=y!=null&&O4(p)&&f===!0,m=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,A=v.pathname,M=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(A=A.toLowerCase(),M=M?M.toLowerCase():null,m=m.toLowerCase());const w=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let T=A===m||!o&&A.startsWith(m)&&A.charAt(w)==="/",b=M!=null&&(M===m||!o&&M.startsWith(m)&&M.charAt(m.length)==="/"),B={isActive:T,isPending:b,isTransitioning:x},I=T?i:void 0,R;typeof s=="function"?R=s(B):R=[s,T?"active":null,b?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let P=typeof a=="function"?a(B):a;return j.createElement(Ym,fm({},h,{"aria-current":I,className:R,ref:t,style:P,to:l,unstable_viewTransition:f}),typeof d=="function"?d(B):d)});var f2;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(f2||(f2={}));var mM;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(mM||(mM={}));function F4(n){let e=j.useContext(Jm);return e||hn(!1),e}function U4(n,e){let{target:t,replace:i,state:r,preventScrollReset:s,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,l=f4(),f=Of(),d=Km(n,{relative:o});return j.useCallback(h=>{if(R4(h,t)){h.preventDefault();let p=i!==void 0?i:lm(f)===lm(d);l(n,{replace:p,state:r,preventScrollReset:s,relative:o,unstable_viewTransition:a})}},[f,l,d,i,r,t,n,s,o,a])}function O4(n,e){e===void 0&&(e={});let t=j.useContext(P4);t==null&&hn(!1);let{basename:i}=F4(f2.useViewTransitionState),r=Km(n,{relative:e.relative});if(!t.isTransitioning)return!1;let s=df(t.currentLocation.pathname,i)||t.currentLocation.pathname,o=df(t.nextLocation.pathname,i)||t.nextLocation.pathname;return c2(r.pathname,o)!=null||c2(r.pathname,s)!=null}const k4="/assets/starbucks-Y_GH9OfM.png",H4="/assets/tesla-weNJuekE.png",G4="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='48'%20height='48'%20rx='8.88889'%20fill='white'/%3e%3cpath%20d='M11.26%2030H7.9L13.76%2016.6H18.04L23.94%2030H20.5L19.24%2027.04H12.54L11.26%2030ZM14.96%2021.42L13.7%2024.34H18.08L16.82%2021.42L16%2019.34H15.78L14.96%2021.42ZM27.6398%2030H24.6398V16.6H27.6398V21.92H34.6398V16.6H37.6398V30H34.6398V24.62H27.6398V30Z'%20fill='url(%23paint0_linear_1545_39)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1545_39'%20x1='8'%20y1='35.5'%20x2='38.0109'%20y2='10.5484'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23989FFF'/%3e%3cstop%20offset='1'%20stop-color='%2329A2FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",z4=()=>ne.jsxs("header",{className:"header",children:[ne.jsx(fv,{to:"/",children:ne.jsx("img",{src:G4,alt:"logo",className:"ml-1 w-18 h-18 object-unset"})}),ne.jsxs("nav",{className:"flex text-lg gap-6 font-medium",children:[ne.jsx(fv,{to:"/about",className:({isActive:n})=>n?"text-blue-600":"text-black",children:"About"}),ne.jsx(fv,{to:"/projects",className:({isActive:n})=>n?"text-blue-600":"text-black",children:"Projects"})]})]});/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */const kf="159",V4={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},W4={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},nT=0,d2=1,iT=2,X4=3,rT=0,Qm=1,Gu=2,Mr=3,ns=0,_i=1,Tr=2,J4=2,Ts=0,Ea=1,h2=2,p2=3,m2=4,sT=5,uo=100,oT=101,aT=102,g2=103,v2=104,lT=200,cT=201,uT=202,fT=203,dm=204,hm=205,dT=206,hT=207,pT=208,mT=209,gT=210,vT=211,yT=212,_T=213,xT=214,AT=0,ST=1,MT=2,hf=3,ET=4,wT=5,CT=6,TT=7,Hf=0,RT=1,bT=2,qr=0,BT=1,PT=2,LT=3,f_=4,IT=5,y2="attached",DT="detached",Zm=300,Is=301,Lo=302,pf=303,mf=304,Bc=306,Io=1e3,jn=1001,hc=1002,fn=1003,gf=1004,j4=1004,nc=1005,K4=1005,nn=1006,qm=1007,Y4=1007,is=1008,Q4=1008,$r=1009,NT=1010,FT=1011,$m=1012,d_=1013,Es=1014,Rr=1015,pc=1016,h_=1017,p_=1018,Co=1020,UT=1021,vi=1023,OT=1024,kT=1025,To=1026,Da=1027,HT=1028,m_=1029,GT=1030,g_=1031,v_=1033,Bp=33776,Pp=33777,Lp=33778,Ip=33779,_2=35840,x2=35841,A2=35842,S2=35843,y_=36196,M2=37492,E2=37496,w2=37808,C2=37809,T2=37810,R2=37811,b2=37812,B2=37813,P2=37814,L2=37815,I2=37816,D2=37817,N2=37818,F2=37819,U2=37820,O2=37821,Dp=36492,k2=36494,H2=36495,zT=36283,G2=36284,z2=36285,V2=36286,VT=2200,WT=2201,XT=2202,mc=2300,Na=2301,Np=2302,va=2400,ya=2401,vf=2402,e0=2500,__=2501,JT=0,x_=1,pm=2,A_=3e3,Ro=3001,jT=3200,KT=3201,ko=0,YT=1,Gi="",Rn="srgb",rs="srgb-linear",t0="display-p3",Gf="display-p3-linear",yf="linear",zt="srgb",_f="rec709",xf="p3",Z4=0,ua=7680,q4=7681,$4=7682,eD=7683,tD=34055,nD=34056,iD=5386,rD=512,sD=513,oD=514,aD=515,lD=516,cD=517,uD=518,W2=519,QT=512,ZT=513,qT=514,S_=515,$T=516,eR=517,tR=518,nR=519,Af=35044,fD=35048,dD=35040,hD=35045,pD=35049,mD=35041,gD=35046,vD=35050,yD=35042,_D="100",X2="300 es",mm=1035,br=2e3,gc=2001;class Fs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+ii[n>>16&255]+ii[n>>24&255]+"-"+ii[e&255]+ii[e>>8&255]+"-"+ii[e>>16&15|64]+ii[e>>24&255]+"-"+ii[t&63|128]+ii[t>>8&255]+"-"+ii[t>>16&255]+ii[t>>24&255]+ii[i&255]+ii[i>>8&255]+ii[i>>16&255]+ii[i>>24&255]).toLowerCase()}function dn(n,e,t){return Math.max(e,Math.min(t,n))}function M_(n,e){return(n%e+e)%e}function xD(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function AD(n,e,t){return n!==e?(t-n)/(e-n):0}function zu(n,e,t){return(1-t)*n+t*e}function SD(n,e,t,i){return zu(n,e,1-Math.exp(-t*i))}function MD(n,e=1){return e-Math.abs(M_(n,e*2)-e)}function ED(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function wD(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function CD(n,e){return n+Math.floor(Math.random()*(e-n+1))}function TD(n,e){return n+Math.random()*(e-n)}function RD(n){return n*(.5-Math.random())}function bD(n){n!==void 0&&(gM=n);let e=gM+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function BD(n){return n*wa}function PD(n){return n*vc}function J2(n){return(n&n-1)===0&&n!==0}function LD(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function gm(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function ID(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),f=s((e+i)/2),d=o((e+i)/2),h=s((e-i)/2),p=o((e-i)/2),v=s((i-e)/2),y=o((i-e)/2);switch(r){case"XYX":n.set(a*d,l*h,l*p,a*f);break;case"YZY":n.set(l*p,a*d,l*h,a*f);break;case"ZXZ":n.set(l*h,l*p,a*d,a*f);break;case"XZX":n.set(a*d,l*y,l*v,a*f);break;case"YXY":n.set(l*v,a*d,l*y,a*f);break;case"ZYZ":n.set(l*y,l*v,a*d,a*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Ri(n,e){switch(e.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 vt(n,e){switch(e.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 iR={DEG2RAD:wa,RAD2DEG:vc,generateUUID:Xi,clamp:dn,euclideanModulo:M_,mapLinear:xD,inverseLerp:AD,lerp:zu,damp:SD,pingpong:MD,smoothstep:ED,smootherstep:wD,randInt:CD,randFloat:TD,randFloatSpread:RD,seededRandom:bD,degToRad:BD,radToDeg:PD,isPowerOfTwo:J2,ceilPowerOfTwo:LD,floorPowerOfTwo:gm,setQuaternionFromProperEuler:ID,normalize:vt,denormalize:Ri};class pe{constructor(e=0,t=0){pe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(dn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class _t{constructor(e,t,i,r,s,o,a,l,f){_t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,f)}set(e,t,i,r,s,o,a,l,f){const d=this.elements;return d[0]=e,d[1]=r,d[2]=a,d[3]=t,d[4]=s,d[5]=l,d[6]=i,d[7]=o,d[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],f=i[1],d=i[4],h=i[7],p=i[2],v=i[5],y=i[8],S=r[0],x=r[3],m=r[6],A=r[1],M=r[4],w=r[7],T=r[2],b=r[5],B=r[8];return s[0]=o*S+a*A+l*T,s[3]=o*x+a*M+l*b,s[6]=o*m+a*w+l*B,s[1]=f*S+d*A+h*T,s[4]=f*x+d*M+h*b,s[7]=f*m+d*w+h*B,s[2]=p*S+v*A+y*T,s[5]=p*x+v*M+y*b,s[8]=p*m+v*w+y*B,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],f=e[7],d=e[8];return t*o*d-t*a*f-i*s*d+i*a*l+r*s*f-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],f=e[7],d=e[8],h=d*o-a*f,p=a*l-d*s,v=f*s-o*l,y=t*h+i*p+r*v;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/y;return e[0]=h*S,e[1]=(r*f-d*i)*S,e[2]=(a*i-r*o)*S,e[3]=p*S,e[4]=(d*t-r*l)*S,e[5]=(r*s-a*t)*S,e[6]=v*S,e[7]=(i*l-f*t)*S,e[8]=(o*t-i*s)*S,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),f=Math.sin(s);return this.set(i*l,i*f,-i*(l*o+f*a)+o+e,-r*f,r*l,-r*(-f*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(dv.makeScale(e,t)),this}rotate(e){return this.premultiply(dv.makeRotation(-e)),this}translate(e,t){return this.premultiply(dv.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const dv=new _t;function rR(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const DD={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Jl(n,e){return new DD[n](e)}function Sf(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function sR(){const n=Sf("canvas");return n.style.display="block",n}const vM={};function Vu(n){n in vM||(vM[n]=!0,console.warn(n))}const yM=new _t().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),_M=new _t().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),gh={[rs]:{transfer:yf,primaries:_f,toReference:n=>n,fromReference:n=>n},[Rn]:{transfer:zt,primaries:_f,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Gf]:{transfer:yf,primaries:xf,toReference:n=>n.applyMatrix3(_M),fromReference:n=>n.applyMatrix3(yM)},[t0]:{transfer:zt,primaries:xf,toReference:n=>n.convertSRGBToLinear().applyMatrix3(_M),fromReference:n=>n.applyMatrix3(yM).convertLinearToSRGB()}},ND=new Set([rs,Gf]),Ut={enabled:!0,_workingColorSpace:rs,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!ND.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=gh[e].toReference,r=gh[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return gh[n].primaries},getTransfer:function(n){return n===Gi?yf:gh[n].transfer}};function ic(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function hv(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let cl;class E_{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{cl===void 0&&(cl=Sf("canvas")),cl.width=e.width,cl.height=e.height;const i=cl.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=cl}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Sf("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Zm)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Io:e.x=e.x-Math.floor(e.x);break;case jn:e.x=e.x<0?0:1;break;case hc:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Io:e.y=e.y-Math.floor(e.y);break;case jn:e.y=e.y<0?0:1;break;case hc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Vu("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Rn?Ro:A_}set encoding(e){Vu("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Ro?Rn:Gi}}qt.DEFAULT_IMAGE=null;qt.DEFAULT_MAPPING=Zm;qt.DEFAULT_ANISOTROPY=1;class Ot{constructor(e=0,t=0,i=0,r=1){Ot.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,f=l[0],d=l[4],h=l[8],p=l[1],v=l[5],y=l[9],S=l[2],x=l[6],m=l[10];if(Math.abs(d-p)<.01&&Math.abs(h-S)<.01&&Math.abs(y-x)<.01){if(Math.abs(d+p)<.1&&Math.abs(h+S)<.1&&Math.abs(y+x)<.1&&Math.abs(f+v+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(f+1)/2,w=(v+1)/2,T=(m+1)/2,b=(d+p)/4,B=(h+S)/4,I=(y+x)/4;return M>w&&M>T?M<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(M),r=b/i,s=B/i):w>T?w<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(w),i=b/r,s=I/r):T<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(T),i=B/s,r=I/s),this.set(i,r,s,t),this}let A=Math.sqrt((x-y)*(x-y)+(h-S)*(h-S)+(p-d)*(p-d));return Math.abs(A)<.001&&(A=1),this.x=(x-y)/A,this.y=(h-S)/A,this.z=(p-d)/A,this.w=Math.acos((f+v+m-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class oR extends Fs{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ot(0,0,e,t),this.scissorTest=!1,this.viewport=new Ot(0,0,e,t);const r={width:e,height:t,depth:1};i.encoding!==void 0&&(Vu("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===Ro?Rn:Gi),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:nn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new qt(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps,this.texture.internalFormat=i.internalFormat,this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new _a(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Dr extends oR{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class n0 extends qt{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=fn,this.minFilter=fn,this.wrapR=jn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class OD extends Dr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new n0(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class w_ extends qt{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=fn,this.minFilter=fn,this.wrapR=jn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class kD extends Dr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new w_(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class HD extends Dr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o=0?1:-1,M=1-m*m;if(M>Number.EPSILON){const T=Math.sqrt(M),b=Math.atan2(T,m*A);x=Math.sin(x*b)/T,a=Math.sin(a*b)/T}const w=a*A;if(l=l*x+p*w,f=f*x+v*w,d=d*x+y*w,h=h*x+S*w,x===1-a){const T=1/Math.sqrt(l*l+f*f+d*d+h*h);l*=T,f*=T,d*=T,h*=T}}e[t]=l,e[t+1]=f,e[t+2]=d,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],f=i[r+2],d=i[r+3],h=s[o],p=s[o+1],v=s[o+2],y=s[o+3];return e[t]=a*y+d*h+l*v-f*p,e[t+1]=l*y+d*p+f*h-a*v,e[t+2]=f*y+d*v+a*p-l*h,e[t+3]=d*y-a*h-l*p-f*v,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,f=a(i/2),d=a(r/2),h=a(s/2),p=l(i/2),v=l(r/2),y=l(s/2);switch(o){case"XYZ":this._x=p*d*h+f*v*y,this._y=f*v*h-p*d*y,this._z=f*d*y+p*v*h,this._w=f*d*h-p*v*y;break;case"YXZ":this._x=p*d*h+f*v*y,this._y=f*v*h-p*d*y,this._z=f*d*y-p*v*h,this._w=f*d*h+p*v*y;break;case"ZXY":this._x=p*d*h-f*v*y,this._y=f*v*h+p*d*y,this._z=f*d*y+p*v*h,this._w=f*d*h-p*v*y;break;case"ZYX":this._x=p*d*h-f*v*y,this._y=f*v*h+p*d*y,this._z=f*d*y-p*v*h,this._w=f*d*h+p*v*y;break;case"YZX":this._x=p*d*h+f*v*y,this._y=f*v*h+p*d*y,this._z=f*d*y-p*v*h,this._w=f*d*h-p*v*y;break;case"XZY":this._x=p*d*h-f*v*y,this._y=f*v*h-p*d*y,this._z=f*d*y+p*v*h,this._w=f*d*h+p*v*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],f=t[2],d=t[6],h=t[10],p=i+a+h;if(p>0){const v=.5/Math.sqrt(p+1);this._w=.25/v,this._x=(d-l)*v,this._y=(s-f)*v,this._z=(o-r)*v}else if(i>a&&i>h){const v=2*Math.sqrt(1+i-a-h);this._w=(d-l)/v,this._x=.25*v,this._y=(r+o)/v,this._z=(s+f)/v}else if(a>h){const v=2*Math.sqrt(1+a-i-h);this._w=(s-f)/v,this._x=(r+o)/v,this._y=.25*v,this._z=(l+d)/v}else{const v=2*Math.sqrt(1+h-i-a);this._w=(o-r)/v,this._x=(s+f)/v,this._y=(l+d)/v,this._z=.25*v}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(dn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,f=t._z,d=t._w;return this._x=i*d+o*a+r*f-s*l,this._y=r*d+o*l+s*a-i*f,this._z=s*d+o*f+i*l-r*a,this._w=o*d-i*a-r*l-s*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const v=1-t;return this._w=v*o+t*this._w,this._x=v*i+t*this._x,this._y=v*r+t*this._y,this._z=v*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const f=Math.sqrt(l),d=Math.atan2(f,a),h=Math.sin((1-t)*d)/f,p=Math.sin(t*d)/f;return this._w=o*h+this._w*p,this._x=i*h+this._x*p,this._y=r*h+this._y*p,this._z=s*h+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),r=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(r),i*Math.sin(s),i*Math.cos(s),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,i=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(xM.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(xM.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,f=2*(o*r-a*i),d=2*(a*t-s*r),h=2*(s*i-o*t);return this.x=t+l*f+o*h-a*d,this.y=i+l*d+a*f-s*h,this.z=r+l*h+s*d-o*f,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return mv.copy(this).projectOnVector(e),this.sub(mv)}reflect(e){return this.sub(mv.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(dn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const mv=new F,xM=new ai;class li{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,_r),_r.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fu),yh.subVectors(this.max,fu),ul.subVectors(e.a,fu),fl.subVectors(e.b,fu),dl.subVectors(e.c,fu),Ks.subVectors(fl,ul),Ys.subVectors(dl,fl),Zo.subVectors(ul,dl);let t=[0,-Ks.z,Ks.y,0,-Ys.z,Ys.y,0,-Zo.z,Zo.y,Ks.z,0,-Ks.x,Ys.z,0,-Ys.x,Zo.z,0,-Zo.x,-Ks.y,Ks.x,0,-Ys.y,Ys.x,0,-Zo.y,Zo.x,0];return!gv(t,ul,fl,dl,yh)||(t=[1,0,0,0,1,0,0,0,1],!gv(t,ul,fl,dl,yh))?!1:(_h.crossVectors(Ks,Ys),t=[_h.x,_h.y,_h.z],gv(t,ul,fl,dl,yh))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,_r).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(_r).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(hs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),hs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),hs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),hs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),hs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),hs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),hs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),hs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(hs),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const hs=[new F,new F,new F,new F,new F,new F,new F,new F],_r=new F,vh=new li,ul=new F,fl=new F,dl=new F,Ks=new F,Ys=new F,Zo=new F,fu=new F,yh=new F,_h=new F,qo=new F;function gv(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){qo.fromArray(n,s);const a=r.x*Math.abs(qo.x)+r.y*Math.abs(qo.y)+r.z*Math.abs(qo.z),l=e.dot(qo),f=t.dot(qo),d=i.dot(qo);if(Math.max(-Math.max(l,f,d),Math.min(l,f,d))>a)return!1}return!0}const GD=new li,du=new F,vv=new F;class Yn{constructor(e=new F,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):GD.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;du.subVectors(e,this.center);const t=du.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(du,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(vv.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(du.copy(e.center).add(vv)),this.expandByPoint(du.copy(e.center).sub(vv))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ps=new F,yv=new F,xh=new F,Qs=new F,_v=new F,Ah=new F,xv=new F;class Pc{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ps)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ps.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ps.copy(this.origin).addScaledVector(this.direction,t),ps.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){yv.copy(e).add(t).multiplyScalar(.5),xh.copy(t).sub(e).normalize(),Qs.copy(this.origin).sub(yv);const s=e.distanceTo(t)*.5,o=-this.direction.dot(xh),a=Qs.dot(this.direction),l=-Qs.dot(xh),f=Qs.lengthSq(),d=Math.abs(1-o*o);let h,p,v,y;if(d>0)if(h=o*l-a,p=o*a-l,y=s*d,h>=0)if(p>=-y)if(p<=y){const S=1/d;h*=S,p*=S,v=h*(h+o*p+2*a)+p*(o*h+p+2*l)+f}else p=s,h=Math.max(0,-(o*p+a)),v=-h*h+p*(p+2*l)+f;else p=-s,h=Math.max(0,-(o*p+a)),v=-h*h+p*(p+2*l)+f;else p<=-y?(h=Math.max(0,-(-o*s+a)),p=h>0?-s:Math.min(Math.max(-s,-l),s),v=-h*h+p*(p+2*l)+f):p<=y?(h=0,p=Math.min(Math.max(-s,-l),s),v=p*(p+2*l)+f):(h=Math.max(0,-(o*s+a)),p=h>0?s:Math.min(Math.max(-s,-l),s),v=-h*h+p*(p+2*l)+f);else p=o>0?-s:s,h=Math.max(0,-(o*p+a)),v=-h*h+p*(p+2*l)+f;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(yv).addScaledVector(xh,p),v}intersectSphere(e,t){ps.subVectors(e.center,this.origin);const i=ps.dot(this.direction),r=ps.dot(ps)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const f=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,p=this.origin;return f>=0?(i=(e.min.x-p.x)*f,r=(e.max.x-p.x)*f):(i=(e.max.x-p.x)*f,r=(e.min.x-p.x)*f),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-p.z)*h,l=(e.max.z-p.z)*h):(a=(e.max.z-p.z)*h,l=(e.min.z-p.z)*h),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,ps)!==null}intersectTriangle(e,t,i,r,s){_v.subVectors(t,e),Ah.subVectors(i,e),xv.crossVectors(_v,Ah);let o=this.direction.dot(xv),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Qs.subVectors(this.origin,e);const l=a*this.direction.dot(Ah.crossVectors(Qs,Ah));if(l<0)return null;const f=a*this.direction.dot(_v.cross(Qs));if(f<0||l+f>o)return null;const d=-a*Qs.dot(xv);return d<0?null:this.at(d/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class $e{constructor(e,t,i,r,s,o,a,l,f,d,h,p,v,y,S,x){$e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,f,d,h,p,v,y,S,x)}set(e,t,i,r,s,o,a,l,f,d,h,p,v,y,S,x){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=f,m[6]=d,m[10]=h,m[14]=p,m[3]=v,m[7]=y,m[11]=S,m[15]=x,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 $e().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/hl.setFromMatrixColumn(e,0).length(),s=1/hl.setFromMatrixColumn(e,1).length(),o=1/hl.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),f=Math.sin(r),d=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const p=o*d,v=o*h,y=a*d,S=a*h;t[0]=l*d,t[4]=-l*h,t[8]=f,t[1]=v+y*f,t[5]=p-S*f,t[9]=-a*l,t[2]=S-p*f,t[6]=y+v*f,t[10]=o*l}else if(e.order==="YXZ"){const p=l*d,v=l*h,y=f*d,S=f*h;t[0]=p+S*a,t[4]=y*a-v,t[8]=o*f,t[1]=o*h,t[5]=o*d,t[9]=-a,t[2]=v*a-y,t[6]=S+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*d,v=l*h,y=f*d,S=f*h;t[0]=p-S*a,t[4]=-o*h,t[8]=y+v*a,t[1]=v+y*a,t[5]=o*d,t[9]=S-p*a,t[2]=-o*f,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*d,v=o*h,y=a*d,S=a*h;t[0]=l*d,t[4]=y*f-v,t[8]=p*f+S,t[1]=l*h,t[5]=S*f+p,t[9]=v*f-y,t[2]=-f,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,v=o*f,y=a*l,S=a*f;t[0]=l*d,t[4]=S-p*h,t[8]=y*h+v,t[1]=h,t[5]=o*d,t[9]=-a*d,t[2]=-f*d,t[6]=v*h+y,t[10]=p-S*h}else if(e.order==="XZY"){const p=o*l,v=o*f,y=a*l,S=a*f;t[0]=l*d,t[4]=-h,t[8]=f*d,t[1]=p*h+S,t[5]=o*d,t[9]=v*h-y,t[2]=y*h-v,t[6]=a*d,t[10]=S*h+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(zD,e,VD)}lookAt(e,t,i){const r=this.elements;return Oi.subVectors(e,t),Oi.lengthSq()===0&&(Oi.z=1),Oi.normalize(),Zs.crossVectors(i,Oi),Zs.lengthSq()===0&&(Math.abs(i.z)===1?Oi.x+=1e-4:Oi.z+=1e-4,Oi.normalize(),Zs.crossVectors(i,Oi)),Zs.normalize(),Sh.crossVectors(Oi,Zs),r[0]=Zs.x,r[4]=Sh.x,r[8]=Oi.x,r[1]=Zs.y,r[5]=Sh.y,r[9]=Oi.y,r[2]=Zs.z,r[6]=Sh.z,r[10]=Oi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],f=i[12],d=i[1],h=i[5],p=i[9],v=i[13],y=i[2],S=i[6],x=i[10],m=i[14],A=i[3],M=i[7],w=i[11],T=i[15],b=r[0],B=r[4],I=r[8],R=r[12],P=r[1],H=r[5],J=r[9],te=r[13],V=r[2],q=r[6],re=r[10],ae=r[14],D=r[3],k=r[7],G=r[11],Y=r[15];return s[0]=o*b+a*P+l*V+f*D,s[4]=o*B+a*H+l*q+f*k,s[8]=o*I+a*J+l*re+f*G,s[12]=o*R+a*te+l*ae+f*Y,s[1]=d*b+h*P+p*V+v*D,s[5]=d*B+h*H+p*q+v*k,s[9]=d*I+h*J+p*re+v*G,s[13]=d*R+h*te+p*ae+v*Y,s[2]=y*b+S*P+x*V+m*D,s[6]=y*B+S*H+x*q+m*k,s[10]=y*I+S*J+x*re+m*G,s[14]=y*R+S*te+x*ae+m*Y,s[3]=A*b+M*P+w*V+T*D,s[7]=A*B+M*H+w*q+T*k,s[11]=A*I+M*J+w*re+T*G,s[15]=A*R+M*te+w*ae+T*Y,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],f=e[13],d=e[2],h=e[6],p=e[10],v=e[14],y=e[3],S=e[7],x=e[11],m=e[15];return y*(+s*l*h-r*f*h-s*a*p+i*f*p+r*a*v-i*l*v)+S*(+t*l*v-t*f*p+s*o*p-r*o*v+r*f*d-s*l*d)+x*(+t*f*h-t*a*v-s*o*h+i*o*v+s*a*d-i*f*d)+m*(-r*a*d-t*l*h+t*a*p+r*o*h-i*o*p+i*l*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],f=e[7],d=e[8],h=e[9],p=e[10],v=e[11],y=e[12],S=e[13],x=e[14],m=e[15],A=h*x*f-S*p*f+S*l*v-a*x*v-h*l*m+a*p*m,M=y*p*f-d*x*f-y*l*v+o*x*v+d*l*m-o*p*m,w=d*S*f-y*h*f+y*a*v-o*S*v-d*a*m+o*h*m,T=y*h*l-d*S*l-y*a*p+o*S*p+d*a*x-o*h*x,b=t*A+i*M+r*w+s*T;if(b===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/b;return e[0]=A*B,e[1]=(S*p*s-h*x*s-S*r*v+i*x*v+h*r*m-i*p*m)*B,e[2]=(a*x*s-S*l*s+S*r*f-i*x*f-a*r*m+i*l*m)*B,e[3]=(h*l*s-a*p*s-h*r*f+i*p*f+a*r*v-i*l*v)*B,e[4]=M*B,e[5]=(d*x*s-y*p*s+y*r*v-t*x*v-d*r*m+t*p*m)*B,e[6]=(y*l*s-o*x*s-y*r*f+t*x*f+o*r*m-t*l*m)*B,e[7]=(o*p*s-d*l*s+d*r*f-t*p*f-o*r*v+t*l*v)*B,e[8]=w*B,e[9]=(y*h*s-d*S*s-y*i*v+t*S*v+d*i*m-t*h*m)*B,e[10]=(o*S*s-y*a*s+y*i*f-t*S*f-o*i*m+t*a*m)*B,e[11]=(d*a*s-o*h*s-d*i*f+t*h*f+o*i*v-t*a*v)*B,e[12]=T*B,e[13]=(d*S*r-y*h*r+y*i*p-t*S*p-d*i*x+t*h*x)*B,e[14]=(y*a*r-o*S*r-y*i*l+t*S*l+o*i*x-t*a*x)*B,e[15]=(o*h*r-d*a*r+d*i*l-t*h*l-o*i*p+t*a*p)*B,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,f=s*o,d=s*a;return this.set(f*o+i,f*a-r*l,f*l+r*a,0,f*a+r*l,d*a+i,d*l-r*o,0,f*l-r*a,d*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,f=s+s,d=o+o,h=a+a,p=s*f,v=s*d,y=s*h,S=o*d,x=o*h,m=a*h,A=l*f,M=l*d,w=l*h,T=i.x,b=i.y,B=i.z;return r[0]=(1-(S+m))*T,r[1]=(v+w)*T,r[2]=(y-M)*T,r[3]=0,r[4]=(v-w)*b,r[5]=(1-(p+m))*b,r[6]=(x+A)*b,r[7]=0,r[8]=(y+M)*B,r[9]=(x-A)*B,r[10]=(1-(p+S))*B,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=hl.set(r[0],r[1],r[2]).length();const o=hl.set(r[4],r[5],r[6]).length(),a=hl.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],xr.copy(this);const f=1/s,d=1/o,h=1/a;return xr.elements[0]*=f,xr.elements[1]*=f,xr.elements[2]*=f,xr.elements[4]*=d,xr.elements[5]*=d,xr.elements[6]*=d,xr.elements[8]*=h,xr.elements[9]*=h,xr.elements[10]*=h,t.setFromRotationMatrix(xr),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=br){const l=this.elements,f=2*s/(t-e),d=2*s/(i-r),h=(t+e)/(t-e),p=(i+r)/(i-r);let v,y;if(a===br)v=-(o+s)/(o-s),y=-2*o*s/(o-s);else if(a===gc)v=-o/(o-s),y=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=f,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=v,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=br){const l=this.elements,f=1/(t-e),d=1/(i-r),h=1/(o-s),p=(t+e)*f,v=(i+r)*d;let y,S;if(a===br)y=(o+s)*h,S=-2*h;else if(a===gc)y=s*h,S=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*f,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-v,l[2]=0,l[6]=0,l[10]=S,l[14]=-y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const hl=new F,xr=new $e,zD=new F(0,0,0),VD=new F(1,1,1),Zs=new F,Sh=new F,Oi=new F,AM=new $e,SM=new ai;class zf{constructor(e=0,t=0,i=0,r=zf.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],f=r[5],d=r[9],h=r[2],p=r[6],v=r[10];switch(t){case"XYZ":this._y=Math.asin(dn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,v),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,f),this._z=0);break;case"YXZ":this._x=Math.asin(-dn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,v),this._z=Math.atan2(l,f)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(dn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,v),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-dn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,v),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(dn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,f),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,v));break;case"XZY":this._z=Math.asin(-dn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,f),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-d,v),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return AM.makeRotationFromQuaternion(e),this.setFromRotationMatrix(AM,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return SM.setFromEuler(this),this.setFromQuaternion(SM,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}zf.DEFAULT_ORDER="XYZ";class Ca{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let f=0,d=l.length;f0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),f.length>0&&(i.textures=f),d.length>0&&(i.images=d),h.length>0&&(i.shapes=h),p.length>0&&(i.skeletons=p),v.length>0&&(i.animations=v),y.length>0&&(i.nodes=y)}return i.object=r,i;function o(a){const l=[];for(const f in a){const d=a[f];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Ar.subVectors(r,t),gs.subVectors(i,t),Av.subVectors(e,t);const o=Ar.dot(Ar),a=Ar.dot(gs),l=Ar.dot(Av),f=gs.dot(gs),d=gs.dot(Av),h=o*f-a*a;if(h===0)return s.set(-2,-1,-1);const p=1/h,v=(f*l-a*d)*p,y=(o*d-a*l)*p;return s.set(1-v-y,y,v)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,vs),vs.x>=0&&vs.y>=0&&vs.x+vs.y<=1}static getUV(e,t,i,r,s,o,a,l){return Eh===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Eh=!0),this.getInterpolation(e,t,i,r,s,o,a,l)}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,vs),l.setScalar(0),l.addScaledVector(s,vs.x),l.addScaledVector(o,vs.y),l.addScaledVector(a,vs.z),l}static isFrontFacing(e,t,i,r){return Ar.subVectors(i,t),gs.subVectors(e,t),Ar.cross(gs).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ar.subVectors(this.c,this.b),gs.subVectors(this.a,this.b),Ar.cross(gs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ti.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ti.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,s){return Eh===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Eh=!0),Ti.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}getInterpolation(e,t,i,r,s){return Ti.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Ti.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ti.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;ml.subVectors(r,i),gl.subVectors(s,i),Sv.subVectors(e,i);const l=ml.dot(Sv),f=gl.dot(Sv);if(l<=0&&f<=0)return t.copy(i);Mv.subVectors(e,r);const d=ml.dot(Mv),h=gl.dot(Mv);if(d>=0&&h<=d)return t.copy(r);const p=l*h-d*f;if(p<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(i).addScaledVector(ml,o);Ev.subVectors(e,s);const v=ml.dot(Ev),y=gl.dot(Ev);if(y>=0&&v<=y)return t.copy(s);const S=v*f-l*y;if(S<=0&&f>=0&&y<=0)return a=f/(f-y),t.copy(i).addScaledVector(gl,a);const x=d*y-v*h;if(x<=0&&h-d>=0&&v-y>=0)return TM.subVectors(s,r),a=(h-d)/(h-d+(v-y)),t.copy(r).addScaledVector(TM,a);const m=1/(x+S+p);return o=S*m,a=p*m,t.copy(i).addScaledVector(ml,o).addScaledVector(gl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const aR={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},qs={h:0,s:0,l:0},wh={h:0,s:0,l:0};function wv(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Pe{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Rn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ut.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Ut.workingColorSpace){return this.r=e,this.g=t,this.b=i,Ut.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Ut.workingColorSpace){if(e=M_(e,1),t=dn(t,0,1),i=dn(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=wv(o,s,e+1/3),this.g=wv(o,s,e),this.b=wv(o,s,e-1/3)}return Ut.toWorkingColorSpace(this,r),this}setStyle(e,t=Rn){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Rn){const i=aR[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ic(e.r),this.g=ic(e.g),this.b=ic(e.b),this}copyLinearToSRGB(e){return this.r=hv(e.r),this.g=hv(e.g),this.b=hv(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Rn){return Ut.fromWorkingColorSpace(ri.copy(this),e),Math.round(dn(ri.r*255,0,255))*65536+Math.round(dn(ri.g*255,0,255))*256+Math.round(dn(ri.b*255,0,255))}getHexString(e=Rn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ut.workingColorSpace){Ut.fromWorkingColorSpace(ri.copy(this),t);const i=ri.r,r=ri.g,s=ri.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,f;const d=(a+o)/2;if(a===o)l=0,f=0;else{const h=o-a;switch(f=d<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).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(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).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(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).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(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).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!==Ea&&(i.blending=this.blending),this.side!==ns&&(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!==dm&&(i.blendSrc=this.blendSrc),this.blendDst!==hm&&(i.blendDst=this.blendDst),this.blendEquation!==uo&&(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!==hf&&(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!==W2&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ua&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ua&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ua&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Vi extends wn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Pe(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=Hf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const As=QD();function QD(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const f=l-127;f<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):f<-14?(i[l]=1024>>-f-14,i[l|256]=1024>>-f-14|32768,r[l]=-f-1,r[l|256]=-f-1):f<=15?(i[l]=f+15<<10,i[l|256]=f+15<<10|32768,r[l]=13,r[l|256]=13):f<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let f=l<<13,d=0;for(;!(f&8388608);)f<<=1,d-=8388608;f&=-8388609,d+=947912704,s[l]=f|d}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function wi(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=dn(n,-65504,65504),As.floatView[0]=n;const e=As.uint32View[0],t=e>>23&511;return As.baseTable[t]+((e&8388607)>>As.shiftTable[t])}function Bu(n){const e=n>>10;return As.uint32View[0]=As.mantissaTable[As.offsetTable[e]+(n&1023)]+As.exponentTable[e],As.floatView[0]}const ZD={toHalfFloat:wi,fromHalfFloat:Bu},Sn=new F,Ch=new pe;class Bt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Af,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Rr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const f in l)l[f]!==void 0&&(e[f]=l[f]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const f=i[l];e.data.attributes[l]=f.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const f=this.morphAttributes[l],d=[];for(let h=0,p=f.length;h0&&(r[l]=d,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const f in r){const d=r[f];this.setAttribute(f,d.clone(t))}const s=e.morphAttributes;for(const f in s){const d=[],h=s[f];for(let p=0,v=h.length;p0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(RM.copy(s).invert(),$o.copy(e.ray).applyMatrix4(RM),!(i.boundingBox!==null&&$o.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,$o)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,f=s.attributes.uv,d=s.attributes.uv1,h=s.attributes.normal,p=s.groups,v=s.drawRange;if(a!==null)if(Array.isArray(o))for(let y=0,S=p.length;yt.far?null:{distance:f,point:Ih.clone(),object:n}}function Dh(n,e,t,i,r,s,o,a,l,f){n.getVertexPosition(a,yl),n.getVertexPosition(l,_l),n.getVertexPosition(f,xl);const d=o5(n,e,t,i,yl,_l,xl,Lh);if(d){r&&(bh.fromBufferAttribute(r,a),Bh.fromBufferAttribute(r,l),Ph.fromBufferAttribute(r,f),d.uv=Ti.getInterpolation(Lh,yl,_l,xl,bh,Bh,Ph,new pe)),s&&(bh.fromBufferAttribute(s,a),Bh.fromBufferAttribute(s,l),Ph.fromBufferAttribute(s,f),d.uv1=Ti.getInterpolation(Lh,yl,_l,xl,bh,Bh,Ph,new pe),d.uv2=d.uv1),o&&(BM.fromBufferAttribute(o,a),PM.fromBufferAttribute(o,l),LM.fromBufferAttribute(o,f),d.normal=Ti.getInterpolation(Lh,yl,_l,xl,BM,PM,LM,new F),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const h={a,b:l,c:f,normal:new F,materialIndex:0};Ti.getNormal(yl,_l,xl,h.normal),d.face=h}return d}class za extends mt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],f=[],d=[],h=[];let p=0,v=0;y("z","y","x",-1,-1,i,t,e,o,s,0),y("z","y","x",1,-1,i,t,-e,o,s,1),y("x","z","y",1,1,e,i,t,r,o,2),y("x","z","y",1,-1,e,i,-t,r,o,3),y("x","y","z",1,-1,e,t,i,r,s,4),y("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new We(f,3)),this.setAttribute("normal",new We(d,3)),this.setAttribute("uv",new We(h,2));function y(S,x,m,A,M,w,T,b,B,I,R){const P=w/B,H=T/I,J=w/2,te=T/2,V=b/2,q=B+1,re=I+1;let ae=0,D=0;const k=new F;for(let G=0;G0?1:-1,d.push(k.x,k.y,k.z),h.push($/B),h.push(1-G/I),ae+=1}}for(let G=0;G0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Vf extends wt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new $e,this.projectionMatrix=new $e,this.projectionMatrixInverse=new $e,this.coordinateSystem=br}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class bn extends Vf{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=vc*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(wa*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return vc*2*Math.atan(Math.tan(wa*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(wa*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,f=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/f,r*=o.width/l,i*=o.height/f}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Al=-90,Sl=1;class uR extends wt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new bn(Al,Sl,e,t);r.layers=this.layers,this.add(r);const s=new bn(Al,Sl,e,t);s.layers=this.layers,this.add(s);const o=new bn(Al,Sl,e,t);o.layers=this.layers,this.add(o);const a=new bn(Al,Sl,e,t);a.layers=this.layers,this.add(a);const l=new bn(Al,Sl,e,t);l.layers=this.layers,this.add(l);const f=new bn(Al,Sl,e,t);f.layers=this.layers,this.add(f)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const f of t)this.remove(f);if(e===br)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===gc)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.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: "+e);for(const f of t)this.add(f),f.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,f,d]=this.children,h=e.getRenderTarget(),p=e.getActiveCubeFace(),v=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const S=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,f),i.texture.generateMipmaps=S,e.setRenderTarget(i,5,r),e.render(t,d),e.setRenderTarget(h,p,v),e.xr.enabled=y,i.texture.needsPMREMUpdate=!0}}class Wf extends qt{constructor(e,t,i,r,s,o,a,l,f,d){e=e!==void 0?e:[],t=t!==void 0?t:Is,super(e,t,i,r,s,o,a,l,f,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class fR extends Dr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];t.encoding!==void 0&&(Vu("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Ro?Rn:Gi),this.texture=new Wf(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:nn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},r=new za(5,5,5),s=new ss({name:"CubemapFromEquirect",uniforms:yc(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:_i,blending:Ts});s.uniforms.tEquirect.value=t;const o=new En(r,s),a=t.minFilter;return t.minFilter===is&&(t.minFilter=nn),new uR(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}const Rv=new F,u5=new F,f5=new _t;let oo=class{constructor(e=new F(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=Rv.subVectors(i,t).cross(u5.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(Rv),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||f5.getNormalMatrix(e),r=this.coplanarPoint(Rv).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const ea=new Yn,Nh=new F;class Xf{constructor(e=new oo,t=new oo,i=new oo,r=new oo,s=new oo,o=new oo){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=br){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],f=r[4],d=r[5],h=r[6],p=r[7],v=r[8],y=r[9],S=r[10],x=r[11],m=r[12],A=r[13],M=r[14],w=r[15];if(i[0].setComponents(l-s,p-f,x-v,w-m).normalize(),i[1].setComponents(l+s,p+f,x+v,w+m).normalize(),i[2].setComponents(l+o,p+d,x+y,w+A).normalize(),i[3].setComponents(l-o,p-d,x-y,w-A).normalize(),i[4].setComponents(l-a,p-h,x-S,w-M).normalize(),t===br)i[5].setComponents(l+a,p+h,x+S,w+M).normalize();else if(t===gc)i[5].setComponents(a,h,S,M).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ea.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ea.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ea)}intersectsSprite(e){return ea.center.set(0,0,0),ea.radius=.7071067811865476,ea.applyMatrix4(e.matrixWorld),this.intersectsSphere(ea)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,Nh.y=r.normal.y>0?e.max.y:e.min.y,Nh.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Nh)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function dR(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function d5(n,e){const t=e.isWebGL2,i=new WeakMap;function r(f,d){const h=f.array,p=f.usage,v=h.byteLength,y=n.createBuffer();n.bindBuffer(d,y),n.bufferData(d,h,p),f.onUploadCallback();let S;if(h instanceof Float32Array)S=n.FLOAT;else if(h instanceof Uint16Array)if(f.isFloat16BufferAttribute)if(t)S=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else S=n.UNSIGNED_SHORT;else if(h instanceof Int16Array)S=n.SHORT;else if(h instanceof Uint32Array)S=n.UNSIGNED_INT;else if(h instanceof Int32Array)S=n.INT;else if(h instanceof Int8Array)S=n.BYTE;else if(h instanceof Uint8Array)S=n.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)S=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:y,type:S,bytesPerElement:h.BYTES_PER_ELEMENT,version:f.version,size:v}}function s(f,d,h){const p=d.array,v=d._updateRange,y=d.updateRanges;if(n.bindBuffer(h,f),v.count===-1&&y.length===0&&n.bufferSubData(h,0,p),y.length!==0){for(let S=0,x=y.length;S 0 + vec4 plane; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif +#endif`,b5=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,B5=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,P5=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,L5=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,I5=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,D5=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,N5=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif`,F5=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); + return dot( weights, rgb ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 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 ); +} +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`,U5=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_v0 0.339 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_v1 0.276 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_v4 0.046 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_v5 0.016 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_v6 0.0038 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,O5=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,k5=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,H5=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,G5=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,z5=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,V5="gl_FragColor = linearToOutputTexel( gl_FragColor );",W5=` +const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( + vec3( 0.8224621, 0.177538, 0.0 ), + vec3( 0.0331941, 0.9668058, 0.0 ), + vec3( 0.0170827, 0.0723974, 0.9105199 ) +); +const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( + vec3( 1.2249401, - 0.2249404, 0.0 ), + vec3( - 0.0420569, 1.0420571, 0.0 ), + vec3( - 0.0196376, - 0.0786361, 1.0982735 ) +); +vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { + return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); +} +vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { + return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); +} +vec4 LinearTransferOETF( in vec4 value ) { + return 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 ); +} +vec4 LinearToLinear( in vec4 value ) { + return value; +} +vec4 LinearTosRGB( in vec4 value ) { + return sRGBTransferOETF( value ); +}`,X5=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,J5=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,j5=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,K5=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,Y5=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,Q5=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Z5=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,q5=`#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`,$5=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,eN=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + 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 +}`,tN=`#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + reflectedLight.indirectDiffuse += lightMapIrradiance; +#endif`,nN=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,iN=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,rN=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,sN=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + #if defined ( LEGACY_LIGHTS ) + if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { + return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); + } + return 1.0; + #else + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; + #endif +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,oN=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,aN=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,lN=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,cN=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,uN=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,fN=`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 ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + 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`,dN=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#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 ); +}`,hN=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,pN=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,mN=`#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`,gN=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,vN=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,yN=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + varying float vFragDepth; + varying float vIsPerspective; + #else + uniform float logDepthBufFC; + #endif +#endif`,_N=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); + #else + if ( isPerspectiveMatrix( projectionMatrix ) ) { + gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; + gl_Position.z *= gl_Position.w; + } + #endif +#endif`,xN=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,AN=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,SN=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,MN=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,EN=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,wN=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,CN=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,TN=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } + #else + objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; + objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; + objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; + objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; + #endif +#endif`,RN=`#ifdef USE_MORPHTARGETS + uniform float morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } + #else + #ifndef USE_MORPHNORMALS + uniform float morphTargetInfluences[ 8 ]; + #else + uniform float morphTargetInfluences[ 4 ]; + #endif + #endif +#endif`,bN=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } + #else + transformed += morphTarget0 * morphTargetInfluences[ 0 ]; + transformed += morphTarget1 * morphTargetInfluences[ 1 ]; + transformed += morphTarget2 * morphTargetInfluences[ 2 ]; + transformed += morphTarget3 * morphTargetInfluences[ 3 ]; + #ifndef USE_MORPHNORMALS + transformed += morphTarget4 * morphTargetInfluences[ 4 ]; + transformed += morphTarget5 * morphTargetInfluences[ 5 ]; + transformed += morphTarget6 * morphTargetInfluences[ 6 ]; + transformed += morphTarget7 * morphTargetInfluences[ 7 ]; + #endif + #endif +#endif`,BN=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,PN=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,LN=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,IN=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,DN=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,NN=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,FN=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,UN=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,ON=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,kN=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,HN=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,GN=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; +const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); +const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); +const float ShiftRight8 = 1. / 256.; +vec4 packDepthToRGBA( const in float v ) { + vec4 r = vec4( fract( v * PackFactors ), v ); + r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors ); +} +vec2 packDepthToRG( in highp float v ) { + return packDepthToRGBA( v ).yx; +} +float unpackRGToDepth( const in highp vec2 v ) { + return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); +} +vec4 pack2HalfToRGBA( vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,zN=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,VN=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,WN=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,XN=`#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`,JN=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,jN=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,KN=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return shadow; + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + vec3 lightToPosition = shadowCoord.xyz; + float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + return ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } +#endif`,YN=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,QN=`#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 +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,ZN=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,qN=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,$N=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,eF=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,tF=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,nF=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,iF=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,rF=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,sF=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 OptimizedCineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,oF=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,aF=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,lF=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,cF=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uF=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,fF=`#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; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const dF=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,hF=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,pF=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,mF=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,gF=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,vF=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,yF=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,_F=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + vec4 diffuseColor = vec4( 1.0 ); + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #endif +}`,xF=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,AF=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + #include + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,SF=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,MF=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,EF=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,wF=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,CF=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,TF=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,RF=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,bF=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,BF=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,PF=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,LF=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,IF=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,DF=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,NF=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,FF=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,UF=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,OF=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,kF=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,HF=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,GF=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,zF=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,VF=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,WF=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,XF=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,gt={alphahash_fragment:h5,alphahash_pars_fragment:p5,alphamap_fragment:m5,alphamap_pars_fragment:g5,alphatest_fragment:v5,alphatest_pars_fragment:y5,aomap_fragment:_5,aomap_pars_fragment:x5,batching_pars_vertex:A5,batching_vertex:S5,begin_vertex:M5,beginnormal_vertex:E5,bsdfs:w5,iridescence_fragment:C5,bumpmap_pars_fragment:T5,clipping_planes_fragment:R5,clipping_planes_pars_fragment:b5,clipping_planes_pars_vertex:B5,clipping_planes_vertex:P5,color_fragment:L5,color_pars_fragment:I5,color_pars_vertex:D5,color_vertex:N5,common:F5,cube_uv_reflection_fragment:U5,defaultnormal_vertex:O5,displacementmap_pars_vertex:k5,displacementmap_vertex:H5,emissivemap_fragment:G5,emissivemap_pars_fragment:z5,colorspace_fragment:V5,colorspace_pars_fragment:W5,envmap_fragment:X5,envmap_common_pars_fragment:J5,envmap_pars_fragment:j5,envmap_pars_vertex:K5,envmap_physical_pars_fragment:oN,envmap_vertex:Y5,fog_vertex:Q5,fog_pars_vertex:Z5,fog_fragment:q5,fog_pars_fragment:$5,gradientmap_pars_fragment:eN,lightmap_fragment:tN,lightmap_pars_fragment:nN,lights_lambert_fragment:iN,lights_lambert_pars_fragment:rN,lights_pars_begin:sN,lights_toon_fragment:aN,lights_toon_pars_fragment:lN,lights_phong_fragment:cN,lights_phong_pars_fragment:uN,lights_physical_fragment:fN,lights_physical_pars_fragment:dN,lights_fragment_begin:hN,lights_fragment_maps:pN,lights_fragment_end:mN,logdepthbuf_fragment:gN,logdepthbuf_pars_fragment:vN,logdepthbuf_pars_vertex:yN,logdepthbuf_vertex:_N,map_fragment:xN,map_pars_fragment:AN,map_particle_fragment:SN,map_particle_pars_fragment:MN,metalnessmap_fragment:EN,metalnessmap_pars_fragment:wN,morphcolor_vertex:CN,morphnormal_vertex:TN,morphtarget_pars_vertex:RN,morphtarget_vertex:bN,normal_fragment_begin:BN,normal_fragment_maps:PN,normal_pars_fragment:LN,normal_pars_vertex:IN,normal_vertex:DN,normalmap_pars_fragment:NN,clearcoat_normal_fragment_begin:FN,clearcoat_normal_fragment_maps:UN,clearcoat_pars_fragment:ON,iridescence_pars_fragment:kN,opaque_fragment:HN,packing:GN,premultiplied_alpha_fragment:zN,project_vertex:VN,dithering_fragment:WN,dithering_pars_fragment:XN,roughnessmap_fragment:JN,roughnessmap_pars_fragment:jN,shadowmap_pars_fragment:KN,shadowmap_pars_vertex:YN,shadowmap_vertex:QN,shadowmask_pars_fragment:ZN,skinbase_vertex:qN,skinning_pars_vertex:$N,skinning_vertex:eF,skinnormal_vertex:tF,specularmap_fragment:nF,specularmap_pars_fragment:iF,tonemapping_fragment:rF,tonemapping_pars_fragment:sF,transmission_fragment:oF,transmission_pars_fragment:aF,uv_pars_fragment:lF,uv_pars_vertex:cF,uv_vertex:uF,worldpos_vertex:fF,background_vert:dF,background_frag:hF,backgroundCube_vert:pF,backgroundCube_frag:mF,cube_vert:gF,cube_frag:vF,depth_vert:yF,depth_frag:_F,distanceRGBA_vert:xF,distanceRGBA_frag:AF,equirect_vert:SF,equirect_frag:MF,linedashed_vert:EF,linedashed_frag:wF,meshbasic_vert:CF,meshbasic_frag:TF,meshlambert_vert:RF,meshlambert_frag:bF,meshmatcap_vert:BF,meshmatcap_frag:PF,meshnormal_vert:LF,meshnormal_frag:IF,meshphong_vert:DF,meshphong_frag:NF,meshphysical_vert:FF,meshphysical_frag:UF,meshtoon_vert:OF,meshtoon_frag:kF,points_vert:HF,points_frag:GF,shadow_vert:zF,shadow_frag:VF,sprite_vert:WF,sprite_frag:XF},Be={common:{diffuse:{value:new Pe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new _t}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new _t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new _t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new _t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new _t},normalScale:{value:new pe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new _t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new _t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new _t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new _t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{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 Pe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0},uvTransform:{value:new _t}},sprite:{diffuse:{value:new Pe(16777215)},opacity:{value:1},center:{value:new pe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},Cr={basic:{uniforms:mi([Be.common,Be.specularmap,Be.envmap,Be.aomap,Be.lightmap,Be.fog]),vertexShader:gt.meshbasic_vert,fragmentShader:gt.meshbasic_frag},lambert:{uniforms:mi([Be.common,Be.specularmap,Be.envmap,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.fog,Be.lights,{emissive:{value:new Pe(0)}}]),vertexShader:gt.meshlambert_vert,fragmentShader:gt.meshlambert_frag},phong:{uniforms:mi([Be.common,Be.specularmap,Be.envmap,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.fog,Be.lights,{emissive:{value:new Pe(0)},specular:{value:new Pe(1118481)},shininess:{value:30}}]),vertexShader:gt.meshphong_vert,fragmentShader:gt.meshphong_frag},standard:{uniforms:mi([Be.common,Be.envmap,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.roughnessmap,Be.metalnessmap,Be.fog,Be.lights,{emissive:{value:new Pe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:gt.meshphysical_vert,fragmentShader:gt.meshphysical_frag},toon:{uniforms:mi([Be.common,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.gradientmap,Be.fog,Be.lights,{emissive:{value:new Pe(0)}}]),vertexShader:gt.meshtoon_vert,fragmentShader:gt.meshtoon_frag},matcap:{uniforms:mi([Be.common,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.fog,{matcap:{value:null}}]),vertexShader:gt.meshmatcap_vert,fragmentShader:gt.meshmatcap_frag},points:{uniforms:mi([Be.points,Be.fog]),vertexShader:gt.points_vert,fragmentShader:gt.points_frag},dashed:{uniforms:mi([Be.common,Be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:gt.linedashed_vert,fragmentShader:gt.linedashed_frag},depth:{uniforms:mi([Be.common,Be.displacementmap]),vertexShader:gt.depth_vert,fragmentShader:gt.depth_frag},normal:{uniforms:mi([Be.common,Be.bumpmap,Be.normalmap,Be.displacementmap,{opacity:{value:1}}]),vertexShader:gt.meshnormal_vert,fragmentShader:gt.meshnormal_frag},sprite:{uniforms:mi([Be.sprite,Be.fog]),vertexShader:gt.sprite_vert,fragmentShader:gt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:gt.background_vert,fragmentShader:gt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:gt.backgroundCube_vert,fragmentShader:gt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:gt.cube_vert,fragmentShader:gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:gt.equirect_vert,fragmentShader:gt.equirect_frag},distanceRGBA:{uniforms:mi([Be.common,Be.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:gt.distanceRGBA_vert,fragmentShader:gt.distanceRGBA_frag},shadow:{uniforms:mi([Be.lights,Be.fog,{color:{value:new Pe(0)},opacity:{value:1}}]),vertexShader:gt.shadow_vert,fragmentShader:gt.shadow_frag}};Cr.physical={uniforms:mi([Cr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new pe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new _t},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new _t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new _t},sheen:{value:0},sheenColor:{value:new Pe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new _t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new _t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new _t},transmissionSamplerSize:{value:new pe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new Pe(0)},specularColor:{value:new Pe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new pe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:gt.meshphysical_vert,fragmentShader:gt.meshphysical_frag};const Fh={r:0,b:0,g:0};function JF(n,e,t,i,r,s,o){const a=new Pe(0);let l=s===!0?0:1,f,d,h=null,p=0,v=null;function y(x,m){let A=!1,M=m.isScene===!0?m.background:null;M&&M.isTexture&&(M=(m.backgroundBlurriness>0?t:e).get(M)),M===null?S(a,l):M&&M.isColor&&(S(M,1),A=!0);const w=n.xr.getEnvironmentBlendMode();w==="additive"?i.buffers.color.setClear(0,0,0,1,o):w==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||A)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),M&&(M.isCubeTexture||M.mapping===Bc)?(d===void 0&&(d=new En(new za(1,1,1),new ss({name:"BackgroundCubeMaterial",uniforms:yc(Cr.backgroundCube.uniforms),vertexShader:Cr.backgroundCube.vertexShader,fragmentShader:Cr.backgroundCube.fragmentShader,side:_i,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(T,b,B){this.matrixWorld.copyPosition(B.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(d)),d.material.uniforms.envMap.value=M,d.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=m.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,d.material.toneMapped=Ut.getTransfer(M.colorSpace)!==zt,(h!==M||p!==M.version||v!==n.toneMapping)&&(d.material.needsUpdate=!0,h=M,p=M.version,v=n.toneMapping),d.layers.enableAll(),x.unshift(d,d.geometry,d.material,0,0,null)):M&&M.isTexture&&(f===void 0&&(f=new En(new Jf(2,2),new ss({name:"BackgroundMaterial",uniforms:yc(Cr.background.uniforms),vertexShader:Cr.background.vertexShader,fragmentShader:Cr.background.fragmentShader,side:ns,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),Object.defineProperty(f.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(f)),f.material.uniforms.t2D.value=M,f.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,f.material.toneMapped=Ut.getTransfer(M.colorSpace)!==zt,M.matrixAutoUpdate===!0&&M.updateMatrix(),f.material.uniforms.uvTransform.value.copy(M.matrix),(h!==M||p!==M.version||v!==n.toneMapping)&&(f.material.needsUpdate=!0,h=M,p=M.version,v=n.toneMapping),f.layers.enableAll(),x.unshift(f,f.geometry,f.material,0,0,null))}function S(x,m){x.getRGB(Fh,lR(n)),i.buffers.color.setClear(Fh.r,Fh.g,Fh.b,m,o)}return{getClearColor:function(){return a},setClearColor:function(x,m=1){a.set(x),l=m,S(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,S(a,l)},render:y}}function jF(n,e,t,i){const r=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,a={},l=x(null);let f=l,d=!1;function h(V,q,re,ae,D){let k=!1;if(o){const G=S(ae,re,q);f!==G&&(f=G,v(f.object)),k=m(V,ae,re,D),k&&A(V,ae,re,D)}else{const G=q.wireframe===!0;(f.geometry!==ae.id||f.program!==re.id||f.wireframe!==G)&&(f.geometry=ae.id,f.program=re.id,f.wireframe=G,k=!0)}D!==null&&t.update(D,n.ELEMENT_ARRAY_BUFFER),(k||d)&&(d=!1,I(V,q,re,ae),D!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(D).buffer))}function p(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function v(V){return i.isWebGL2?n.bindVertexArray(V):s.bindVertexArrayOES(V)}function y(V){return i.isWebGL2?n.deleteVertexArray(V):s.deleteVertexArrayOES(V)}function S(V,q,re){const ae=re.wireframe===!0;let D=a[V.id];D===void 0&&(D={},a[V.id]=D);let k=D[q.id];k===void 0&&(k={},D[q.id]=k);let G=k[ae];return G===void 0&&(G=x(p()),k[ae]=G),G}function x(V){const q=[],re=[],ae=[];for(let D=0;D=0){const ue=D[$];let ge=k[$];if(ge===void 0&&($==="instanceMatrix"&&V.instanceMatrix&&(ge=V.instanceMatrix),$==="instanceColor"&&V.instanceColor&&(ge=V.instanceColor)),ue===void 0||ue.attribute!==ge||ge&&ue.data!==ge.data)return!0;G++}return f.attributesNum!==G||f.index!==ae}function A(V,q,re,ae){const D={},k=q.attributes;let G=0;const Y=re.getAttributes();for(const $ in Y)if(Y[$].location>=0){let ue=k[$];ue===void 0&&($==="instanceMatrix"&&V.instanceMatrix&&(ue=V.instanceMatrix),$==="instanceColor"&&V.instanceColor&&(ue=V.instanceColor));const ge={};ge.attribute=ue,ue&&ue.data&&(ge.data=ue.data),D[$]=ge,G++}f.attributes=D,f.attributesNum=G,f.index=ae}function M(){const V=f.newAttributes;for(let q=0,re=V.length;q=0){let Z=D[Y];if(Z===void 0&&(Y==="instanceMatrix"&&V.instanceMatrix&&(Z=V.instanceMatrix),Y==="instanceColor"&&V.instanceColor&&(Z=V.instanceColor)),Z!==void 0){const ue=Z.normalized,ge=Z.itemSize,we=t.get(Z);if(we===void 0)continue;const Re=we.buffer,at=we.type,st=we.bytesPerElement,Xe=i.isWebGL2===!0&&(at===n.INT||at===n.UNSIGNED_INT||Z.gpuType===d_);if(Z.isInterleavedBufferAttribute){const Ve=Z.data,z=Ve.stride,ye=Z.offset;if(Ve.isInstancedInterleavedBuffer){for(let he=0;he<$.locationSize;he++)T($.location+he,Ve.meshPerAttribute);V.isInstancedMesh!==!0&&ae._maxInstanceCount===void 0&&(ae._maxInstanceCount=Ve.meshPerAttribute*Ve.count)}else for(let he=0;he<$.locationSize;he++)w($.location+he);n.bindBuffer(n.ARRAY_BUFFER,Re);for(let he=0;he<$.locationSize;he++)B($.location+he,ge/$.locationSize,at,ue,z*st,(ye+ge/$.locationSize*he)*st,Xe)}else{if(Z.isInstancedBufferAttribute){for(let Ve=0;Ve<$.locationSize;Ve++)T($.location+Ve,Z.meshPerAttribute);V.isInstancedMesh!==!0&&ae._maxInstanceCount===void 0&&(ae._maxInstanceCount=Z.meshPerAttribute*Z.count)}else for(let Ve=0;Ve<$.locationSize;Ve++)w($.location+Ve);n.bindBuffer(n.ARRAY_BUFFER,Re);for(let Ve=0;Ve<$.locationSize;Ve++)B($.location+Ve,ge/$.locationSize,at,ue,ge*st,ge/$.locationSize*Ve*st,Xe)}}else if(G!==void 0){const ue=G[Y];if(ue!==void 0)switch(ue.length){case 2:n.vertexAttrib2fv($.location,ue);break;case 3:n.vertexAttrib3fv($.location,ue);break;case 4:n.vertexAttrib4fv($.location,ue);break;default:n.vertexAttrib1fv($.location,ue)}}}}b()}function R(){J();for(const V in a){const q=a[V];for(const re in q){const ae=q[re];for(const D in ae)y(ae[D].object),delete ae[D];delete q[re]}delete a[V]}}function P(V){if(a[V.id]===void 0)return;const q=a[V.id];for(const re in q){const ae=q[re];for(const D in ae)y(ae[D].object),delete ae[D];delete q[re]}delete a[V.id]}function H(V){for(const q in a){const re=a[q];if(re[V.id]===void 0)continue;const ae=re[V.id];for(const D in ae)y(ae[D].object),delete ae[D];delete re[V.id]}}function J(){te(),d=!0,f!==l&&(f=l,v(f.object))}function te(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:h,reset:J,resetDefaultState:te,dispose:R,releaseStatesOfGeometry:P,releaseStatesOfProgram:H,initAttributes:M,enableAttribute:w,disableUnusedAttributes:b}}function KF(n,e,t,i){const r=i.isWebGL2;let s;function o(d){s=d}function a(d,h){n.drawArrays(s,d,h),t.update(h,s,1)}function l(d,h,p){if(p===0)return;let v,y;if(r)v=n,y="drawArraysInstanced";else if(v=e.get("ANGLE_instanced_arrays"),y="drawArraysInstancedANGLE",v===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}v[y](s,d,h,p),t.update(h,s,p)}function f(d,h,p){if(p===0)return;const v=e.get("WEBGL_multi_draw");if(v===null)for(let y=0;y0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";B="mediump"}return B==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const f=o||e.has("WEBGL_draw_buffers"),d=t.logarithmicDepthBuffer===!0,h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),S=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),m=n.getParameter(n.MAX_VARYING_VECTORS),A=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),M=p>0,w=o||e.has("OES_texture_float"),T=M&&w,b=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:f,getMaxAnisotropy:r,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:d,maxTextures:h,maxVertexTextures:p,maxTextureSize:v,maxCubemapSize:y,maxAttributes:S,maxVertexUniforms:x,maxVaryings:m,maxFragmentUniforms:A,vertexTextures:M,floatFragmentTextures:w,floatVertexTextures:T,maxSamples:b}}function QF(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new oo,a=new _t,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p){const v=h.length!==0||p||i!==0||r;return r=p,i=h.length,v},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,p){t=d(h,p,0)},this.setState=function(h,p,v){const y=h.clippingPlanes,S=h.clipIntersection,x=h.clipShadows,m=n.get(h);if(!r||y===null||y.length===0||s&&!x)s?d(null):f();else{const A=s?0:i,M=A*4;let w=m.clippingState||null;l.value=w,w=d(y,p,M,v);for(let T=0;T!==M;++T)w[T]=t[T];m.clippingState=w,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=A}};function f(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function d(h,p,v,y){const S=h!==null?h.length:0;let x=null;if(S!==0){if(x=l.value,y!==!0||x===null){const m=v+S*4,A=p.matrixWorldInverse;a.getNormalMatrix(A),(x===null||x.length0){const f=new fR(l.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class Lc extends Vf{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){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=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=f*this.view.offsetX,o=s+f*this.view.width,a-=d*this.view.offsetY,l=a-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const jl=4,IM=[.125,.215,.35,.446,.526,.582],ha=20,bv=new Lc,DM=new Pe;let Bv=null,Pv=0,Lv=0;const fa=(1+Math.sqrt(5))/2,Ml=1/fa,NM=[new F(1,1,1),new F(-1,1,1),new F(1,1,-1),new F(-1,1,-1),new F(0,fa,Ml),new F(0,fa,-Ml),new F(Ml,0,fa),new F(-Ml,0,fa),new F(fa,Ml,0),new F(-fa,Ml,0)];class j2{constructor(e){this._renderer=e,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(e,t=0,i=.1,r=100){Bv=this._renderer.getRenderTarget(),Pv=this._renderer.getActiveCubeFace(),Lv=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=OM(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=UM(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?M:0,M,M),d.setRenderTarget(r),S&&d.render(y,a),d.render(e,a)}y.geometry.dispose(),y.material.dispose(),d.toneMapping=p,d.autoClear=h,e.background=x}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Is||e.mapping===Lo;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=OM()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=UM());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new En(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Uh(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,bv)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;rha&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${ha}`);const m=[];let A=0;for(let B=0;BM-jl?r-M+jl:0),b=4*(this._cubeSize-w);Uh(t,T,b,3*w,2*w),l.setRenderTarget(t),l.render(h,bv)}}function qF(n){const e=[],t=[],i=[];let r=n;const s=n-jl+1+IM.length;for(let o=0;on-jl?l=IM[o-n+jl-1]:o===0&&(l=0),i.push(l);const f=1/(a-2),d=-f,h=1+f,p=[d,d,h,d,h,h,d,d,h,h,d,h],v=6,y=6,S=3,x=2,m=1,A=new Float32Array(S*y*v),M=new Float32Array(x*y*v),w=new Float32Array(m*y*v);for(let b=0;b2?0:-1,R=[B,I,0,B+2/3,I,0,B+2/3,I+1,0,B,I,0,B+2/3,I+1,0,B,I+1,0];A.set(R,S*y*b),M.set(p,x*y*b);const P=[b,b,b,b,b,b];w.set(P,m*y*b)}const T=new mt;T.setAttribute("position",new Bt(A,S)),T.setAttribute("uv",new Bt(M,x)),T.setAttribute("faceIndex",new Bt(w,m)),e.push(T),r>jl&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function FM(n,e,t){const i=new Dr(n,e,t);return i.texture.mapping=Bc,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Uh(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function $F(n,e,t){const i=new Float32Array(ha),r=new F(0,1,0);return new ss({name:"SphericalGaussianBlur",defines:{n:ha,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:R_(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Ts,depthTest:!1,depthWrite:!1})}function UM(){return new ss({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:R_(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Ts,depthTest:!1,depthWrite:!1})}function OM(){return new ss({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:R_(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Ts,depthTest:!1,depthWrite:!1})}function R_(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function eU(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,f=l===pf||l===mf,d=l===Is||l===Lo;if(f||d)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let h=e.get(a);return t===null&&(t=new j2(n)),h=f?t.fromEquirectangular(a,h):t.fromCubemap(a,h),e.set(a,h),h.texture}else{if(e.has(a))return e.get(a).texture;{const h=a.image;if(f&&h&&h.height>0||d&&h&&r(h)){t===null&&(t=new j2(n));const p=f?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function r(a){let l=0;const f=6;for(let d=0;de.maxTextureSize&&(H=Math.ceil(P/e.maxTextureSize),P=e.maxTextureSize);const J=new Float32Array(P*H*4*S),te=new n0(J,P,H,S);te.type=Rr,te.needsUpdate=!0;const V=R*4;for(let re=0;re0)return n;const r=e*t;let s=kM[r];if(s===void 0&&(s=new Float32Array(r),kM[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Pn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` +`)}function n8(n){const e=Ut.getPrimaries(Ut.workingColorSpace),t=Ut.getPrimaries(n);let i;switch(e===t?i="":e===xf&&t===_f?i="LinearDisplayP3ToLinearSRGB":e===_f&&t===xf&&(i="LinearSRGBToLinearDisplayP3"),n){case rs:case Gf:return[i,"LinearTransferOETF"];case Rn:case t0:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function JM(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` + +`+r+` + +`+t8(n.getShaderSource(e),o)}else return r}function i8(n,e){const t=n8(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function r8(n,e){let t;switch(e){case BT:t="Linear";break;case PT:t="Reinhard";break;case LT:t="OptimizedCineon";break;case f_:t="ACESFilmic";break;case IT:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function s8(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Pu).join(` +`)}function o8(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` +`)}function a8(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function K2(n){return n.replace(l8,u8)}const c8=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function u8(n,e){let t=gt[e];if(t===void 0){const i=c8.get(e);if(i!==void 0)t=gt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return K2(t)}const f8=/#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 YM(n){return n.replace(f8,d8)}function d8(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(x+=` +`),m=[v,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(Pu).join(` +`),m.length>0&&(m+=` +`)):(x=[QM(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Pu).join(` +`),m=[v,QM(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.envMap?"#define "+d:"",t.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==qr?"#define TONE_MAPPING":"",t.toneMapping!==qr?gt.tonemapping_pars_fragment:"",t.toneMapping!==qr?r8("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",gt.colorspace_pars_fragment,i8("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(Pu).join(` +`)),o=K2(o),o=jM(o,t),o=KM(o,t),a=K2(a),a=jM(a,t),a=KM(a,t),o=YM(o),a=YM(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(A=`#version 300 es +`,x=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+x,m=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===X2?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===X2?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+m);const M=A+x+o,w=A+m+a,T=XM(r,r.VERTEX_SHADER,M),b=XM(r,r.FRAGMENT_SHADER,w);r.attachShader(S,T),r.attachShader(S,b),t.index0AttributeName!==void 0?r.bindAttribLocation(S,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(S,0,"position"),r.linkProgram(S);function B(H){if(n.debug.checkShaderErrors){const J=r.getProgramInfoLog(S).trim(),te=r.getShaderInfoLog(T).trim(),V=r.getShaderInfoLog(b).trim();let q=!0,re=!0;if(r.getProgramParameter(S,r.LINK_STATUS)===!1)if(q=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,S,T,b);else{const ae=JM(r,T,"vertex"),D=JM(r,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(S,r.VALIDATE_STATUS)+` + +Program Info Log: `+J+` +`+ae+` +`+D)}else J!==""?console.warn("THREE.WebGLProgram: Program Info Log:",J):(te===""||V==="")&&(re=!1);re&&(H.diagnostics={runnable:q,programLog:J,vertexShader:{log:te,prefix:x},fragmentShader:{log:V,prefix:m}})}r.deleteShader(T),r.deleteShader(b),I=new Fp(r,S),R=a8(r,S)}let I;this.getUniforms=function(){return I===void 0&&B(this),I};let R;this.getAttributes=function(){return R===void 0&&B(this),R};let P=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return P===!1&&(P=r.getProgramParameter(S,$U)),P},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(S),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=e8++,this.cacheKey=e,this.usedTimes=1,this.program=S,this.vertexShader=T,this.fragmentShader=b,this}let _8=0;class x8{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new A8(e),t.set(e,i)),i}}class A8{constructor(e){this.id=_8++,this.code=e,this.usedTimes=0}}function S8(n,e,t,i,r,s,o){const a=new Ca,l=new x8,f=[],d=r.isWebGL2,h=r.logarithmicDepthBuffer,p=r.vertexTextures;let v=r.precision;const y={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 S(R){return R===0?"uv":`uv${R}`}function x(R,P,H,J,te){const V=J.fog,q=te.geometry,re=R.isMeshStandardMaterial?J.environment:null,ae=(R.isMeshStandardMaterial?t:e).get(R.envMap||re),D=ae&&ae.mapping===Bc?ae.image.height:null,k=y[R.type];R.precision!==null&&(v=r.getMaxPrecision(R.precision),v!==R.precision&&console.warn("THREE.WebGLProgram.getParameters:",R.precision,"not supported, using",v,"instead."));const G=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,Y=G!==void 0?G.length:0;let $=0;q.morphAttributes.position!==void 0&&($=1),q.morphAttributes.normal!==void 0&&($=2),q.morphAttributes.color!==void 0&&($=3);let Z,ue,ge,we;if(k){const In=Cr[k];Z=In.vertexShader,ue=In.fragmentShader}else Z=R.vertexShader,ue=R.fragmentShader,l.update(R),ge=l.getVertexShaderID(R),we=l.getFragmentShaderID(R);const Re=n.getRenderTarget(),at=te.isInstancedMesh===!0,st=te.isBatchedMesh===!0,Xe=!!R.map,Ve=!!R.matcap,z=!!ae,ye=!!R.aoMap,he=!!R.lightMap,Ce=!!R.bumpMap,me=!!R.normalMap,Qe=!!R.displacementMap,Ne=!!R.emissiveMap,Oe=!!R.metalnessMap,et=!!R.roughnessMap,Mt=R.anisotropy>0,Wt=R.clearcoat>0,O=R.iridescence>0,L=R.sheen>0,ie=R.transmission>0,xe=Mt&&!!R.anisotropyMap,ve=Wt&&!!R.clearcoatMap,Ae=Wt&&!!R.clearcoatNormalMap,Je=Wt&&!!R.clearcoatRoughnessMap,Te=O&&!!R.iridescenceMap,Ie=O&&!!R.iridescenceThicknessMap,lt=L&&!!R.sheenColorMap,Pt=L&&!!R.sheenRoughnessMap,Ee=!!R.specularMap,Ft=!!R.specularColorMap,dt=!!R.specularIntensityMap,ot=ie&&!!R.transmissionMap,Ze=ie&&!!R.thicknessMap,He=!!R.gradientMap,St=!!R.alphaMap,W=R.alphaTest>0,Fe=!!R.alphaHash,Se=!!R.extensions,de=!!q.attributes.uv1,be=!!q.attributes.uv2,nt=!!q.attributes.uv3;let Et=qr;return R.toneMapped&&(Re===null||Re.isXRRenderTarget===!0)&&(Et=n.toneMapping),{isWebGL2:d,shaderID:k,shaderType:R.type,shaderName:R.name,vertexShader:Z,fragmentShader:ue,defines:R.defines,customVertexShaderID:ge,customFragmentShaderID:we,isRawShaderMaterial:R.isRawShaderMaterial===!0,glslVersion:R.glslVersion,precision:v,batching:st,instancing:at,instancingColor:at&&te.instanceColor!==null,supportsVertexTextures:p,outputColorSpace:Re===null?n.outputColorSpace:Re.isXRRenderTarget===!0?Re.texture.colorSpace:rs,map:Xe,matcap:Ve,envMap:z,envMapMode:z&&ae.mapping,envMapCubeUVHeight:D,aoMap:ye,lightMap:he,bumpMap:Ce,normalMap:me,displacementMap:p&&Qe,emissiveMap:Ne,normalMapObjectSpace:me&&R.normalMapType===YT,normalMapTangentSpace:me&&R.normalMapType===ko,metalnessMap:Oe,roughnessMap:et,anisotropy:Mt,anisotropyMap:xe,clearcoat:Wt,clearcoatMap:ve,clearcoatNormalMap:Ae,clearcoatRoughnessMap:Je,iridescence:O,iridescenceMap:Te,iridescenceThicknessMap:Ie,sheen:L,sheenColorMap:lt,sheenRoughnessMap:Pt,specularMap:Ee,specularColorMap:Ft,specularIntensityMap:dt,transmission:ie,transmissionMap:ot,thicknessMap:Ze,gradientMap:He,opaque:R.transparent===!1&&R.blending===Ea,alphaMap:St,alphaTest:W,alphaHash:Fe,combine:R.combine,mapUv:Xe&&S(R.map.channel),aoMapUv:ye&&S(R.aoMap.channel),lightMapUv:he&&S(R.lightMap.channel),bumpMapUv:Ce&&S(R.bumpMap.channel),normalMapUv:me&&S(R.normalMap.channel),displacementMapUv:Qe&&S(R.displacementMap.channel),emissiveMapUv:Ne&&S(R.emissiveMap.channel),metalnessMapUv:Oe&&S(R.metalnessMap.channel),roughnessMapUv:et&&S(R.roughnessMap.channel),anisotropyMapUv:xe&&S(R.anisotropyMap.channel),clearcoatMapUv:ve&&S(R.clearcoatMap.channel),clearcoatNormalMapUv:Ae&&S(R.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Je&&S(R.clearcoatRoughnessMap.channel),iridescenceMapUv:Te&&S(R.iridescenceMap.channel),iridescenceThicknessMapUv:Ie&&S(R.iridescenceThicknessMap.channel),sheenColorMapUv:lt&&S(R.sheenColorMap.channel),sheenRoughnessMapUv:Pt&&S(R.sheenRoughnessMap.channel),specularMapUv:Ee&&S(R.specularMap.channel),specularColorMapUv:Ft&&S(R.specularColorMap.channel),specularIntensityMapUv:dt&&S(R.specularIntensityMap.channel),transmissionMapUv:ot&&S(R.transmissionMap.channel),thicknessMapUv:Ze&&S(R.thicknessMap.channel),alphaMapUv:St&&S(R.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(me||Mt),vertexColors:R.vertexColors,vertexAlphas:R.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,vertexUv1s:de,vertexUv2s:be,vertexUv3s:nt,pointsUvs:te.isPoints===!0&&!!q.attributes.uv&&(Xe||St),fog:!!V,useFog:R.fog===!0,fogExp2:V&&V.isFogExp2,flatShading:R.flatShading===!0,sizeAttenuation:R.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:te.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:$,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:R.dithering,shadowMapEnabled:n.shadowMap.enabled&&H.length>0,shadowMapType:n.shadowMap.type,toneMapping:Et,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Xe&&R.map.isVideoTexture===!0&&Ut.getTransfer(R.map.colorSpace)===zt,premultipliedAlpha:R.premultipliedAlpha,doubleSided:R.side===Tr,flipSided:R.side===_i,useDepthPacking:R.depthPacking>=0,depthPacking:R.depthPacking||0,index0AttributeName:R.index0AttributeName,extensionDerivatives:Se&&R.extensions.derivatives===!0,extensionFragDepth:Se&&R.extensions.fragDepth===!0,extensionDrawBuffers:Se&&R.extensions.drawBuffers===!0,extensionShaderTextureLOD:Se&&R.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:d||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:R.customProgramCacheKey()}}function m(R){const P=[];if(R.shaderID?P.push(R.shaderID):(P.push(R.customVertexShaderID),P.push(R.customFragmentShaderID)),R.defines!==void 0)for(const H in R.defines)P.push(H),P.push(R.defines[H]);return R.isRawShaderMaterial===!1&&(A(P,R),M(P,R),P.push(n.outputColorSpace)),P.push(R.customProgramCacheKey),P.join()}function A(R,P){R.push(P.precision),R.push(P.outputColorSpace),R.push(P.envMapMode),R.push(P.envMapCubeUVHeight),R.push(P.mapUv),R.push(P.alphaMapUv),R.push(P.lightMapUv),R.push(P.aoMapUv),R.push(P.bumpMapUv),R.push(P.normalMapUv),R.push(P.displacementMapUv),R.push(P.emissiveMapUv),R.push(P.metalnessMapUv),R.push(P.roughnessMapUv),R.push(P.anisotropyMapUv),R.push(P.clearcoatMapUv),R.push(P.clearcoatNormalMapUv),R.push(P.clearcoatRoughnessMapUv),R.push(P.iridescenceMapUv),R.push(P.iridescenceThicknessMapUv),R.push(P.sheenColorMapUv),R.push(P.sheenRoughnessMapUv),R.push(P.specularMapUv),R.push(P.specularColorMapUv),R.push(P.specularIntensityMapUv),R.push(P.transmissionMapUv),R.push(P.thicknessMapUv),R.push(P.combine),R.push(P.fogExp2),R.push(P.sizeAttenuation),R.push(P.morphTargetsCount),R.push(P.morphAttributeCount),R.push(P.numDirLights),R.push(P.numPointLights),R.push(P.numSpotLights),R.push(P.numSpotLightMaps),R.push(P.numHemiLights),R.push(P.numRectAreaLights),R.push(P.numDirLightShadows),R.push(P.numPointLightShadows),R.push(P.numSpotLightShadows),R.push(P.numSpotLightShadowsWithMaps),R.push(P.numLightProbes),R.push(P.shadowMapType),R.push(P.toneMapping),R.push(P.numClippingPlanes),R.push(P.numClipIntersection),R.push(P.depthPacking)}function M(R,P){a.disableAll(),P.isWebGL2&&a.enable(0),P.supportsVertexTextures&&a.enable(1),P.instancing&&a.enable(2),P.instancingColor&&a.enable(3),P.matcap&&a.enable(4),P.envMap&&a.enable(5),P.normalMapObjectSpace&&a.enable(6),P.normalMapTangentSpace&&a.enable(7),P.clearcoat&&a.enable(8),P.iridescence&&a.enable(9),P.alphaTest&&a.enable(10),P.vertexColors&&a.enable(11),P.vertexAlphas&&a.enable(12),P.vertexUv1s&&a.enable(13),P.vertexUv2s&&a.enable(14),P.vertexUv3s&&a.enable(15),P.vertexTangents&&a.enable(16),P.anisotropy&&a.enable(17),P.alphaHash&&a.enable(18),P.batching&&a.enable(19),R.push(a.mask),a.disableAll(),P.fog&&a.enable(0),P.useFog&&a.enable(1),P.flatShading&&a.enable(2),P.logarithmicDepthBuffer&&a.enable(3),P.skinning&&a.enable(4),P.morphTargets&&a.enable(5),P.morphNormals&&a.enable(6),P.morphColors&&a.enable(7),P.premultipliedAlpha&&a.enable(8),P.shadowMapEnabled&&a.enable(9),P.useLegacyLights&&a.enable(10),P.doubleSided&&a.enable(11),P.flipSided&&a.enable(12),P.useDepthPacking&&a.enable(13),P.dithering&&a.enable(14),P.transmission&&a.enable(15),P.sheen&&a.enable(16),P.opaque&&a.enable(17),P.pointsUvs&&a.enable(18),P.decodeVideoTexture&&a.enable(19),R.push(a.mask)}function w(R){const P=y[R.type];let H;if(P){const J=Cr[P];H=cR.clone(J.uniforms)}else H=R.uniforms;return H}function T(R,P){let H;for(let J=0,te=f.length;J0?i.push(m):v.transparent===!0?r.push(m):t.push(m)}function l(h,p,v,y,S,x){const m=o(h,p,v,y,S,x);v.transmission>0?i.unshift(m):v.transparent===!0?r.unshift(m):t.unshift(m)}function f(h,p){t.length>1&&t.sort(h||E8),i.length>1&&i.sort(p||ZM),r.length>1&&r.sort(p||ZM)}function d(){for(let h=e,p=n.length;h=s.length?(o=new qM,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function C8(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new Pe};break;case"SpotLight":t={position:new F,direction:new F,color:new Pe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new Pe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new Pe,groundColor:new Pe};break;case"RectAreaLight":t={color:new Pe,position:new F,halfWidth:new F,halfHeight:new F};break}return n[e.id]=t,t}}}function T8(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new pe};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new pe};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new pe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let R8=0;function b8(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function B8(n,e){const t=new C8,i=T8(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let d=0;d<9;d++)r.probe.push(new F);const s=new F,o=new $e,a=new $e;function l(d,h){let p=0,v=0,y=0;for(let J=0;J<9;J++)r.probe[J].set(0,0,0);let S=0,x=0,m=0,A=0,M=0,w=0,T=0,b=0,B=0,I=0,R=0;d.sort(b8);const P=h===!0?Math.PI:1;for(let J=0,te=d.length;J0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Be.LTC_FLOAT_1,r.rectAreaLTC2=Be.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Be.LTC_HALF_1,r.rectAreaLTC2=Be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=p,r.ambient[1]=v,r.ambient[2]=y;const H=r.hash;(H.directionalLength!==S||H.pointLength!==x||H.spotLength!==m||H.rectAreaLength!==A||H.hemiLength!==M||H.numDirectionalShadows!==w||H.numPointShadows!==T||H.numSpotShadows!==b||H.numSpotMaps!==B||H.numLightProbes!==R)&&(r.directional.length=S,r.spot.length=m,r.rectArea.length=A,r.point.length=x,r.hemi.length=M,r.directionalShadow.length=w,r.directionalShadowMap.length=w,r.pointShadow.length=T,r.pointShadowMap.length=T,r.spotShadow.length=b,r.spotShadowMap.length=b,r.directionalShadowMatrix.length=w,r.pointShadowMatrix.length=T,r.spotLightMatrix.length=b+B-I,r.spotLightMap.length=B,r.numSpotLightShadowsWithMaps=I,r.numLightProbes=R,H.directionalLength=S,H.pointLength=x,H.spotLength=m,H.rectAreaLength=A,H.hemiLength=M,H.numDirectionalShadows=w,H.numPointShadows=T,H.numSpotShadows=b,H.numSpotMaps=B,H.numLightProbes=R,r.version=R8++)}function f(d,h){let p=0,v=0,y=0,S=0,x=0;const m=h.matrixWorldInverse;for(let A=0,M=d.length;A=a.length?(l=new $M(n,e),a.push(l)):l=a[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}class B_ extends wn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=jT,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class P_ extends wn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const L8=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,I8=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function D8(n,e,t){let i=new Xf;const r=new pe,s=new pe,o=new Ot,a=new B_({depthPacking:KT}),l=new P_,f={},d=t.maxTextureSize,h={[ns]:_i,[_i]:ns,[Tr]:Tr},p=new ss({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new pe},radius:{value:4}},vertexShader:L8,fragmentShader:I8}),v=p.clone();v.defines.HORIZONTAL_PASS=1;const y=new mt;y.setAttribute("position",new Bt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new En(y,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Qm;let m=this.type;this.render=function(T,b,B){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||T.length===0)return;const I=n.getRenderTarget(),R=n.getActiveCubeFace(),P=n.getActiveMipmapLevel(),H=n.state;H.setBlending(Ts),H.buffers.color.setClear(1,1,1,1),H.buffers.depth.setTest(!0),H.setScissorTest(!1);const J=m!==Mr&&this.type===Mr,te=m===Mr&&this.type!==Mr;for(let V=0,q=T.length;Vd||r.y>d)&&(r.x>d&&(s.x=Math.floor(d/D.x),r.x=s.x*D.x,ae.mapSize.x=s.x),r.y>d&&(s.y=Math.floor(d/D.y),r.y=s.y*D.y,ae.mapSize.y=s.y)),ae.map===null||J===!0||te===!0){const G=this.type!==Mr?{minFilter:fn,magFilter:fn}:{};ae.map!==null&&ae.map.dispose(),ae.map=new Dr(r.x,r.y,G),ae.map.texture.name=re.name+".shadowMap",ae.camera.updateProjectionMatrix()}n.setRenderTarget(ae.map),n.clear();const k=ae.getViewportCount();for(let G=0;G0||b.map&&b.alphaTest>0){const H=R.uuid,J=b.uuid;let te=f[H];te===void 0&&(te={},f[H]=te);let V=te[J];V===void 0&&(V=R.clone(),te[J]=V),R=V}if(R.visible=b.visible,R.wireframe=b.wireframe,I===Mr?R.side=b.shadowSide!==null?b.shadowSide:b.side:R.side=b.shadowSide!==null?b.shadowSide:h[b.side],R.alphaMap=b.alphaMap,R.alphaTest=b.alphaTest,R.map=b.map,R.clipShadows=b.clipShadows,R.clippingPlanes=b.clippingPlanes,R.clipIntersection=b.clipIntersection,R.displacementMap=b.displacementMap,R.displacementScale=b.displacementScale,R.displacementBias=b.displacementBias,R.wireframeLinewidth=b.wireframeLinewidth,R.linewidth=b.linewidth,B.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const H=n.properties.get(R);H.light=B}return R}function w(T,b,B,I,R){if(T.visible===!1)return;if(T.layers.test(b.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&R===Mr)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,T.matrixWorld);const J=e.update(T),te=T.material;if(Array.isArray(te)){const V=J.groups;for(let q=0,re=V.length;q=1):G.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),D=k>=2);let Y=null,$={};const Z=n.getParameter(n.SCISSOR_BOX),ue=n.getParameter(n.VIEWPORT),ge=new Ot().fromArray(Z),we=new Ot().fromArray(ue);function Re(W,Fe,Se,de){const be=new Uint8Array(4),nt=n.createTexture();n.bindTexture(W,nt),n.texParameteri(W,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(W,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Et=0;Et"u"?!1:/OculusBrowser/g.test(navigator.userAgent),y=new WeakMap;let S;const x=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function A(O,L){return m?new OffscreenCanvas(O,L):Sf("canvas")}function M(O,L,ie,xe){let ve=1;if((O.width>xe||O.height>xe)&&(ve=xe/Math.max(O.width,O.height)),ve<1||L===!0)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap){const Ae=L?gm:Math.floor,Je=Ae(ve*O.width),Te=Ae(ve*O.height);S===void 0&&(S=A(Je,Te));const Ie=ie?A(Je,Te):S;return Ie.width=Je,Ie.height=Te,Ie.getContext("2d").drawImage(O,0,0,Je,Te),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+O.width+"x"+O.height+") to ("+Je+"x"+Te+")."),Ie}else return"data"in O&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+O.width+"x"+O.height+")."),O;return O}function w(O){return J2(O.width)&&J2(O.height)}function T(O){return a?!1:O.wrapS!==jn||O.wrapT!==jn||O.minFilter!==fn&&O.minFilter!==nn}function b(O,L){return O.generateMipmaps&&L&&O.minFilter!==fn&&O.minFilter!==nn}function B(O){n.generateMipmap(O)}function I(O,L,ie,xe,ve=!1){if(a===!1)return L;if(O!==null){if(n[O]!==void 0)return n[O];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let Ae=L;if(L===n.RED&&(ie===n.FLOAT&&(Ae=n.R32F),ie===n.HALF_FLOAT&&(Ae=n.R16F),ie===n.UNSIGNED_BYTE&&(Ae=n.R8)),L===n.RED_INTEGER&&(ie===n.UNSIGNED_BYTE&&(Ae=n.R8UI),ie===n.UNSIGNED_SHORT&&(Ae=n.R16UI),ie===n.UNSIGNED_INT&&(Ae=n.R32UI),ie===n.BYTE&&(Ae=n.R8I),ie===n.SHORT&&(Ae=n.R16I),ie===n.INT&&(Ae=n.R32I)),L===n.RG&&(ie===n.FLOAT&&(Ae=n.RG32F),ie===n.HALF_FLOAT&&(Ae=n.RG16F),ie===n.UNSIGNED_BYTE&&(Ae=n.RG8)),L===n.RGBA){const Je=ve?yf:Ut.getTransfer(xe);ie===n.FLOAT&&(Ae=n.RGBA32F),ie===n.HALF_FLOAT&&(Ae=n.RGBA16F),ie===n.UNSIGNED_BYTE&&(Ae=Je===zt?n.SRGB8_ALPHA8:n.RGBA8),ie===n.UNSIGNED_SHORT_4_4_4_4&&(Ae=n.RGBA4),ie===n.UNSIGNED_SHORT_5_5_5_1&&(Ae=n.RGB5_A1)}return(Ae===n.R16F||Ae===n.R32F||Ae===n.RG16F||Ae===n.RG32F||Ae===n.RGBA16F||Ae===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Ae}function R(O,L,ie){return b(O,ie)===!0||O.isFramebufferTexture&&O.minFilter!==fn&&O.minFilter!==nn?Math.log2(Math.max(L.width,L.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?L.mipmaps.length:1}function P(O){return O===fn||O===gf||O===nc?n.NEAREST:n.LINEAR}function H(O){const L=O.target;L.removeEventListener("dispose",H),te(L),L.isVideoTexture&&y.delete(L)}function J(O){const L=O.target;L.removeEventListener("dispose",J),q(L)}function te(O){const L=i.get(O);if(L.__webglInit===void 0)return;const ie=O.source,xe=x.get(ie);if(xe){const ve=xe[L.__cacheKey];ve.usedTimes--,ve.usedTimes===0&&V(O),Object.keys(xe).length===0&&x.delete(ie)}i.remove(O)}function V(O){const L=i.get(O);n.deleteTexture(L.__webglTexture);const ie=O.source,xe=x.get(ie);delete xe[L.__cacheKey],o.memory.textures--}function q(O){const L=O.texture,ie=i.get(O),xe=i.get(L);if(xe.__webglTexture!==void 0&&(n.deleteTexture(xe.__webglTexture),o.memory.textures--),O.depthTexture&&O.depthTexture.dispose(),O.isWebGLCubeRenderTarget)for(let ve=0;ve<6;ve++){if(Array.isArray(ie.__webglFramebuffer[ve]))for(let Ae=0;Ae=l&&console.warn("THREE.WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+l),re+=1,O}function k(O){const L=[];return L.push(O.wrapS),L.push(O.wrapT),L.push(O.wrapR||0),L.push(O.magFilter),L.push(O.minFilter),L.push(O.anisotropy),L.push(O.internalFormat),L.push(O.format),L.push(O.type),L.push(O.generateMipmaps),L.push(O.premultiplyAlpha),L.push(O.flipY),L.push(O.unpackAlignment),L.push(O.colorSpace),L.join()}function G(O,L){const ie=i.get(O);if(O.isVideoTexture&&Mt(O),O.isRenderTargetTexture===!1&&O.version>0&&ie.__version!==O.version){const xe=O.image;if(xe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(xe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{st(ie,O,L);return}}t.bindTexture(n.TEXTURE_2D,ie.__webglTexture,n.TEXTURE0+L)}function Y(O,L){const ie=i.get(O);if(O.version>0&&ie.__version!==O.version){st(ie,O,L);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ie.__webglTexture,n.TEXTURE0+L)}function $(O,L){const ie=i.get(O);if(O.version>0&&ie.__version!==O.version){st(ie,O,L);return}t.bindTexture(n.TEXTURE_3D,ie.__webglTexture,n.TEXTURE0+L)}function Z(O,L){const ie=i.get(O);if(O.version>0&&ie.__version!==O.version){Xe(ie,O,L);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ie.__webglTexture,n.TEXTURE0+L)}const ue={[Io]:n.REPEAT,[jn]:n.CLAMP_TO_EDGE,[hc]:n.MIRRORED_REPEAT},ge={[fn]:n.NEAREST,[gf]:n.NEAREST_MIPMAP_NEAREST,[nc]:n.NEAREST_MIPMAP_LINEAR,[nn]:n.LINEAR,[qm]:n.LINEAR_MIPMAP_NEAREST,[is]:n.LINEAR_MIPMAP_LINEAR},we={[QT]:n.NEVER,[nR]:n.ALWAYS,[ZT]:n.LESS,[S_]:n.LEQUAL,[qT]:n.EQUAL,[tR]:n.GEQUAL,[$T]:n.GREATER,[eR]:n.NOTEQUAL};function Re(O,L,ie){if(ie?(n.texParameteri(O,n.TEXTURE_WRAP_S,ue[L.wrapS]),n.texParameteri(O,n.TEXTURE_WRAP_T,ue[L.wrapT]),(O===n.TEXTURE_3D||O===n.TEXTURE_2D_ARRAY)&&n.texParameteri(O,n.TEXTURE_WRAP_R,ue[L.wrapR]),n.texParameteri(O,n.TEXTURE_MAG_FILTER,ge[L.magFilter]),n.texParameteri(O,n.TEXTURE_MIN_FILTER,ge[L.minFilter])):(n.texParameteri(O,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(O,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(O===n.TEXTURE_3D||O===n.TEXTURE_2D_ARRAY)&&n.texParameteri(O,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(L.wrapS!==jn||L.wrapT!==jn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(O,n.TEXTURE_MAG_FILTER,P(L.magFilter)),n.texParameteri(O,n.TEXTURE_MIN_FILTER,P(L.minFilter)),L.minFilter!==fn&&L.minFilter!==nn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),L.compareFunction&&(n.texParameteri(O,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(O,n.TEXTURE_COMPARE_FUNC,we[L.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const xe=e.get("EXT_texture_filter_anisotropic");if(L.magFilter===fn||L.minFilter!==nc&&L.minFilter!==is||L.type===Rr&&e.has("OES_texture_float_linear")===!1||a===!1&&L.type===pc&&e.has("OES_texture_half_float_linear")===!1)return;(L.anisotropy>1||i.get(L).__currentAnisotropy)&&(n.texParameterf(O,xe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,r.getMaxAnisotropy())),i.get(L).__currentAnisotropy=L.anisotropy)}}function at(O,L){let ie=!1;O.__webglInit===void 0&&(O.__webglInit=!0,L.addEventListener("dispose",H));const xe=L.source;let ve=x.get(xe);ve===void 0&&(ve={},x.set(xe,ve));const Ae=k(L);if(Ae!==O.__cacheKey){ve[Ae]===void 0&&(ve[Ae]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ie=!0),ve[Ae].usedTimes++;const Je=ve[O.__cacheKey];Je!==void 0&&(ve[O.__cacheKey].usedTimes--,Je.usedTimes===0&&V(L)),O.__cacheKey=Ae,O.__webglTexture=ve[Ae].texture}return ie}function st(O,L,ie){let xe=n.TEXTURE_2D;(L.isDataArrayTexture||L.isCompressedArrayTexture)&&(xe=n.TEXTURE_2D_ARRAY),L.isData3DTexture&&(xe=n.TEXTURE_3D);const ve=at(O,L),Ae=L.source;t.bindTexture(xe,O.__webglTexture,n.TEXTURE0+ie);const Je=i.get(Ae);if(Ae.version!==Je.__version||ve===!0){t.activeTexture(n.TEXTURE0+ie);const Te=Ut.getPrimaries(Ut.workingColorSpace),Ie=L.colorSpace===Gi?null:Ut.getPrimaries(L.colorSpace),lt=L.colorSpace===Gi||Te===Ie?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,L.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,L.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,lt);const Pt=T(L)&&w(L.image)===!1;let Ee=M(L.image,Pt,!1,d);Ee=Wt(L,Ee);const Ft=w(Ee)||a,dt=s.convert(L.format,L.colorSpace);let ot=s.convert(L.type),Ze=I(L.internalFormat,dt,ot,L.colorSpace,L.isVideoTexture);Re(xe,L,Ft);let He;const St=L.mipmaps,W=a&&L.isVideoTexture!==!0&&Ze!==y_,Fe=Je.__version===void 0||ve===!0,Se=R(L,Ee,Ft);if(L.isDepthTexture)Ze=n.DEPTH_COMPONENT,a?L.type===Rr?Ze=n.DEPTH_COMPONENT32F:L.type===Es?Ze=n.DEPTH_COMPONENT24:L.type===Co?Ze=n.DEPTH24_STENCIL8:Ze=n.DEPTH_COMPONENT16:L.type===Rr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===To&&Ze===n.DEPTH_COMPONENT&&L.type!==$m&&L.type!==Es&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=Es,ot=s.convert(L.type)),L.format===Da&&Ze===n.DEPTH_COMPONENT&&(Ze=n.DEPTH_STENCIL,L.type!==Co&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=Co,ot=s.convert(L.type))),Fe&&(W?t.texStorage2D(n.TEXTURE_2D,1,Ze,Ee.width,Ee.height):t.texImage2D(n.TEXTURE_2D,0,Ze,Ee.width,Ee.height,0,dt,ot,null));else if(L.isDataTexture)if(St.length>0&&Ft){W&&Fe&&t.texStorage2D(n.TEXTURE_2D,Se,Ze,St[0].width,St[0].height);for(let de=0,be=St.length;de>=1,be>>=1}}else if(St.length>0&&Ft){W&&Fe&&t.texStorage2D(n.TEXTURE_2D,Se,Ze,St[0].width,St[0].height);for(let de=0,be=St.length;de0&&Fe++,t.texStorage2D(n.TEXTURE_CUBE_MAP,Fe,He,Ee[0].width,Ee[0].height));for(let de=0;de<6;de++)if(Pt){St?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,0,0,Ee[de].width,Ee[de].height,ot,Ze,Ee[de].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,He,Ee[de].width,Ee[de].height,0,ot,Ze,Ee[de].data);for(let be=0;be>Ae),Ee=Math.max(1,L.height>>Ae);ve===n.TEXTURE_3D||ve===n.TEXTURE_2D_ARRAY?t.texImage3D(ve,Ae,Ie,Pt,Ee,L.depth,0,Je,Te,null):t.texImage2D(ve,Ae,Ie,Pt,Ee,0,Je,Te,null)}t.bindFramebuffer(n.FRAMEBUFFER,O),et(L)?p.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,xe,ve,i.get(ie).__webglTexture,0,Oe(L)):(ve===n.TEXTURE_2D||ve>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&ve<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,xe,ve,i.get(ie).__webglTexture,Ae),t.bindFramebuffer(n.FRAMEBUFFER,null)}function z(O,L,ie){if(n.bindRenderbuffer(n.RENDERBUFFER,O),L.depthBuffer&&!L.stencilBuffer){let xe=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(ie||et(L)){const ve=L.depthTexture;ve&&ve.isDepthTexture&&(ve.type===Rr?xe=n.DEPTH_COMPONENT32F:ve.type===Es&&(xe=n.DEPTH_COMPONENT24));const Ae=Oe(L);et(L)?p.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ae,xe,L.width,L.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,Ae,xe,L.width,L.height)}else n.renderbufferStorage(n.RENDERBUFFER,xe,L.width,L.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,O)}else if(L.depthBuffer&&L.stencilBuffer){const xe=Oe(L);ie&&et(L)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,xe,n.DEPTH24_STENCIL8,L.width,L.height):et(L)?p.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,xe,n.DEPTH24_STENCIL8,L.width,L.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,L.width,L.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,O)}else{const xe=L.isWebGLMultipleRenderTargets===!0?L.texture:[L.texture];for(let ve=0;ve0){ie.__webglFramebuffer[Te]=[];for(let Ie=0;Ie0){ie.__webglFramebuffer=[];for(let Te=0;Te0&&et(O)===!1){const Te=Ae?L:[L];ie.__webglMultisampledFramebuffer=n.createFramebuffer(),ie.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ie.__webglMultisampledFramebuffer);for(let Ie=0;Ie0)for(let Ie=0;Ie0)for(let Ie=0;Ie0&&et(O)===!1){const L=O.isWebGLMultipleRenderTargets?O.texture:[O.texture],ie=O.width,xe=O.height;let ve=n.COLOR_BUFFER_BIT;const Ae=[],Je=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Te=i.get(O),Ie=O.isWebGLMultipleRenderTargets===!0;if(Ie)for(let lt=0;lt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&L.__useRenderToTexture!==!1}function Mt(O){const L=o.render.frame;y.get(O)!==L&&(y.set(O,L),O.update())}function Wt(O,L){const ie=O.colorSpace,xe=O.format,ve=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||O.format===mm||ie!==rs&&ie!==Gi&&(Ut.getTransfer(ie)===zt?a===!1?e.has("EXT_sRGB")===!0&&xe===vi?(O.format=mm,O.minFilter=nn,O.generateMipmaps=!1):L=E_.sRGBToLinear(L):(xe!==vi||ve!==$r)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ie)),L}this.allocateTextureUnit=D,this.resetTextureUnits=ae,this.setTexture2D=G,this.setTexture2DArray=Y,this.setTexture3D=$,this.setTextureCube=Z,this.rebindTextures=Ce,this.setupRenderTarget=me,this.updateRenderTargetMipmap=Qe,this.updateMultisampleRenderTarget=Ne,this.setupDepthRenderbuffer=he,this.setupFrameBufferTexture=Ve,this.useMultisampledRTT=et}function yR(n,e,t){const i=t.isWebGL2;function r(s,o=Gi){let a;const l=Ut.getTransfer(o);if(s===$r)return n.UNSIGNED_BYTE;if(s===h_)return n.UNSIGNED_SHORT_4_4_4_4;if(s===p_)return n.UNSIGNED_SHORT_5_5_5_1;if(s===NT)return n.BYTE;if(s===FT)return n.SHORT;if(s===$m)return n.UNSIGNED_SHORT;if(s===d_)return n.INT;if(s===Es)return n.UNSIGNED_INT;if(s===Rr)return n.FLOAT;if(s===pc)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===UT)return n.ALPHA;if(s===vi)return n.RGBA;if(s===OT)return n.LUMINANCE;if(s===kT)return n.LUMINANCE_ALPHA;if(s===To)return n.DEPTH_COMPONENT;if(s===Da)return n.DEPTH_STENCIL;if(s===mm)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===HT)return n.RED;if(s===m_)return n.RED_INTEGER;if(s===GT)return n.RG;if(s===g_)return n.RG_INTEGER;if(s===v_)return n.RGBA_INTEGER;if(s===Bp||s===Pp||s===Lp||s===Ip)if(l===zt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Bp)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Pp)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Lp)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Ip)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Bp)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Pp)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Lp)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Ip)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===_2||s===x2||s===A2||s===S2)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===_2)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===x2)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===A2)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===S2)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===y_)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===M2||s===E2)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===M2)return l===zt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===E2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===w2||s===C2||s===T2||s===R2||s===b2||s===B2||s===P2||s===L2||s===I2||s===D2||s===N2||s===F2||s===U2||s===O2)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===w2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===C2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===T2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===R2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===b2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===B2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===P2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===L2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===I2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===D2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===N2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===F2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===U2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===O2)return l===zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Dp||s===k2||s===H2)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===Dp)return l===zt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===k2)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===H2)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===zT||s===G2||s===z2||s===V2)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===Dp)return a.COMPRESSED_RED_RGTC1_EXT;if(s===G2)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===z2)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===V2)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Co?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:r}}class _R extends bn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ws extends wt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const U8={type:"move"};class Dv{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ws,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 ws,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ws,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(const S of e.hand.values()){const x=t.getJointPose(S,i),m=this._getHandJoint(f,S);x!==null&&(m.matrix.fromArray(x.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=x.radius),m.visible=x!==null}const d=f.joints["index-finger-tip"],h=f.joints["thumb-tip"],p=d.position.distanceTo(h.position),v=.02,y=.005;f.inputState.pinching&&p>v+y?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&p<=v-y&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(U8)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),f!==null&&(f.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new ws;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class O8 extends Fs{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,f=null,d=null,h=null,p=null,v=null,y=null;const S=t.getContextAttributes();let x=null,m=null;const A=[],M=[],w=new pe;let T=null;const b=new bn;b.layers.enable(1),b.viewport=new Ot;const B=new bn;B.layers.enable(2),B.viewport=new Ot;const I=[b,B],R=new _R;R.layers.enable(1),R.layers.enable(2);let P=null,H=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let ue=A[Z];return ue===void 0&&(ue=new Dv,A[Z]=ue),ue.getTargetRaySpace()},this.getControllerGrip=function(Z){let ue=A[Z];return ue===void 0&&(ue=new Dv,A[Z]=ue),ue.getGripSpace()},this.getHand=function(Z){let ue=A[Z];return ue===void 0&&(ue=new Dv,A[Z]=ue),ue.getHandSpace()};function J(Z){const ue=M.indexOf(Z.inputSource);if(ue===-1)return;const ge=A[ue];ge!==void 0&&(ge.update(Z.inputSource,Z.frame,f||o),ge.dispatchEvent({type:Z.type,data:Z.inputSource}))}function te(){r.removeEventListener("select",J),r.removeEventListener("selectstart",J),r.removeEventListener("selectend",J),r.removeEventListener("squeeze",J),r.removeEventListener("squeezestart",J),r.removeEventListener("squeezeend",J),r.removeEventListener("end",te),r.removeEventListener("inputsourceschange",V);for(let Z=0;Z=0&&(M[we]=null,A[we].disconnect(ge))}for(let ue=0;ue=M.length){M.push(ge),we=at;break}else if(M[at]===null){M[at]=ge,we=at;break}if(we===-1)break}const Re=A[we];Re&&Re.connect(ge)}}const q=new F,re=new F;function ae(Z,ue,ge){q.setFromMatrixPosition(ue.matrixWorld),re.setFromMatrixPosition(ge.matrixWorld);const we=q.distanceTo(re),Re=ue.projectionMatrix.elements,at=ge.projectionMatrix.elements,st=Re[14]/(Re[10]-1),Xe=Re[14]/(Re[10]+1),Ve=(Re[9]+1)/Re[5],z=(Re[9]-1)/Re[5],ye=(Re[8]-1)/Re[0],he=(at[8]+1)/at[0],Ce=st*ye,me=st*he,Qe=we/(-ye+he),Ne=Qe*-ye;ue.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(Ne),Z.translateZ(Qe),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert();const Oe=st+Qe,et=Xe+Qe,Mt=Ce-Ne,Wt=me+(we-Ne),O=Ve*Xe/et*Oe,L=z*Xe/et*Oe;Z.projectionMatrix.makePerspective(Mt,Wt,O,L,Oe,et),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}function D(Z,ue){ue===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(ue.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(r===null)return;R.near=B.near=b.near=Z.near,R.far=B.far=b.far=Z.far,(P!==R.near||H!==R.far)&&(r.updateRenderState({depthNear:R.near,depthFar:R.far}),P=R.near,H=R.far);const ue=Z.parent,ge=R.cameras;D(R,ue);for(let we=0;we0&&(x.alphaTest.value=m.alphaTest);const A=e.get(m).envMap;if(A&&(x.envMap.value=A,x.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=m.reflectivity,x.ior.value=m.ior,x.refractionRatio.value=m.refractionRatio),m.lightMap){x.lightMap.value=m.lightMap;const M=n._useLegacyLights===!0?Math.PI:1;x.lightMapIntensity.value=m.lightMapIntensity*M,t(m.lightMap,x.lightMapTransform)}m.aoMap&&(x.aoMap.value=m.aoMap,x.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,x.aoMapTransform))}function o(x,m){x.diffuse.value.copy(m.color),x.opacity.value=m.opacity,m.map&&(x.map.value=m.map,t(m.map,x.mapTransform))}function a(x,m){x.dashSize.value=m.dashSize,x.totalSize.value=m.dashSize+m.gapSize,x.scale.value=m.scale}function l(x,m,A,M){x.diffuse.value.copy(m.color),x.opacity.value=m.opacity,x.size.value=m.size*A,x.scale.value=M*.5,m.map&&(x.map.value=m.map,t(m.map,x.uvTransform)),m.alphaMap&&(x.alphaMap.value=m.alphaMap,t(m.alphaMap,x.alphaMapTransform)),m.alphaTest>0&&(x.alphaTest.value=m.alphaTest)}function f(x,m){x.diffuse.value.copy(m.color),x.opacity.value=m.opacity,x.rotation.value=m.rotation,m.map&&(x.map.value=m.map,t(m.map,x.mapTransform)),m.alphaMap&&(x.alphaMap.value=m.alphaMap,t(m.alphaMap,x.alphaMapTransform)),m.alphaTest>0&&(x.alphaTest.value=m.alphaTest)}function d(x,m){x.specular.value.copy(m.specular),x.shininess.value=Math.max(m.shininess,1e-4)}function h(x,m){m.gradientMap&&(x.gradientMap.value=m.gradientMap)}function p(x,m){x.metalness.value=m.metalness,m.metalnessMap&&(x.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,x.metalnessMapTransform)),x.roughness.value=m.roughness,m.roughnessMap&&(x.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,x.roughnessMapTransform)),e.get(m).envMap&&(x.envMapIntensity.value=m.envMapIntensity)}function v(x,m,A){x.ior.value=m.ior,m.sheen>0&&(x.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),x.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(x.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,x.sheenColorMapTransform)),m.sheenRoughnessMap&&(x.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,x.sheenRoughnessMapTransform))),m.clearcoat>0&&(x.clearcoat.value=m.clearcoat,x.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(x.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,x.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(x.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===_i&&x.clearcoatNormalScale.value.negate())),m.iridescence>0&&(x.iridescence.value=m.iridescence,x.iridescenceIOR.value=m.iridescenceIOR,x.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(x.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,x.iridescenceMapTransform)),m.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),m.transmission>0&&(x.transmission.value=m.transmission,x.transmissionSamplerMap.value=A.texture,x.transmissionSamplerSize.value.set(A.width,A.height),m.transmissionMap&&(x.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,x.transmissionMapTransform)),x.thickness.value=m.thickness,m.thicknessMap&&(x.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=m.attenuationDistance,x.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(x.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(x.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=m.specularIntensity,x.specularColor.value.copy(m.specularColor),m.specularColorMap&&(x.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,x.specularColorMapTransform)),m.specularIntensityMap&&(x.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,x.specularIntensityMapTransform))}function y(x,m){m.matcap&&(x.matcap.value=m.matcap)}function S(x,m){const A=e.get(m).light;x.referencePosition.value.setFromMatrixPosition(A.matrixWorld),x.nearDistance.value=A.shadow.camera.near,x.farDistance.value=A.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function H8(n,e,t,i){let r={},s={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(A,M){const w=M.program;i.uniformBlockBinding(A,w)}function f(A,M){let w=r[A.id];w===void 0&&(y(A),w=d(A),r[A.id]=w,A.addEventListener("dispose",x));const T=M.program;i.updateUBOMapping(A,T);const b=e.render.frame;s[A.id]!==b&&(p(A),s[A.id]=b)}function d(A){const M=h();A.__bindingPointIndex=M;const w=n.createBuffer(),T=A.__size,b=A.usage;return n.bindBuffer(n.UNIFORM_BUFFER,w),n.bufferData(n.UNIFORM_BUFFER,T,b),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,M,w),w}function h(){for(let A=0;A0){b=w%T;const J=T-b;b!==0&&J-P.boundary<0&&(w+=T-b,R.__offset=w)}w+=P.storage}return b=w%T,b>0&&(w+=T-b),A.__size=w,A.__cache={},this}function S(A){const M={boundary:0,storage:0};return typeof A=="number"?(M.boundary=4,M.storage=4):A.isVector2?(M.boundary=8,M.storage=8):A.isVector3||A.isColor?(M.boundary=16,M.storage=12):A.isVector4?(M.boundary=16,M.storage=16):A.isMatrix3?(M.boundary=48,M.storage=48):A.isMatrix4?(M.boundary=64,M.storage=64):A.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",A),M}function x(A){const M=A.target;M.removeEventListener("dispose",x);const w=o.indexOf(M.__bindingPointIndex);o.splice(w,1),n.deleteBuffer(r[M.id]),delete r[M.id],delete s[M.id]}function m(){for(const A in r)n.deleteBuffer(r[A]);o=[],r={},s={}}return{bind:l,update:f,dispose:m}}class L_{constructor(e={}){const{canvas:t=sR(),context:i=null,depth:r=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:f=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let p;i!==null?p=i.getContextAttributes().alpha:p=o;const v=new Uint32Array(4),y=new Int32Array(4);let S=null,x=null;const m=[],A=[];this.domElement=t,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=Rn,this._useLegacyLights=!1,this.toneMapping=qr,this.toneMappingExposure=1;const M=this;let w=!1,T=0,b=0,B=null,I=-1,R=null;const P=new Ot,H=new Ot;let J=null;const te=new Pe(0);let V=0,q=t.width,re=t.height,ae=1,D=null,k=null;const G=new Ot(0,0,q,re),Y=new Ot(0,0,q,re);let $=!1;const Z=new Xf;let ue=!1,ge=!1,we=null;const Re=new $e,at=new pe,st=new F,Xe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ve(){return B===null?ae:1}let z=i;function ye(N,Q){for(let oe=0;oe{function Ue(){if(ce.forEach(function(Ke){Ne.get(Ke).currentProgram.isReady()&&ce.delete(Ke)}),ce.size===0){se(N);return}setTimeout(Ue,10)}he.get("KHR_parallel_shader_compile")!==null?Ue():setTimeout(Ue,10)})};let Et=null;function mn(N){Et&&Et(N)}function In(){zn.stop()}function Ht(){zn.start()}const zn=new dR;zn.setAnimationLoop(mn),typeof self<"u"&&zn.setContext(self),this.setAnimationLoop=function(N){Et=N,He.setAnimationLoop(N),N===null?zn.stop():zn.start()},He.addEventListener("sessionstart",In),He.addEventListener("sessionend",Ht),this.render=function(N,Q){if(Q!==void 0&&Q.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),Q.parent===null&&Q.matrixWorldAutoUpdate===!0&&Q.updateMatrixWorld(),He.enabled===!0&&He.isPresenting===!0&&(He.cameraAutoUpdate===!0&&He.updateCamera(Q),Q=He.getCamera()),N.isScene===!0&&N.onBeforeRender(M,N,Q,B),x=Ae.get(N,A.length),x.init(),A.push(x),Re.multiplyMatrices(Q.projectionMatrix,Q.matrixWorldInverse),Z.setFromProjectionMatrix(Re),ge=this.localClippingEnabled,ue=Je.init(this.clippingPlanes,ge),S=ve.get(N,m.length),S.init(),m.push(S),Qi(N,Q,0,M.sortObjects),S.finish(),M.sortObjects===!0&&S.sort(D,k),this.info.render.frame++,ue===!0&&Je.beginShadows();const oe=x.state.shadowsArray;if(Te.render(oe,N,Q),ue===!0&&Je.endShadows(),this.info.autoReset===!0&&this.info.reset(),Ie.render(S,N),x.setupLights(M._useLegacyLights),Q.isArrayCamera){const ce=Q.cameras;for(let se=0,Ue=ce.length;se0?x=A[A.length-1]:x=null,m.pop(),m.length>0?S=m[m.length-1]:S=null};function Qi(N,Q,oe,ce){if(N.visible===!1)return;if(N.layers.test(Q.layers)){if(N.isGroup)oe=N.renderOrder;else if(N.isLOD)N.autoUpdate===!0&&N.update(Q);else if(N.isLight)x.pushLight(N),N.castShadow&&x.pushShadow(N);else if(N.isSprite){if(!N.frustumCulled||Z.intersectsSprite(N)){ce&&st.setFromMatrixPosition(N.matrixWorld).applyMatrix4(Re);const Ke=L.update(N),tt=N.material;tt.visible&&S.push(N,Ke,tt,oe,st.z,null)}}else if((N.isMesh||N.isLine||N.isPoints)&&(!N.frustumCulled||Z.intersectsObject(N))){const Ke=L.update(N),tt=N.material;if(ce&&(N.boundingSphere!==void 0?(N.boundingSphere===null&&N.computeBoundingSphere(),st.copy(N.boundingSphere.center)):(Ke.boundingSphere===null&&Ke.computeBoundingSphere(),st.copy(Ke.boundingSphere.center)),st.applyMatrix4(N.matrixWorld).applyMatrix4(Re)),Array.isArray(tt)){const it=Ke.groups;for(let ut=0,ct=it.length;ut0&&Uc(se,Ue,Q,oe),ce&&me.viewport(P.copy(ce)),se.length>0&&Ja(se,Q,oe),Ue.length>0&&Ja(Ue,Q,oe),Ke.length>0&&Ja(Ke,Q,oe),me.buffers.depth.setTest(!0),me.buffers.depth.setMask(!0),me.buffers.color.setMask(!0),me.setPolygonOffset(!1)}function Uc(N,Q,oe,ce){if((oe.isScene===!0?oe.overrideMaterial:null)!==null)return;const Ue=Ce.isWebGL2;we===null&&(we=new Dr(1,1,{generateMipmaps:!0,type:he.has("EXT_color_buffer_half_float")?pc:$r,minFilter:is,samples:Ue?4:0})),M.getDrawingBufferSize(at),Ue?we.setSize(at.x,at.y):we.setSize(gm(at.x),gm(at.y));const Ke=M.getRenderTarget();M.setRenderTarget(we),M.getClearColor(te),V=M.getClearAlpha(),V<1&&M.setClearColor(16777215,.5),M.clear();const tt=M.toneMapping;M.toneMapping=qr,Ja(N,oe,ce),Oe.updateMultisampleRenderTarget(we),Oe.updateRenderTargetMipmap(we);let it=!1;for(let ut=0,ct=Q.length;ut0),ft=!!oe.morphAttributes.position,$t=!!oe.morphAttributes.normal,Vn=!!oe.morphAttributes.color;let Xt=qr;ce.toneMapped&&(B===null||B.isXRRenderTarget===!0)&&(Xt=M.toneMapping);const Dn=oe.morphAttributes.position||oe.morphAttributes.normal||oe.morphAttributes.color,rt=Dn!==void 0?Dn.length:0,Ge=Ne.get(ce),Zi=x.state.lights;if(ue===!0&&(ge===!0||N!==R)){const Wn=N===R&&ce.id===I;Je.setState(ce,N,Wn)}let xt=!1;ce.version===Ge.__version?(Ge.needsLights&&Ge.lightsStateVersion!==Zi.state.version||Ge.outputColorSpace!==tt||se.isBatchedMesh&&Ge.batching===!1||!se.isBatchedMesh&&Ge.batching===!0||se.isInstancedMesh&&Ge.instancing===!1||!se.isInstancedMesh&&Ge.instancing===!0||se.isSkinnedMesh&&Ge.skinning===!1||!se.isSkinnedMesh&&Ge.skinning===!0||se.isInstancedMesh&&Ge.instancingColor===!0&&se.instanceColor===null||se.isInstancedMesh&&Ge.instancingColor===!1&&se.instanceColor!==null||Ge.envMap!==it||ce.fog===!0&&Ge.fog!==Ue||Ge.numClippingPlanes!==void 0&&(Ge.numClippingPlanes!==Je.numPlanes||Ge.numIntersection!==Je.numIntersection)||Ge.vertexAlphas!==ut||Ge.vertexTangents!==ct||Ge.morphTargets!==ft||Ge.morphNormals!==$t||Ge.morphColors!==Vn||Ge.toneMapping!==Xt||Ce.isWebGL2===!0&&Ge.morphTargetsCount!==rt)&&(xt=!0):(xt=!0,Ge.__version=ce.version);let an=Ge.currentProgram;xt===!0&&(an=ja(ce,Q,se));let Or=!1,qi=!1,Nn=!1;const gn=an.getUniforms(),kr=Ge.uniforms;if(me.useProgram(an.program)&&(Or=!0,qi=!0,Nn=!0),ce.id!==I&&(I=ce.id,qi=!0),Or||R!==N){gn.setValue(z,"projectionMatrix",N.projectionMatrix),gn.setValue(z,"viewMatrix",N.matrixWorldInverse);const Wn=gn.map.cameraPosition;Wn!==void 0&&Wn.setValue(z,st.setFromMatrixPosition(N.matrixWorld)),Ce.logarithmicDepthBuffer&&gn.setValue(z,"logDepthBufFC",2/(Math.log(N.far+1)/Math.LN2)),(ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshLambertMaterial||ce.isMeshBasicMaterial||ce.isMeshStandardMaterial||ce.isShaderMaterial)&&gn.setValue(z,"isOrthographic",N.isOrthographicCamera===!0),R!==N&&(R=N,qi=!0,Nn=!0)}if(se.isSkinnedMesh){gn.setOptional(z,se,"bindMatrix"),gn.setOptional(z,se,"bindMatrixInverse");const Wn=se.skeleton;Wn&&(Ce.floatVertexTextures?(Wn.boneTexture===null&&Wn.computeBoneTexture(),gn.setValue(z,"boneTexture",Wn.boneTexture,Oe)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}se.isBatchedMesh&&(gn.setOptional(z,se,"batchingTexture"),gn.setValue(z,"batchingTexture",se._matricesTexture,Oe));const Ka=oe.morphAttributes;if((Ka.position!==void 0||Ka.normal!==void 0||Ka.color!==void 0&&Ce.isWebGL2===!0)&<.update(se,oe,an),(qi||Ge.receiveShadow!==se.receiveShadow)&&(Ge.receiveShadow=se.receiveShadow,gn.setValue(z,"receiveShadow",se.receiveShadow)),ce.isMeshGouraudMaterial&&ce.envMap!==null&&(kr.envMap.value=it,kr.flipEnvMap.value=it.isCubeTexture&&it.isRenderTargetTexture===!1?-1:1),qi&&(gn.setValue(z,"toneMappingExposure",M.toneMappingExposure),Ge.needsLights&&L0(kr,Nn),Ue&&ce.fog===!0&&xe.refreshFogUniforms(kr,Ue),xe.refreshMaterialUniforms(kr,ce,ae,re,we),Fp.upload(z,rd(Ge),kr,Oe)),ce.isShaderMaterial&&ce.uniformsNeedUpdate===!0&&(Fp.upload(z,rd(Ge),kr,Oe),ce.uniformsNeedUpdate=!1),ce.isSpriteMaterial&&gn.setValue(z,"center",se.center),gn.setValue(z,"modelViewMatrix",se.modelViewMatrix),gn.setValue(z,"normalMatrix",se.normalMatrix),gn.setValue(z,"modelMatrix",se.matrixWorld),ce.isShaderMaterial||ce.isRawShaderMaterial){const Wn=ce.uniformsGroups;for(let Ya=0,Ii=Wn.length;Ya0&&Oe.useMultisampledRTT(N)===!1?se=Ne.get(N).__webglMultisampledFramebuffer:Array.isArray(ct)?se=ct[oe]:se=ct,P.copy(N.viewport),H.copy(N.scissor),J=N.scissorTest}else P.copy(G).multiplyScalar(ae).floor(),H.copy(Y).multiplyScalar(ae).floor(),J=$;if(me.bindFramebuffer(z.FRAMEBUFFER,se)&&Ce.drawBuffers&&ce&&me.drawBuffers(N,se),me.viewport(P),me.scissor(H),me.setScissorTest(J),Ue){const it=Ne.get(N.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+Q,it.__webglTexture,oe)}else if(Ke){const it=Ne.get(N.texture),ut=Q||0;z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,it.__webglTexture,oe||0,ut)}I=-1},this.readRenderTargetPixels=function(N,Q,oe,ce,se,Ue,Ke){if(!(N&&N.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let tt=Ne.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&Ke!==void 0&&(tt=tt[Ke]),tt){me.bindFramebuffer(z.FRAMEBUFFER,tt);try{const it=N.texture,ut=it.format,ct=it.type;if(ut!==vi&&Ft.convert(ut)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ft=ct===pc&&(he.has("EXT_color_buffer_half_float")||Ce.isWebGL2&&he.has("EXT_color_buffer_float"));if(ct!==$r&&Ft.convert(ct)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ct===Rr&&(Ce.isWebGL2||he.has("OES_texture_float")||he.has("WEBGL_color_buffer_float")))&&!ft){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Q>=0&&Q<=N.width-ce&&oe>=0&&oe<=N.height-se&&z.readPixels(Q,oe,ce,se,Ft.convert(ut),Ft.convert(ct),Ue)}finally{const it=B!==null?Ne.get(B).__webglFramebuffer:null;me.bindFramebuffer(z.FRAMEBUFFER,it)}}},this.copyFramebufferToTexture=function(N,Q,oe=0){const ce=Math.pow(2,-oe),se=Math.floor(Q.image.width*ce),Ue=Math.floor(Q.image.height*ce);Oe.setTexture2D(Q,0),z.copyTexSubImage2D(z.TEXTURE_2D,oe,0,0,N.x,N.y,se,Ue),me.unbindTexture()},this.copyTextureToTexture=function(N,Q,oe,ce=0){const se=Q.image.width,Ue=Q.image.height,Ke=Ft.convert(oe.format),tt=Ft.convert(oe.type);Oe.setTexture2D(oe,0),z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,oe.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,oe.unpackAlignment),Q.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,ce,N.x,N.y,se,Ue,Ke,tt,Q.image.data):Q.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,ce,N.x,N.y,Q.mipmaps[0].width,Q.mipmaps[0].height,Ke,Q.mipmaps[0].data):z.texSubImage2D(z.TEXTURE_2D,ce,N.x,N.y,Ke,tt,Q.image),ce===0&&oe.generateMipmaps&&z.generateMipmap(z.TEXTURE_2D),me.unbindTexture()},this.copyTextureToTexture3D=function(N,Q,oe,ce,se=0){if(M.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ue=N.max.x-N.min.x+1,Ke=N.max.y-N.min.y+1,tt=N.max.z-N.min.z+1,it=Ft.convert(ce.format),ut=Ft.convert(ce.type);let ct;if(ce.isData3DTexture)Oe.setTexture3D(ce,0),ct=z.TEXTURE_3D;else if(ce.isDataArrayTexture)Oe.setTexture2DArray(ce,0),ct=z.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,ce.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ce.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,ce.unpackAlignment);const ft=z.getParameter(z.UNPACK_ROW_LENGTH),$t=z.getParameter(z.UNPACK_IMAGE_HEIGHT),Vn=z.getParameter(z.UNPACK_SKIP_PIXELS),Xt=z.getParameter(z.UNPACK_SKIP_ROWS),Dn=z.getParameter(z.UNPACK_SKIP_IMAGES),rt=oe.isCompressedTexture?oe.mipmaps[0]:oe.image;z.pixelStorei(z.UNPACK_ROW_LENGTH,rt.width),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,rt.height),z.pixelStorei(z.UNPACK_SKIP_PIXELS,N.min.x),z.pixelStorei(z.UNPACK_SKIP_ROWS,N.min.y),z.pixelStorei(z.UNPACK_SKIP_IMAGES,N.min.z),oe.isDataTexture||oe.isData3DTexture?z.texSubImage3D(ct,se,Q.x,Q.y,Q.z,Ue,Ke,tt,it,ut,rt.data):oe.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),z.compressedTexSubImage3D(ct,se,Q.x,Q.y,Q.z,Ue,Ke,tt,it,rt.data)):z.texSubImage3D(ct,se,Q.x,Q.y,Q.z,Ue,Ke,tt,it,ut,rt),z.pixelStorei(z.UNPACK_ROW_LENGTH,ft),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,$t),z.pixelStorei(z.UNPACK_SKIP_PIXELS,Vn),z.pixelStorei(z.UNPACK_SKIP_ROWS,Xt),z.pixelStorei(z.UNPACK_SKIP_IMAGES,Dn),se===0&&ce.generateMipmaps&&z.generateMipmap(ct),me.unbindTexture()},this.initTexture=function(N){N.isCubeTexture?Oe.setTextureCube(N,0):N.isData3DTexture?Oe.setTexture3D(N,0):N.isDataArrayTexture||N.isCompressedArrayTexture?Oe.setTexture2DArray(N,0):Oe.setTexture2D(N,0),me.unbindTexture()},this.resetState=function(){T=0,b=0,B=null,me.reset(),dt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return br}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===t0?"display-p3":"srgb",t.unpackColorSpace=Ut.workingColorSpace===Gf?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Rn?Ro:A_}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Ro?Rn:rs}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class xR extends L_{}xR.prototype.isWebGL1Renderer=!0;class r0{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Pe(e),this.density=t}clone(){return new r0(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class s0{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Pe(e),this.near=t,this.far=i}clone(){return new s0(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class vm extends wt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class jf{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Af,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Xi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:mu.clone(),uv:Ti.getInterpolation(mu,Oh,vu,kh,eE,Nv,tE,new pe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Hh(n,e,t,i,r,s){Tl.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(gu.x=s*Tl.x-r*Tl.y,gu.y=r*Tl.x+s*Tl.y):gu.copy(Tl),n.copy(e),n.x+=gu.x,n.y+=gu.y,n.applyMatrix4(AR)}const Gh=new F,nE=new F;class MR extends wt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){Gh.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Gh);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Gh.setFromMatrixPosition(e.matrixWorld),nE.setFromMatrixPosition(this.matrixWorld);const i=Gh.distanceTo(nE)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=i.length&&i.push({start:-1,count:-1,z:-1});const s=i[this.index];r.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t}reset(){this.list.length=0,this.index=0}}const bl="batchId",$s=new $e,fE=new $e,j8=new $e,dE=new $e,Ov=new Xf,Wh=new li,ta=new Yn,xu=new F,kv=new J8,si=new En,Xh=[];function K8(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65536?new Uint32Array(s):new Uint16Array(s);t.setIndex(new Bt(a,1))}const o=r>65536?new Uint32Array(i):new Uint16Array(i);t.setAttribute(bl,new Bt(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(bl))throw new Error(`BatchedMesh: Geometry cannot use attribute "${bl}"`);const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(i===bl)continue;if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new li);const e=this._geometryCount,t=this.boundingBox,i=this._active;t.makeEmpty();for(let r=0;r=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const f=e.getIndex(),d=f!==null;if(d&&(i===-1?r.indexCount=f.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,p=this._active,v=this._matricesTexture,y=this._matricesTexture.image.data;h.push(!0),p.push(!0);const S=this._geometryCount;this._geometryCount++,j8.toArray(y,S*16),v.needsUpdate=!0,o.push(r),a.push({start:d?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new li,sphereInitialized:!1,sphere:new Yn});const x=this.geometry.getAttribute(bl);for(let m=0;m=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,f=a.vertexCount;for(const v in i.attributes){if(v===bl)continue;const y=t.getAttribute(v),S=i.getAttribute(v);K8(y,S,l);const x=y.itemSize;for(let m=y.count,A=f;m=t.length||t[e]===!1?this:(t[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(this._active[e]===!1)return this;const r=this._bounds[e],s=r.box,o=this.geometry;if(r.boxInitialized===!1){s.makeEmpty();const a=o.index,l=o.attributes.position,f=this._drawRanges[e];for(let d=f.start,h=f.start+f.count;d=o||i[e]===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._active,r=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||i[e]===!1?null:t.fromArray(r,e*16)}setVisibleAt(e,t){const i=this._visibility,r=this._active,s=this._geometryCount;return e>=s||r[e]===!1||i[e]===t?this:(i[e]=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._visibility,i=this._active,r=this._geometryCount;return e>=r||i[e]===!1?!1:t[e]}raycast(e,t){const i=this._visibility,r=this._active,s=this._drawRanges,o=this._geometryCount,a=this.matrixWorld,l=this.geometry;si.material=this.material,si.geometry.index=l.index,si.geometry.attributes=l.attributes,si.geometry.boundingBox===null&&(si.geometry.boundingBox=new li),si.geometry.boundingSphere===null&&(si.geometry.boundingSphere=new Yn);for(let f=0;f({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._visibility,f=this._multiDrawStarts,d=this._multiDrawCounts,h=this._drawRanges,p=this.perObjectFrustumCulled;p&&(dE.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),Ov.setFromProjectionMatrix(dE,e.isWebGPURenderer?gc:br));let v=0;if(this.sortObjects){fE.copy(this.matrixWorld).invert(),xu.setFromMatrixPosition(i.matrixWorld).applyMatrix4(fE);for(let x=0,m=l.length;xl)continue;p.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(p);Ie.far||t.push({distance:I,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),A=Math.min(x.count,o.start+o.count);for(let M=m,w=A-1;Ml)continue;p.applyMatrix4(this.matrixWorld);const b=e.ray.origin.distanceTo(p);be.far||t.push({distance:b,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:f,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class Y8 extends qt{constructor(e,t,i,r,s,o,a,l,f){super(e,t,i,r,s,o,a,l,f),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:nn,this.magFilter=s!==void 0?s:nn,this.generateMipmaps=!1;const d=this;function h(){d.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Q8 extends qt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=fn,this.minFilter=fn,this.generateMipmaps=!1,this.needsUpdate=!0}}class l0 extends qt{constructor(e,t,i,r,s,o,a,l,f,d,h,p){super(null,o,a,l,f,d,r,s,h,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Z8 extends l0{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=jn}}class q8 extends l0{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Is),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class $8 extends qt{constructor(e,t,i,r,s,o,a,l,f){super(e,t,i,r,s,o,a,l,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Fr{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,f;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),f=i[r]-o,f<0)a=r+1;else if(f>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const d=i[r],p=i[r+1]-d,v=(o-d)/p;return(r+v)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new pe:new F);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new F,r=[],s=[],o=[],a=new F,l=new $e;for(let v=0;v<=e;v++){const y=v/e;r[v]=this.getTangentAt(y,new F)}s[0]=new F,o[0]=new F;let f=Number.MAX_VALUE;const d=Math.abs(r[0].x),h=Math.abs(r[0].y),p=Math.abs(r[0].z);d<=f&&(f=d,i.set(1,0,0)),h<=f&&(f=h,i.set(0,1,0)),p<=f&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let v=1;v<=e;v++){if(s[v]=s[v-1].clone(),o[v]=o[v-1].clone(),a.crossVectors(r[v-1],r[v]),a.length()>Number.EPSILON){a.normalize();const y=Math.acos(dn(r[v-1].dot(r[v]),-1,1));s[v].applyMatrix4(l.makeRotationAxis(a,y))}o[v].crossVectors(r[v],s[v])}if(t===!0){let v=Math.acos(dn(s[0].dot(s[e]),-1,1));v/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(v=-v);for(let y=1;y<=e;y++)s[y].applyMatrix4(l.makeRotationAxis(r[y],v*y)),o[y].crossVectors(r[y],s[y])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class c0 extends Fr{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const i=t||new pe,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let f,d;this.closed||a>0?f=r[(a-1)%s]:(Yh.subVectors(r[0],r[1]).add(r[0]),f=Yh);const h=r[a%s],p=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(xE(a,l.x,f.x,d.x,h.x),xE(a,l.y,f.y,d.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),f=l===0?0:1-o/l;return a.getPointAt(f,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const h=f.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(f);const d=f.getPoint(1);return this.currentPoint.copy(d),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Yf extends mt{constructor(e=[new pe(0,-.5),new pe(.5,0),new pe(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=dn(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],f=[],d=1/t,h=new F,p=new pe,v=new F,y=new F,S=new F;let x=0,m=0;for(let A=0;A<=e.length-1;A++)switch(A){case 0:x=e[A+1].x-e[A].x,m=e[A+1].y-e[A].y,v.x=m*1,v.y=-x,v.z=m*0,S.copy(v),v.normalize(),l.push(v.x,v.y,v.z);break;case e.length-1:l.push(S.x,S.y,S.z);break;default:x=e[A+1].x-e[A].x,m=e[A+1].y-e[A].y,v.x=m*1,v.y=-x,v.z=m*0,y.copy(v),v.x+=S.x,v.y+=S.y,v.z+=S.z,v.normalize(),l.push(v.x,v.y,v.z),S.copy(y)}for(let A=0;A<=t;A++){const M=i+A*d*r,w=Math.sin(M),T=Math.cos(M);for(let b=0;b<=e.length-1;b++){h.x=e[b].x*w,h.y=e[b].y,h.z=e[b].x*T,o.push(h.x,h.y,h.z),p.x=A/t,p.y=b/(e.length-1),a.push(p.x,p.y);const B=l[3*b+0]*w,I=l[3*b+1],R=l[3*b+0]*T;f.push(B,I,R)}}for(let A=0;A0&&M(!0),t>0&&M(!1)),this.setIndex(d),this.setAttribute("position",new We(h,3)),this.setAttribute("normal",new We(p,3)),this.setAttribute("uv",new We(v,2));function A(){const w=new F,T=new F;let b=0;const B=(t-e)/i;for(let I=0;I<=s;I++){const R=[],P=I/s,H=P*(t-e)+e;for(let J=0;J<=r;J++){const te=J/r,V=te*l+a,q=Math.sin(V),re=Math.cos(V);T.x=H*q,T.y=-P*i+x,T.z=H*re,h.push(T.x,T.y,T.z),w.set(q,B,re).normalize(),p.push(w.x,w.y,w.z),v.push(te,1-P),R.push(y++)}S.push(R)}for(let I=0;I.9&&B<.1&&(M<.2&&(o[A+0]+=1),w<.2&&(o[A+2]+=1),T<.2&&(o[A+4]+=1))}}function p(A){s.push(A.x,A.y,A.z)}function v(A,M){const w=A*3;M.x=e[w+0],M.y=e[w+1],M.z=e[w+2]}function y(){const A=new F,M=new F,w=new F,T=new F,b=new pe,B=new pe,I=new pe;for(let R=0,P=0;R80*t){a=f=n[0],l=d=n[1];for(let y=t;yf&&(f=h),p>d&&(d=p);v=Math.max(f-a,d-l),v=v!==0?32767/v:0}return Ef(s,o,t,a,l,v,0),o}};function PR(n,e,t,i,r){let s,o;if(r===M9(n,e,t,i)>0)for(s=e;s=e;s-=i)o=AE(s,n[s],n[s+1],o);return o&&p0(o,o.next)&&(Cf(o),o=o.next),o}function Fa(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(p0(t,t.next)||rn(t.prev,t,t.next)===0)){if(Cf(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Ef(n,e,t,i,r,s,o){if(!n)return;!o&&s&&v9(n,i,r,s);let a=n,l,f;for(;n.prev!==n.next;){if(l=n.prev,f=n.next,s?c9(n,i,r,s):l9(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(f.i/t|0),Cf(n),n=f.next,a=f.next;continue}if(n=f,n===a){o?o===1?(n=u9(Fa(n),e,t),Ef(n,e,t,i,r,s,2)):o===2&&f9(n,e,t,i,r,s):Ef(Fa(n),e,t,i,r,s,1);break}}}function l9(n){const e=n.prev,t=n,i=n.next;if(rn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,f=i.y,d=rs?r>o?r:o:s>o?s:o,v=a>l?a>f?a:f:l>f?l:f;let y=i.next;for(;y!==e;){if(y.x>=d&&y.x<=p&&y.y>=h&&y.y<=v&&Kl(r,a,s,l,o,f,y.x,y.y)&&rn(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function c9(n,e,t,i){const r=n.prev,s=n,o=n.next;if(rn(r,s,o)>=0)return!1;const a=r.x,l=s.x,f=o.x,d=r.y,h=s.y,p=o.y,v=al?a>f?a:f:l>f?l:f,x=d>h?d>p?d:p:h>p?h:p,m=Q2(v,y,e,t,i),A=Q2(S,x,e,t,i);let M=n.prevZ,w=n.nextZ;for(;M&&M.z>=m&&w&&w.z<=A;){if(M.x>=v&&M.x<=S&&M.y>=y&&M.y<=x&&M!==r&&M!==o&&Kl(a,d,l,h,f,p,M.x,M.y)&&rn(M.prev,M,M.next)>=0||(M=M.prevZ,w.x>=v&&w.x<=S&&w.y>=y&&w.y<=x&&w!==r&&w!==o&&Kl(a,d,l,h,f,p,w.x,w.y)&&rn(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;M&&M.z>=m;){if(M.x>=v&&M.x<=S&&M.y>=y&&M.y<=x&&M!==r&&M!==o&&Kl(a,d,l,h,f,p,M.x,M.y)&&rn(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;w&&w.z<=A;){if(w.x>=v&&w.x<=S&&w.y>=y&&w.y<=x&&w!==r&&w!==o&&Kl(a,d,l,h,f,p,w.x,w.y)&&rn(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function u9(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!p0(r,s)&&LR(r,i,i.next,s)&&wf(r,s)&&wf(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Cf(i),Cf(i.next),i=n=s),i=i.next}while(i!==n);return Fa(i)}function f9(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&x9(o,a)){let l=IR(o,a);o=Fa(o,o.next),l=Fa(l,l.next),Ef(o,e,t,i,r,s,0),Ef(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function d9(n,e,t,i){const r=[];let s,o,a,l,f;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x=t.x&&t.x>=l&&s!==t.x&&Kl(or.x||t.x===r.x&&g9(r,t)))&&(r=t,d=h)),t=t.next;while(t!==a);return r}function g9(n,e){return rn(n.prev,n,e.prev)<0&&rn(e.next,n,n.next)<0}function v9(n,e,t,i){let r=n;do r.z===0&&(r.z=Q2(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,y9(r)}function y9(n){let e,t,i,r,s,o,a,l,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,f*=2}while(o>1);return n}function Q2(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function _9(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function x9(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!A9(n,e)&&(wf(n,e)&&wf(e,n)&&S9(n,e)&&(rn(n.prev,n,e.prev)||rn(n,e.prev,e))||p0(n,e)&&rn(n.prev,n,n.next)>0&&rn(e.prev,e,e.next)>0)}function rn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function p0(n,e){return n.x===e.x&&n.y===e.y}function LR(n,e,t,i){const r=ep(rn(n,e,t)),s=ep(rn(n,e,i)),o=ep(rn(t,i,n)),a=ep(rn(t,i,e));return!!(r!==s&&o!==a||r===0&&$h(n,t,e)||s===0&&$h(n,i,e)||o===0&&$h(t,n,i)||a===0&&$h(t,e,i))}function $h(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function ep(n){return n>0?1:n<0?-1:0}function A9(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&LR(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function wf(n,e){return rn(n.prev,n,n.next)<0?rn(n,e,n.next)>=0&&rn(n,n.prev,e)>=0:rn(n,e,n.prev)<0||rn(n,n.next,e)<0}function S9(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function IR(n,e){const t=new Z2(n.i,n.x,n.y),i=new Z2(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function AE(n,e,t,i){const r=new Z2(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Cf(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 Z2(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M9(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function ME(n,e){for(let t=0;tNumber.EPSILON){const L=Math.sqrt(Wt),ie=Math.sqrt(et*et+Mt*Mt),xe=ye.x-Oe/L,ve=ye.y+Ne/L,Ae=he.x-Mt/ie,Je=he.y+et/ie,Te=((Ae-xe)*Mt-(Je-ve)*et)/(Ne*Mt-Oe*et);Ce=xe+Ne*Te-z.x,me=ve+Oe*Te-z.y;const Ie=Ce*Ce+me*me;if(Ie<=2)return new pe(Ce,me);Qe=Math.sqrt(Ie/2)}else{let L=!1;Ne>Number.EPSILON?et>Number.EPSILON&&(L=!0):Ne<-Number.EPSILON?et<-Number.EPSILON&&(L=!0):Math.sign(Oe)===Math.sign(Mt)&&(L=!0),L?(Ce=-Oe,me=Ne,Qe=Math.sqrt(Wt)):(Ce=Ne,me=Oe,Qe=Math.sqrt(Wt/2))}return new pe(Ce/Qe,me/Qe)}const k=[];for(let z=0,ye=V.length,he=ye-1,Ce=z+1;z=0;z--){const ye=z/x,he=v*Math.cos(ye*Math.PI/2),Ce=y*Math.sin(ye*Math.PI/2)+S;for(let me=0,Qe=V.length;me=0;){const Ce=he;let me=he-1;me<0&&(me=z.length-1);for(let Qe=0,Ne=d+x*2;Qe0)&&v.push(M,w,b),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class UR extends wn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Pe(16777215),this.specular=new Pe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ko,this.normalScale=new pe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Hf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class OR extends wn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Pe(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ko,this.normalScale=new pe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class kR extends wn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ko,this.normalScale=new pe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class HR extends wn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Pe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ko,this.normalScale=new pe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Hf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class GR extends wn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Pe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ko,this.normalScale=new pe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class zR extends ui{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function xa(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function VR(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function WR(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function q2(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function W_(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function T9(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){h.push(f.times[v]);for(let S=0;Ss.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[y]){const m=y*h+d,A=m+h-d;S=a.values.slice(m,A)}else{const m=a.createInterpolant(),A=d,M=h-d;m.evaluate(s),S=m.resultBuffer.slice(A,M)}l==="quaternion"&&new ai().fromArray(S).normalize().conjugate().toArray(S);const x=f.times.length;for(let m=0;m=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&VR(r))for(let a=0,l=r.length;a!==l;++a){const f=r[a];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,f),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Np,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,f=0;f!==i;++f)t[l+f]=t[a+f];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Ur.prototype.TimeBufferType=Float32Array;Ur.prototype.ValueBufferType=Float32Array;Ur.prototype.DefaultInterpolation=Na;class Va extends Ur{}Va.prototype.ValueTypeName="bool";Va.prototype.ValueBufferType=Array;Va.prototype.DefaultInterpolation=mc;Va.prototype.InterpolantFactoryMethodLinear=void 0;Va.prototype.InterpolantFactoryMethodSmooth=void 0;class J_ extends Ur{}J_.prototype.ValueTypeName="color";class xc extends Ur{}xc.prototype.ValueTypeName="number";class jR extends Nc{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let f=e*a;for(let d=f+a;f!==d;f+=4)ai.slerpFlat(s,0,o,f-a,o,f,l);return s}}class No extends Ur{InterpolantFactoryMethodLinear(e){return new jR(this.times,this.values,this.getValueSize(),e)}}No.prototype.ValueTypeName="quaternion";No.prototype.DefaultInterpolation=Na;No.prototype.InterpolantFactoryMethodSmooth=void 0;class Wa extends Ur{}Wa.prototype.ValueTypeName="string";Wa.prototype.ValueBufferType=Array;Wa.prototype.DefaultInterpolation=mc;Wa.prototype.InterpolantFactoryMethodLinear=void 0;Wa.prototype.InterpolantFactoryMethodSmooth=void 0;class Ac extends Ur{}Ac.prototype.ValueTypeName="vector";class Sc{constructor(e,t=-1,i,r=e0){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Xi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(P9(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Ur.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const h=d[1];let p=r[h];p||(r[h]=p=[]),p.push(f)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,p,v,y,S){if(v.length!==0){const x=[],m=[];W_(v,x,m,y),x.length!==0&&S.push(new h(p,x,m))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const f=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(ys[e]!==void 0){ys[e].push({onLoad:t,onProgress:i,onError:r});return}ys[e]=[],ys[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;const d=ys[e],h=f.body.getReader(),p=f.headers.get("Content-Length")||f.headers.get("X-File-Size"),v=p?parseInt(p):0,y=v!==0;let S=0;const x=new ReadableStream({start(m){A();function A(){h.read().then(({done:M,value:w})=>{if(M)m.close();else{S+=w.byteLength;const T=new ProgressEvent("progress",{lengthComputable:y,loaded:S,total:v});for(let b=0,B=d.length;b{switch(l){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return f.json();default:if(a===void 0)return f.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),p=h&&h[1]?h[1].toLowerCase():void 0,v=new TextDecoder(p);return f.arrayBuffer().then(y=>v.decode(y))}}}).then(f=>{Ua.add(e,f);const d=ys[e];delete ys[e];for(let h=0,p=d.length;h{const d=ys[e];if(d===void 0)throw this.manager.itemError(e),f;delete ys[e];for(let h=0,p=d.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class I9 extends fi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new ji(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Pe().setHex(o.value);break;case"v2":r.uniforms[s].value=new pe().fromArray(o.value);break;case"v3":r.uniforms[s].value=new F().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Ot().fromArray(o.value);break;case"m3":r.uniforms[s].value=new _t().fromArray(o.value);break;case"m4":r.uniforms[s].value=new $e().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new pe().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new pe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:NR,SpriteMaterial:I_,RawShaderMaterial:FR,ShaderMaterial:ss,PointsMaterial:a0,MeshPhysicalMaterial:os,MeshStandardMaterial:qf,MeshPhongMaterial:UR,MeshToonMaterial:OR,MeshNormalMaterial:kR,MeshLambertMaterial:HR,MeshDepthMaterial:B_,MeshDistanceMaterial:P_,MeshBasicMaterial:Vi,MeshMatcapMaterial:GR,LineDashedMaterial:zR,LineBasicMaterial:ui,Material:wn};return new t[e]}}class ts{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new j_(t);s=new Tf(l),s.setCrossOrigin(this.crossOrigin);for(let f=0,d=e.length;f0){r=new Tf(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const x=new li;x.min.fromArray(S.boxMin),x.max.fromArray(S.boxMax);const m=new Yn;return m.radius=S.sphereRadius,m.center.fromArray(S.sphereCenter),{boxInitialized:S.boxInitialized,box:x,sphereInitialized:S.sphereInitialized,sphere:m}}),o._maxGeometryCount=e.maxGeometryCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=f(e.matricesTexture.uuid);break;case"LOD":o=new MR;break;case"Line":o=new Ds(a(e.geometry),l(e.material));break;case"LineLoop":o=new F_(a(e.geometry),l(e.material));break;case"LineSegments":o=new Nr(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new U_(a(e.geometry),l(e.material));break;case"Sprite":o=new SR(l(e.material));break;case"Group":o=new ws;break;case"Bone":o=new o0;break;default:o=new wt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let v=0;v"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Ua.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){Ua.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){r&&r(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}let tp;class q_{static getContext(){return tp===void 0&&(tp=new(window.AudioContext||window.webkitAudioContext)),tp}static setContext(e){tp=e}}class z9 extends fi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new ji(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const f=l.slice(0);q_.getContext().decodeAudioData(f,function(h){t(h)}).catch(a)}catch(f){a(f)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const PE=new $e,LE=new $e,na=new $e;class V9{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new bn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new bn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,na.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(wa*t.fov*.5)/t.zoom;let a,l;LE.elements[12]=-r,PE.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,na.elements[0]=2*t.near/(l-a),na.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(na),a=-o*t.aspect-s,l=o*t.aspect-s,na.elements[0]=2*t.near/(l-a),na.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(na)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(LE),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(PE)}}class $_{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=IE(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=IE();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function IE(){return(typeof performance>"u"?Date:performance).now()}const ia=new F,DE=new ai,W9=new F,ra=new F;class X9 extends wt{constructor(){super(),this.type="AudioListener",this.context=q_.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new $_}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(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ia,DE,W9),ra.set(0,0,-1).applyQuaternion(DE),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ia.x,r),t.positionY.linearRampToValueAtTime(ia.y,r),t.positionZ.linearRampToValueAtTime(ia.z,r),t.forwardX.linearRampToValueAtTime(ra.x,r),t.forwardY.linearRampToValueAtTime(ra.y,r),t.forwardZ.linearRampToValueAtTime(ra.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(ia.x,ia.y,ia.z),t.setOrientation(ra.x,ra.y,ra.z,i.x,i.y,i.z)}}class rb extends wt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(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+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,f=t+t;l!==f;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){ai.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;ai.multiplyQuaternionsFlat(e,o,e,t,e,i),ai.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const ex="\\[\\]\\.:\\/",Y9=new RegExp("["+ex+"]","g"),tx="[^"+ex+"]",Q9="[^"+ex.replace("\\.","")+"]",Z9=/((?:WC+[\/:])*)/.source.replace("WC",tx),q9=/(WCOD+)?/.source.replace("WCOD",Q9),$9=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",tx),eO=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",tx),tO=new RegExp("^"+Z9+q9+$9+eO+"$"),nO=["material","materials","bones","map"];class iO{constructor(e,t,i){const r=i||Rt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Rt{constructor(e,t,i){this.path=t,this.parsedPath=i||Rt.parseTrackName(t),this.node=Rt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Rt.Composite(e,t,i):new Rt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Y9,"")}static parseTrackName(e){const t=tO.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);nO.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const h=s++,p=e[h];t[p.uuid]=d,e[d]=p,t[f]=h,e[h]=l;for(let v=0,y=r;v!==y;++v){const S=i[v],x=S[h],m=S[d];S[d]=x,S[h]=m}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const f=arguments[a],d=f.uuid,h=t[d];if(h!==void 0)if(delete t[d],h0&&(t[v.uuid]=h),e[h]=v,e.pop();for(let y=0,S=r;y!==S;++y){const x=i[y];x[h]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,f=l.length,d=this.nCachedObjects_,h=new Array(f);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(h);for(let p=d,v=l.length;p!==v;++p){const y=l[p];h[p]=new Rt(y,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],f=e[a];t[f]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class ob{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:va,endingEnd:va};for(let f=0;f!==o;++f){const d=s[f].createInterpolant(null);a[f]=d,d.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=WT,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(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,f=a.sampleValues;return l[0]=s,l[1]=s+i,f[0]=e/o,f[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case __:for(let d=0,h=l.length;d!==h;++d)l[d].evaluate(o),f[d].accumulateAdditive(a);break;case e0:default:for(let d=0,h=l.length;d!==h;++d)l[d].evaluate(o),f[d].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===XT;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===VT){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=ya,r.endingEnd=ya):(e?r.endingStart=this.zeroSlopeAtStart?ya:va:r.endingStart=vf,t?r.endingEnd=this.zeroSlopeAtEnd?ya:va:r.endingEnd=vf)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const sO=new Float32Array(1);class ab extends Fs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,f=this._bindingsByRootAndName;let d=f[l];d===void 0&&(d={},f[l]=d);for(let h=0;h!==s;++h){const p=r[h],v=p.name;let y=d[v];if(y!==void 0)++y.referenceCount,o[h]=y;else{if(y=o[h],y!==void 0){y._cacheIndex===null&&(++y.referenceCount,this._addInactiveBinding(y,l,v));continue}const S=t&&t._propertyBindings[h].binding.parsedPath;y=new sb(Rt.create(i,v,S),p.ValueTypeName,p.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,l,v),o[h]=y}a[h].resultBuffer=y.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let f=0;f!==i;++f)t[f]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let f=0;f!==l;++f)a[f].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,UE).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const OE=new F,np=new F;class hO{constructor(e=new F,t=new F){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){OE.subVectors(e,this.start),np.subVectors(this.end,this.start);const i=np.dot(np);let s=np.dot(OE)/i;return t&&(s=dn(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const kE=new F;class pO extends wt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new mt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{WE.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(WE,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class TO extends Nr{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new mt;r.setAttribute("position",new We(t,3)),r.setAttribute("color",new We(i,3));const s=new ui({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Pe,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class RO{constructor(){this.type="ShapePath",this.color=new Pe,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Mf,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const A=[];for(let M=0,w=m.length;MNumber.EPSILON){if(P<0&&(B=A[b],R=-R,I=A[T],P=-P),m.yI.y)continue;if(m.y===B.y){if(m.x===B.x)return!0}else{const H=P*(m.x-B.x)-R*(m.y-B.y);if(H===0)return!0;if(H<0)continue;w=!w}}else{if(m.y!==B.y)continue;if(I.x<=m.x&&m.x<=B.x||B.x<=m.x&&m.x<=I.x)return!0}}return w}const r=es.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const f=[];if(s.length===1)return a=s[0],l=new Ra,l.curves=a.curves,f.push(l),f;let d=!r(s[0].getPoints());d=e?!d:d;const h=[],p=[];let v=[],y=0,S;p[y]=void 0,v[y]=[];for(let m=0,A=s.length;m1){let m=!1,A=0;for(let M=0,w=p.length;M0&&m===!1&&(v=h)}let x;for(let m=0,A=p.length;m{const h=typeof f=="function"?f(e):f;if(h!==e){const p=e;e=d?h:Object.assign({},e,h),t.forEach(v=>v(e,p))}},r=()=>e,s=(f,d=r,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=d(e);function v(){const y=d(e);if(!h(p,y)){const S=p;f(p=y,S)}}return t.add(v),()=>t.delete(v)},l={setState:i,getState:r,subscribe:(f,d,h)=>d||h?s(f,d,h):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=n(i,r,l),l}const BO=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),XE=BO?j.useEffect:j.useLayoutEffect;function PO(n){const e=typeof n=="function"?bO(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=j.useReducer(x=>x+1,0),o=e.getState(),a=j.useRef(o),l=j.useRef(i),f=j.useRef(r),d=j.useRef(!1),h=j.useRef();h.current===void 0&&(h.current=i(o));let p,v=!1;(a.current!==o||l.current!==i||f.current!==r||d.current)&&(p=i(o),v=!r(h.current,p)),XE(()=>{v&&(h.current=p),a.current=o,l.current=i,f.current=r,d.current=!1});const y=j.useRef(o);XE(()=>{const x=()=>{try{const A=e.getState(),M=l.current(A);f.current(h.current,M)||(a.current=A,h.current=M,s())}catch{d.current=!0,s()}},m=e.subscribe(x);return e.getState()!==y.current&&x(),m},[]);const S=v?p:h.current;return j.useDebugValue(S),S};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}var db={exports:{}},Yv={exports:{}},Qv={};/** + * @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. + */var JE;function LO(){return JE||(JE=1,function(n){function e(D,k){var G=D.length;D.push(k);e:for(;0>>1,$=D[Y];if(0>>1;Yr(ge,G))we<$&&0>r(Re,ge)?(D[Y]=Re,D[we]=G,Y=we):(D[Y]=ge,D[ue]=G,Y=ue);else if(we<$&&0>r(Re,G))D[Y]=Re,D[we]=G,Y=we;else break e}}return k}function r(D,k){var G=D.sortIndex-k.sortIndex;return G!==0?G:D.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],f=[],d=1,h=null,p=3,v=!1,y=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(D){for(var k=t(f);k!==null;){if(k.callback===null)i(f);else if(k.startTime<=D)i(f),k.sortIndex=k.expirationTime,e(l,k);else break;k=t(f)}}function w(D){if(S=!1,M(D),!y)if(t(l)!==null)y=!0,re(T);else{var k=t(f);k!==null&&ae(w,k.startTime-D)}}function T(D,k){y=!1,S&&(S=!1,m(I),I=-1),v=!0;var G=p;try{for(M(k),h=t(l);h!==null&&(!(h.expirationTime>k)||D&&!H());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,p=h.priorityLevel;var $=Y(h.expirationTime<=k);k=n.unstable_now(),typeof $=="function"?h.callback=$:h===t(l)&&i(l),M(k)}else i(l);h=t(l)}if(h!==null)var Z=!0;else{var ue=t(f);ue!==null&&ae(w,ue.startTime-k),Z=!1}return Z}finally{h=null,p=G,v=!1}}var b=!1,B=null,I=-1,R=5,P=-1;function H(){return!(n.unstable_now()-PD||125Y?(D.sortIndex=G,e(f,D),t(l)===null&&D===t(f)&&(S?(m(I),I=-1):S=!0,ae(w,G-Y))):(D.sortIndex=$,e(l,D),y||v||(y=!0,re(T))),D},n.unstable_shouldYield=H,n.unstable_wrapCallback=function(D){var k=p;return function(){var G=p;p=k;try{return D.apply(this,arguments)}finally{p=G}}}}(Qv)),Qv}var jE;function IO(){return jE||(jE=1,Yv.exports=LO()),Yv.exports}/** + * @license React + * react-reconciler.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 DO=function(e){var t={},i=j,r=IO(),s=Object.assign;function o(c){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+c,g=1;gX||E[U]!==C[X]){var fe=` +`+E[U].replace(" at new "," at ");return c.displayName&&fe.includes("")&&(fe=fe.replace("",c.displayName)),fe}while(1<=U&&0<=X);break}}}finally{ct=!1,Error.prepareStackTrace=g}return(c=c?c.displayName||c.name:"")?ut(c):""}var $t=Object.prototype.hasOwnProperty,Vn=[],Xt=-1;function Dn(c){return{current:c}}function rt(c){0>Xt||(c.current=Vn[Xt],Vn[Xt]=null,Xt--)}function Ge(c,u){Xt++,Vn[Xt]=c.current,c.current=u}var Zi={},xt=Dn(Zi),an=Dn(!1),Or=Zi;function qi(c,u){var g=c.type.contextTypes;if(!g)return Zi;var _=c.stateNode;if(_&&_.__reactInternalMemoizedUnmaskedChildContext===u)return _.__reactInternalMemoizedMaskedChildContext;var E={},C;for(C in g)E[C]=u[C];return _&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=u,c.__reactInternalMemoizedMaskedChildContext=E),E}function Nn(c){return c=c.childContextTypes,c!=null}function gn(){rt(an),rt(xt)}function kr(c,u,g){if(xt.current!==Zi)throw Error(o(168));Ge(xt,u),Ge(an,g)}function Ka(c,u,g){var _=c.stateNode;if(u=u.childContextTypes,typeof _.getChildContext!="function")return g;_=_.getChildContext();for(var E in _)if(!(E in u))throw Error(o(108,I(c)||"Unknown",E));return s({},g,_)}function Wn(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Zi,Or=xt.current,Ge(xt,c),Ge(an,an.current),!0}function Ya(c,u,g){var _=c.stateNode;if(!_)throw Error(o(169));g?(c=Ka(c,u,Or),_.__reactInternalMemoizedMergedChildContext=c,rt(an),rt(xt),Ge(xt,c)):rt(an),Ge(an,g)}var Ii=Math.clz32?Math.clz32:SB,od=Math.log,AB=Math.LN2;function SB(c){return c>>>=0,c===0?32:31-(od(c)/AB|0)|0}var ad=64,ld=4194304;function Oc(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function cd(c,u){var g=c.pendingLanes;if(g===0)return 0;var _=0,E=c.suspendedLanes,C=c.pingedLanes,U=g&268435455;if(U!==0){var X=U&~E;X!==0?_=Oc(X):(C&=U,C!==0&&(_=Oc(C)))}else U=g&~E,U!==0?_=Oc(U):C!==0&&(_=Oc(C));if(_===0)return 0;if(u!==0&&u!==_&&!(u&E)&&(E=_&-_,C=u&-u,E>=C||E===16&&(C&4194240)!==0))return u;if(_&4&&(_|=g&16),u=c.entangledLanes,u!==0)for(c=c.entanglements,u&=_;0g;g++)u.push(c);return u}function kc(c,u,g){c.pendingLanes|=u,u!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,u=31-Ii(u),c[u]=g}function wB(c,u){var g=c.pendingLanes&~u;c.pendingLanes=u,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=u,c.mutableReadLanes&=u,c.entangledLanes&=u,u=c.entanglements;var _=c.eventTimes;for(c=c.expirationTimes;0>=U,E-=U,cs=1<<32-Ii(u)+E|g<Dt?(On=pt,pt=null):On=pt.sibling;var Nt=qe(ee,pt,le[Dt],De);if(Nt===null){pt===null&&(pt=On);break}c&&pt&&Nt.alternate===null&&u(ee,pt),K=C(Nt,K,Dt),yt===null?je=Nt:yt.sibling=Nt,yt=Nt,pt=On}if(Dt===le.length)return g(ee,pt),Yt&&Vo(ee,Dt),je;if(pt===null){for(;DtDt?(On=pt,pt=null):On=pt.sibling;var Js=qe(ee,pt,Nt.value,De);if(Js===null){pt===null&&(pt=On);break}c&&pt&&Js.alternate===null&&u(ee,pt),K=C(Js,K,Dt),yt===null?je=Js:yt.sibling=Js,yt=Js,pt=On}if(Nt.done)return g(ee,pt),Yt&&Vo(ee,Dt),je;if(pt===null){for(;!Nt.done;Dt++,Nt=le.next())Nt=ht(ee,Nt.value,De),Nt!==null&&(K=C(Nt,K,Dt),yt===null?je=Nt:yt.sibling=Nt,yt=Nt);return Yt&&Vo(ee,Dt),je}for(pt=_(ee,pt);!Nt.done;Dt++,Nt=le.next())Nt=Gt(pt,ee,Dt,Nt.value,De),Nt!==null&&(c&&Nt.alternate!==null&&pt.delete(Nt.key===null?Dt:Nt.key),K=C(Nt,K,Dt),yt===null?je=Nt:yt.sibling=Nt,yt=Nt);return c&&pt.forEach(function(uP){return u(ee,uP)}),Yt&&Vo(ee,Dt),je}function or(ee,K,le,De){if(typeof le=="object"&&le!==null&&le.type===d&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case l:e:{for(var je=le.key,yt=K;yt!==null;){if(yt.key===je){if(je=le.type,je===d){if(yt.tag===7){g(ee,yt.sibling),K=E(yt,le.props.children),K.return=ee,ee=K;break e}}else if(yt.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===M&&kx(je)===yt.type){g(ee,yt.sibling),K=E(yt,le.props),K.ref=zc(ee,yt,le),K.return=ee,ee=K;break e}g(ee,yt);break}else u(ee,yt);yt=yt.sibling}le.type===d?(K=Qo(le.props.children,ee.mode,De,le.key),K.return=ee,ee=K):(De=Zd(le.type,le.key,le.props,null,ee.mode,De),De.ref=zc(ee,K,le),De.return=ee,ee=De)}return U(ee);case f:e:{for(yt=le.key;K!==null;){if(K.key===yt)if(K.tag===4&&K.stateNode.containerInfo===le.containerInfo&&K.stateNode.implementation===le.implementation){g(ee,K.sibling),K=E(K,le.children||[]),K.return=ee,ee=K;break e}else{g(ee,K);break}else u(ee,K);K=K.sibling}K=Fg(le,ee.mode,De),K.return=ee,ee=K}return U(ee);case M:return yt=le._init,or(ee,K,yt(le._payload),De)}if(q(le))return Ye(ee,K,le,De);if(b(le))return ei(ee,K,le,De);xd(ee,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,K!==null&&K.tag===6?(g(ee,K.sibling),K=E(K,le),K.return=ee,ee=K):(g(ee,K),K=Ng(le,ee.mode,De),K.return=ee,ee=K),U(ee)):g(ee,K)}return or}var tl=Hx(!0),Gx=Hx(!1),Vc={},nr=Dn(Vc),Wc=Dn(Vc),nl=Dn(Vc);function Wr(c){if(c===Vc)throw Error(o(174));return c}function $0(c,u){Ge(nl,u),Ge(Wc,c),Ge(nr,Vc),c=ae(u),rt(nr),Ge(nr,c)}function il(){rt(nr),rt(Wc),rt(nl)}function zx(c){var u=Wr(nl.current),g=Wr(nr.current);u=D(g,c.type,u),g!==u&&(Ge(Wc,c),Ge(nr,u))}function eg(c){Wc.current===c&&(rt(nr),rt(Wc))}var en=Dn(0);function Ad(c){for(var u=c;u!==null;){if(u.tag===13){var g=u.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Fc(g)||Uc(g)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(u.flags&128)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var tg=[];function ng(){for(var c=0;cg?g:4,c(!0);var _=ir.transition;ir.transition={};try{c(!1),u()}finally{It=g,ir.transition=_}}function nA(){return Xr().memoizedState}function UB(c,u,g){var _=Vs(c);g={lane:_,action:g,hasEagerState:!1,eagerState:null,next:null},iA(c)?rA(u,g):(sA(c,u,g),g=hi(),c=rr(c,_,g),c!==null&&oA(c,u,_))}function OB(c,u,g){var _=Vs(c),E={lane:_,action:g,hasEagerState:!1,eagerState:null,next:null};if(iA(c))rA(u,E);else{sA(c,u,E);var C=c.alternate;if(c.lanes===0&&(C===null||C.lanes===0)&&(C=u.lastRenderedReducer,C!==null))try{var U=u.lastRenderedState,X=C(U,g);if(E.hasEagerState=!0,E.eagerState=X,Gr(X,U))return}catch{}finally{}g=hi(),c=rr(c,_,g),c!==null&&oA(c,u,_)}}function iA(c){var u=c.alternate;return c===ln||u!==null&&u===ln}function rA(c,u){Xc=Md=!0;var g=c.pending;g===null?u.next=u:(u.next=g.next,g.next=u),c.pending=u}function sA(c,u,g){xn!==null&&c.mode&1&&!(At&2)?(c=u.interleaved,c===null?(g.next=g,Vr===null?Vr=[u]:Vr.push(u)):(g.next=c.next,c.next=g),u.interleaved=g):(c=u.pending,c===null?g.next=g:(g.next=c.next,c.next=g),u.pending=g)}function oA(c,u,g){if(g&4194240){var _=u.lanes;_&=c.pendingLanes,g|=_,u.lanes=g,F0(c,g)}}var Rd={readContext:$i,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useInsertionEffect:qn,useLayoutEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useMutableSource:qn,useSyncExternalStore:qn,useId:qn,unstable_isNewReconciler:!1},kB={readContext:$i,useCallback:function(c,u){return fs().memoizedState=[c,u===void 0?null:u],c},useContext:$i,useEffect:ag,useImperativeHandle:function(c,u,g){return g=g!=null?g.concat([c]):null,Cd(4194308,4,qx.bind(null,u,c),g)},useLayoutEffect:function(c,u){return Cd(4194308,4,c,u)},useInsertionEffect:function(c,u){return Cd(4,2,c,u)},useMemo:function(c,u){var g=fs();return u=u===void 0?null:u,c=c(),g.memoizedState=[c,u],c},useReducer:function(c,u,g){var _=fs();return u=g!==void 0?g(u):u,_.memoizedState=_.baseState=u,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:u},_.queue=c,c=c.dispatch=UB.bind(null,ln,c),[_.memoizedState,c]},useRef:function(c){var u=fs();return c={current:c},u.memoizedState=c},useState:og,useDebugValue:lg,useDeferredValue:function(c){var u=og(c),g=u[0],_=u[1];return ag(function(){var E=ir.transition;ir.transition={};try{_(c)}finally{ir.transition=E}},[c]),g},useTransition:function(){var c=og(!1),u=c[0];return c=FB.bind(null,c[1]),fs().memoizedState=c,[u,c]},useMutableSource:function(){},useSyncExternalStore:function(c,u,g){var _=ln,E=fs();if(Yt){if(g===void 0)throw Error(o(407));g=g()}else{if(g=u(),xn===null)throw Error(o(349));rl&30||Xx(_,u,g)}E.memoizedState=g;var C={value:g,getSnapshot:u};return E.queue=C,ag(jx.bind(null,_,C,c),[c]),_.flags|=2048,jc(9,Jx.bind(null,_,C,g,u),void 0,null),g},useId:function(){var c=fs(),u=xn.identifierPrefix;if(Yt){var g=us,_=cs;g=(_&~(1<<32-Ii(_)-1)).toString(32)+g,u=":"+u+"R"+g,g=Jc++,0Tg&&(u.flags|=128,_=!0,Zc(E,!1),u.lanes=4194304)}else{if(!_)if(c=Ad(C),c!==null){if(u.flags|=128,_=!0,c=c.updateQueue,c!==null&&(u.updateQueue=c,u.flags|=4),Zc(E,!0),E.tail===null&&E.tailMode==="hidden"&&!C.alternate&&!Yt)return $n(u),null}else 2*Fn()-E.renderingStartTime>Tg&&g!==1073741824&&(u.flags|=128,_=!0,Zc(E,!1),u.lanes=4194304);E.isBackwards?(C.sibling=u.child,u.child=C):(c=E.last,c!==null?c.sibling=C:u.child=C,E.last=C)}return E.tail!==null?(u=E.tail,E.rendering=u,E.tail=u.sibling,E.renderingStartTime=Fn(),u.sibling=null,c=en.current,Ge(en,_?c&1|2:c&1),u):($n(u),null);case 22:case 23:return Lg(),_=u.memoizedState!==null,c!==null&&c.memoizedState!==null!==_&&(u.flags|=8192),_&&u.mode&1?Ui&1073741824&&($n(u),Ve&&u.subtreeFlags&6&&(u.flags|=8192)):$n(u),null;case 24:return null;case 25:return null}throw Error(o(156,u.tag))}var WB=a.ReactCurrentOwner,Fi=!1;function di(c,u,g,_){u.child=c===null?Gx(u,null,g,_):tl(u,c.child,g,_)}function pA(c,u,g,_,E){g=g.render;var C=u.ref;return Za(u,E),_=rg(c,u,g,_,C,E),g=sg(),c!==null&&!Fi?(u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~E,ds(c,u,E)):(Yt&&g&&K0(u),u.flags|=1,di(c,u,_,E),u.child)}function mA(c,u,g,_,E){if(c===null){var C=g.type;return typeof C=="function"&&!Dg(C)&&C.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(u.tag=15,u.type=C,gA(c,u,C,_,E)):(c=Zd(g.type,null,_,u,u.mode,E),c.ref=u.ref,c.return=u,u.child=c)}if(C=c.child,!(c.lanes&E)){var U=C.memoizedProps;if(g=g.compare,g=g!==null?g:dd,g(U,_)&&c.ref===u.ref)return ds(c,u,E)}return u.flags|=1,c=Xs(C,_),c.ref=u.ref,c.return=u,u.child=c}function gA(c,u,g,_,E){if(c!==null&&dd(c.memoizedProps,_)&&c.ref===u.ref)if(Fi=!1,(c.lanes&E)!==0)c.flags&131072&&(Fi=!0);else return u.lanes=c.lanes,ds(c,u,E);return fg(c,u,g,_,E)}function vA(c,u,g){var _=u.pendingProps,E=_.children,C=c!==null?c.memoizedState:null;if(_.mode==="hidden")if(!(u.mode&1))u.memoizedState={baseLanes:0,cachePool:null},Ge(sl,Ui),Ui|=g;else if(g&1073741824)u.memoizedState={baseLanes:0,cachePool:null},_=C!==null?C.baseLanes:g,Ge(sl,Ui),Ui|=_;else return c=C!==null?C.baseLanes|g:g,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:c,cachePool:null},u.updateQueue=null,Ge(sl,Ui),Ui|=c,null;else C!==null?(_=C.baseLanes|g,u.memoizedState=null):_=g,Ge(sl,Ui),Ui|=_;return di(c,u,E,g),u.child}function yA(c,u){var g=u.ref;(c===null&&g!==null||c!==null&&c.ref!==g)&&(u.flags|=512,u.flags|=2097152)}function fg(c,u,g,_,E){var C=Nn(g)?Or:xt.current;return C=qi(u,C),Za(u,E),g=rg(c,u,g,_,C,E),_=sg(),c!==null&&!Fi?(u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~E,ds(c,u,E)):(Yt&&_&&K0(u),u.flags|=1,di(c,u,g,E),u.child)}function _A(c,u,g,_,E){if(Nn(g)){var C=!0;Wn(u)}else C=!1;if(Za(u,E),u.stateNode===null)c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),Ix(u,g,_),j0(u,g,_,E),_=!0;else if(c===null){var U=u.stateNode,X=u.memoizedProps;U.props=X;var fe=U.context,Me=g.contextType;typeof Me=="object"&&Me!==null?Me=$i(Me):(Me=Nn(g)?Or:xt.current,Me=qi(u,Me));var ze=g.getDerivedStateFromProps,ht=typeof ze=="function"||typeof U.getSnapshotBeforeUpdate=="function";ht||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(X!==_||fe!==Me)&&Dx(u,U,_,Me),ks=!1;var qe=u.memoizedState;U.state=qe,gd(u,_,U,E),fe=u.memoizedState,X!==_||qe!==fe||an.current||ks?(typeof ze=="function"&&(J0(u,g,ze,_),fe=u.memoizedState),(X=ks||Lx(u,g,X,_,qe,fe,Me))?(ht||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(u.flags|=4194308)):(typeof U.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=_,u.memoizedState=fe),U.props=_,U.state=fe,U.context=Me,_=X):(typeof U.componentDidMount=="function"&&(u.flags|=4194308),_=!1)}else{U=u.stateNode,Rx(c,u),X=u.memoizedProps,Me=u.type===u.elementType?X:gr(u.type,X),U.props=Me,ht=u.pendingProps,qe=U.context,fe=g.contextType,typeof fe=="object"&&fe!==null?fe=$i(fe):(fe=Nn(g)?Or:xt.current,fe=qi(u,fe));var Gt=g.getDerivedStateFromProps;(ze=typeof Gt=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(X!==ht||qe!==fe)&&Dx(u,U,_,fe),ks=!1,qe=u.memoizedState,U.state=qe,gd(u,_,U,E);var Ye=u.memoizedState;X!==ht||qe!==Ye||an.current||ks?(typeof Gt=="function"&&(J0(u,g,Gt,_),Ye=u.memoizedState),(Me=ks||Lx(u,g,Me,_,qe,Ye,fe)||!1)?(ze||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(_,Ye,fe),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(_,Ye,fe)),typeof U.componentDidUpdate=="function"&&(u.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof U.componentDidUpdate!="function"||X===c.memoizedProps&&qe===c.memoizedState||(u.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||X===c.memoizedProps&&qe===c.memoizedState||(u.flags|=1024),u.memoizedProps=_,u.memoizedState=Ye),U.props=_,U.state=Ye,U.context=fe,_=Me):(typeof U.componentDidUpdate!="function"||X===c.memoizedProps&&qe===c.memoizedState||(u.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||X===c.memoizedProps&&qe===c.memoizedState||(u.flags|=1024),_=!1)}return dg(c,u,g,_,C,E)}function dg(c,u,g,_,E,C){yA(c,u);var U=(u.flags&128)!==0;if(!_&&!U)return E&&Ya(u,g,!1),ds(c,u,C);_=u.stateNode,WB.current=u;var X=U&&typeof g.getDerivedStateFromError!="function"?null:_.render();return u.flags|=1,c!==null&&U?(u.child=tl(u,c.child,null,C),u.child=tl(u,null,X,C)):di(c,u,X,C),u.memoizedState=_.state,E&&Ya(u,g,!0),u.child}function xA(c){var u=c.stateNode;u.pendingContext?kr(c,u.pendingContext,u.pendingContext!==u.context):u.context&&kr(c,u.context,!1),$0(c,u.containerInfo)}function AA(c,u,g,_,E){return el(),q0(E),u.flags|=256,di(c,u,g,_),u.child}var Pd={dehydrated:null,treeContext:null,retryLane:0};function Ld(c){return{baseLanes:c,cachePool:null}}function SA(c,u,g){var _=u.pendingProps,E=en.current,C=!1,U=(u.flags&128)!==0,X;if((X=U)||(X=c!==null&&c.memoizedState===null?!1:(E&2)!==0),X?(C=!0,u.flags&=-129):(c===null||c.memoizedState!==null)&&(E|=1),Ge(en,E&1),c===null)return Z0(u),c=u.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(u.mode&1?Uc(c)?u.lanes=8:u.lanes=1073741824:u.lanes=1,null):(E=_.children,c=_.fallback,C?(_=u.mode,C=u.child,E={mode:"hidden",children:E},!(_&1)&&C!==null?(C.childLanes=0,C.pendingProps=E):C=qd(E,_,0,null),c=Qo(c,_,g,null),C.return=u,c.return=u,C.sibling=c,u.child=C,u.child.memoizedState=Ld(g),u.memoizedState=Pd,c):hg(u,E));if(E=c.memoizedState,E!==null){if(X=E.dehydrated,X!==null){if(U)return u.flags&256?(u.flags&=-257,Id(c,u,g,Error(o(422)))):u.memoizedState!==null?(u.child=c.child,u.flags|=128,null):(C=_.fallback,E=u.mode,_=qd({mode:"visible",children:_.children},E,0,null),C=Qo(C,E,g,null),C.flags|=2,_.return=u,C.return=u,_.sibling=C,u.child=_,u.mode&1&&tl(u,c.child,null,g),u.child.memoizedState=Ld(g),u.memoizedState=Pd,C);if(!(u.mode&1))u=Id(c,u,g,null);else if(Uc(X))u=Id(c,u,g,Error(o(419)));else if(_=(g&c.childLanes)!==0,Fi||_){if(_=xn,_!==null){switch(g&-g){case 4:C=2;break;case 16:C=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}_=C&(_.suspendedLanes|g)?0:C,_!==0&&_!==E.retryLane&&(E.retryLane=_,rr(c,_,-1))}Ig(),u=Id(c,u,g,Error(o(421)))}else Fc(X)?(u.flags|=128,u.child=c.child,u=iP.bind(null,c),Ja(X,u),u=null):(g=E.treeContext,ye&&(Ni=sd(X),Di=u,Yt=!0,vr=null,Hc=!1,g!==null&&(er[tr++]=cs,er[tr++]=us,er[tr++]=zo,cs=g.id,us=g.overflow,zo=u)),u=hg(u,u.pendingProps.children),u.flags|=4096);return u}return C?(_=EA(c,u,_.children,_.fallback,g),C=u.child,E=c.child.memoizedState,C.memoizedState=E===null?Ld(g):{baseLanes:E.baseLanes|g,cachePool:null},C.childLanes=c.childLanes&~g,u.memoizedState=Pd,_):(g=MA(c,u,_.children,g),u.memoizedState=null,g)}return C?(_=EA(c,u,_.children,_.fallback,g),C=u.child,E=c.child.memoizedState,C.memoizedState=E===null?Ld(g):{baseLanes:E.baseLanes|g,cachePool:null},C.childLanes=c.childLanes&~g,u.memoizedState=Pd,_):(g=MA(c,u,_.children,g),u.memoizedState=null,g)}function hg(c,u){return u=qd({mode:"visible",children:u},c.mode,0,null),u.return=c,c.child=u}function MA(c,u,g,_){var E=c.child;return c=E.sibling,g=Xs(E,{mode:"visible",children:g}),!(u.mode&1)&&(g.lanes=_),g.return=u,g.sibling=null,c!==null&&(_=u.deletions,_===null?(u.deletions=[c],u.flags|=16):_.push(c)),u.child=g}function EA(c,u,g,_,E){var C=u.mode;c=c.child;var U=c.sibling,X={mode:"hidden",children:g};return!(C&1)&&u.child!==c?(g=u.child,g.childLanes=0,g.pendingProps=X,u.deletions=null):(g=Xs(c,X),g.subtreeFlags=c.subtreeFlags&14680064),U!==null?_=Xs(U,_):(_=Qo(_,C,E,null),_.flags|=2),_.return=u,g.return=u,g.sibling=_,u.child=g,_}function Id(c,u,g,_){return _!==null&&q0(_),tl(u,c.child,null,g),c=hg(u,u.pendingProps.children),c.flags|=2,u.memoizedState=null,c}function wA(c,u,g){c.lanes|=u;var _=c.alternate;_!==null&&(_.lanes|=u),W0(c.return,u,g)}function pg(c,u,g,_,E){var C=c.memoizedState;C===null?c.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:_,tail:g,tailMode:E}:(C.isBackwards=u,C.rendering=null,C.renderingStartTime=0,C.last=_,C.tail=g,C.tailMode=E)}function CA(c,u,g){var _=u.pendingProps,E=_.revealOrder,C=_.tail;if(di(c,u,_.children,g),_=en.current,_&2)_=_&1|2,u.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=u.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&wA(c,g,u);else if(c.tag===19)wA(c,g,u);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}_&=1}if(Ge(en,_),!(u.mode&1))u.memoizedState=null;else switch(E){case"forwards":for(g=u.child,E=null;g!==null;)c=g.alternate,c!==null&&Ad(c)===null&&(E=g),g=g.sibling;g=E,g===null?(E=u.child,u.child=null):(E=g.sibling,g.sibling=null),pg(u,!1,E,g,C);break;case"backwards":for(g=null,E=u.child,u.child=null;E!==null;){if(c=E.alternate,c!==null&&Ad(c)===null){u.child=E;break}c=E.sibling,E.sibling=g,g=E,E=c}pg(u,!0,g,null,C);break;case"together":pg(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function ds(c,u,g){if(c!==null&&(u.dependencies=c.dependencies),ol|=u.lanes,!(g&u.childLanes))return null;if(c!==null&&u.child!==c.child)throw Error(o(153));if(u.child!==null){for(c=u.child,g=Xs(c,c.pendingProps),u.child=g,g.return=u;c.sibling!==null;)c=c.sibling,g=g.sibling=Xs(c,c.pendingProps),g.return=u;g.sibling=null}return u.child}function XB(c,u,g){switch(u.tag){case 3:xA(u),el();break;case 5:zx(u);break;case 1:Nn(u.type)&&Wn(u);break;case 4:$0(u,u.stateNode.containerInfo);break;case 10:Tx(u,u.type._context,u.memoizedProps.value);break;case 13:var _=u.memoizedState;if(_!==null)return _.dehydrated!==null?(Ge(en,en.current&1),u.flags|=128,null):g&u.child.childLanes?SA(c,u,g):(Ge(en,en.current&1),c=ds(c,u,g),c!==null?c.sibling:null);Ge(en,en.current&1);break;case 19:if(_=(g&u.childLanes)!==0,c.flags&128){if(_)return CA(c,u,g);u.flags|=128}var E=u.memoizedState;if(E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Ge(en,en.current),_)break;return null;case 22:case 23:return u.lanes=0,vA(c,u,g)}return ds(c,u,g)}function JB(c,u){switch(Y0(u),u.tag){case 1:return Nn(u.type)&&gn(),c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 3:return il(),rt(an),rt(xt),ng(),c=u.flags,c&65536&&!(c&128)?(u.flags=c&-65537|128,u):null;case 5:return eg(u),null;case 13:if(rt(en),c=u.memoizedState,c!==null&&c.dehydrated!==null){if(u.alternate===null)throw Error(o(340));el()}return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 19:return rt(en),null;case 4:return il(),null;case 10:return V0(u.type._context),null;case 22:case 23:return Lg(),null;case 24:return null;default:return null}}var Dd=!1,Xo=!1,jB=typeof WeakSet=="function"?WeakSet:Set,Le=null;function Nd(c,u){var g=c.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(_){Ei(c,u,_)}else g.current=null}function mg(c,u,g){try{g()}catch(_){Ei(c,u,_)}}var TA=!1;function KB(c,u){for(k(c.containerInfo),Le=u;Le!==null;)if(c=Le,u=c.child,(c.subtreeFlags&1028)!==0&&u!==null)u.return=c,Le=u;else for(;Le!==null;){c=Le;try{var g=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var _=g.memoizedProps,E=g.memoizedState,C=c.stateNode,U=C.getSnapshotBeforeUpdate(c.elementType===c.type?_:gr(c.type,_),E);C.__reactInternalSnapshotBeforeUpdate=U}break;case 3:Ve&&Fe(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(X){Ei(c,c.return,X)}if(u=c.sibling,u!==null){u.return=c.return,Le=u;break}Le=c.return}return g=TA,TA=!1,g}function Jo(c,u,g){var _=u.updateQueue;if(_=_!==null?_.lastEffect:null,_!==null){var E=_=_.next;do{if((E.tag&c)===c){var C=E.destroy;E.destroy=void 0,C!==void 0&&mg(u,g,C)}E=E.next}while(E!==_)}}function qc(c,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var g=u=u.next;do{if((g.tag&c)===c){var _=g.create;g.destroy=_()}g=g.next}while(g!==u)}}function gg(c){var u=c.ref;if(u!==null){var g=c.stateNode;switch(c.tag){case 5:c=re(g);break;default:c=g}typeof u=="function"?u(c):u.current=c}}function RA(c,u,g){if(Hr&&typeof Hr.onCommitFiberUnmount=="function")try{Hr.onCommitFiberUnmount(ud,u)}catch{}switch(u.tag){case 0:case 11:case 14:case 15:if(c=u.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var _=c=c.next;do{var E=_,C=E.destroy;E=E.tag,C!==void 0&&(E&2||E&4)&&mg(u,g,C),_=_.next}while(_!==c)}break;case 1:if(Nd(u,g),c=u.stateNode,typeof c.componentWillUnmount=="function")try{c.props=u.memoizedProps,c.state=u.memoizedState,c.componentWillUnmount()}catch(U){Ei(u,g,U)}break;case 5:Nd(u,g);break;case 4:Ve?DA(c,u,g):z&&z&&(u=u.stateNode.containerInfo,g=de(u),Et(u,g))}}function bA(c,u,g){for(var _=u;;)if(RA(c,_,g),_.child===null||Ve&&_.tag===4){if(_===u)break;for(;_.sibling===null;){if(_.return===null||_.return===u)return;_=_.return}_.sibling.return=_.return,_=_.sibling}else _.child.return=_,_=_.child}function BA(c){var u=c.alternate;u!==null&&(c.alternate=null,BA(u)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(u=c.stateNode,u!==null&&Qe(u)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function PA(c){return c.tag===5||c.tag===3||c.tag===4}function LA(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||PA(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function IA(c){if(Ve){e:{for(var u=c.return;u!==null;){if(PA(u))break e;u=u.return}throw Error(o(160))}var g=u;switch(g.tag){case 5:u=g.stateNode,g.flags&32&&(ot(u),g.flags&=-33),g=LA(c),yg(c,g,u);break;case 3:case 4:u=g.stateNode.containerInfo,g=LA(c),vg(c,g,u);break;default:throw Error(o(161))}}}function vg(c,u,g){var _=c.tag;if(_===5||_===6)c=c.stateNode,u?Ee(g,c,u):Je(g,c);else if(_!==4&&(c=c.child,c!==null))for(vg(c,u,g),c=c.sibling;c!==null;)vg(c,u,g),c=c.sibling}function yg(c,u,g){var _=c.tag;if(_===5||_===6)c=c.stateNode,u?Pt(g,c,u):Ae(g,c);else if(_!==4&&(c=c.child,c!==null))for(yg(c,u,g),c=c.sibling;c!==null;)yg(c,u,g),c=c.sibling}function DA(c,u,g){for(var _=u,E=!1,C,U;;){if(!E){E=_.return;e:for(;;){if(E===null)throw Error(o(160));switch(C=E.stateNode,E.tag){case 5:U=!1;break e;case 3:C=C.containerInfo,U=!0;break e;case 4:C=C.containerInfo,U=!0;break e}E=E.return}E=!0}if(_.tag===5||_.tag===6)bA(c,_,g),U?dt(C,_.stateNode):Ft(C,_.stateNode);else if(_.tag===18)U?se(C,_.stateNode):ce(C,_.stateNode);else if(_.tag===4){if(_.child!==null){C=_.stateNode.containerInfo,U=!0,_.child.return=_,_=_.child;continue}}else if(RA(c,_,g),_.child!==null){_.child.return=_,_=_.child;continue}if(_===u)break;for(;_.sibling===null;){if(_.return===null||_.return===u)return;_=_.return,_.tag===4&&(E=!1)}_.sibling.return=_.return,_=_.sibling}}function _g(c,u){if(Ve){switch(u.tag){case 0:case 11:case 14:case 15:Jo(3,u,u.return),qc(3,u),Jo(5,u,u.return);return;case 1:return;case 5:var g=u.stateNode;if(g!=null){var _=u.memoizedProps;c=c!==null?c.memoizedProps:_;var E=u.type,C=u.updateQueue;u.updateQueue=null,C!==null&<(g,C,E,c,_,u)}return;case 6:if(u.stateNode===null)throw Error(o(162));g=u.memoizedProps,Te(u.stateNode,c!==null?c.memoizedProps:g,g);return;case 3:ye&&c!==null&&c.memoizedState.isDehydrated&&Q(u.stateNode.containerInfo);return;case 12:return;case 13:Fd(u);return;case 19:Fd(u);return;case 17:return}throw Error(o(163))}switch(u.tag){case 0:case 11:case 14:case 15:Jo(3,u,u.return),qc(3,u),Jo(5,u,u.return);return;case 12:return;case 13:Fd(u);return;case 19:Fd(u);return;case 3:ye&&c!==null&&c.memoizedState.isDehydrated&&Q(u.stateNode.containerInfo);break;case 22:case 23:return}e:if(z){switch(u.tag){case 1:case 5:case 6:break e;case 3:case 4:u=u.stateNode,Et(u.containerInfo,u.pendingChildren);break e}throw Error(o(163))}}function Fd(c){var u=c.updateQueue;if(u!==null){c.updateQueue=null;var g=c.stateNode;g===null&&(g=c.stateNode=new jB),u.forEach(function(_){var E=rP.bind(null,c,_);g.has(_)||(g.add(_),_.then(E,E))})}}function YB(c,u){for(Le=u;Le!==null;){u=Le;var g=u.deletions;if(g!==null)for(var _=0;_";case Od:return":has("+(Sg(c)||"")+")";case kd:return'[role="'+c.value+'"]';case Gd:return'"'+c.value+'"';case Hd:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function kA(c,u){var g=[];c=[c,0];for(var _=0;_E&&(E=U),_&=~C}if(_=E,_=Fn()-_,_=(120>_?120:480>_?480:1080>_?1080:1920>_?1920:3e3>_?3e3:4320>_?4320:1960*ZB(_/1960))-_,10<_){c.timeoutHandle=Re(Ko.bind(null,c,Si),_);break}Ko(c,Si);break;case 5:Ko(c,Si);break;default:throw Error(o(329))}}}return Mi(c,Fn()),c.callbackNode===g?HA.bind(null,c):null}function Bg(c,u){var g=tu;return c.current.memoizedState.isDehydrated&&(jo(c,u).flags|=256),c=Qd(c,u),c!==2&&(u=Si,Si=g,u!==null&&Pg(u)),c}function Pg(c){Si===null?Si=c:Si.push.apply(Si,c)}function qB(c){for(var u=c;;){if(u.flags&16384){var g=u.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var _=0;_c?16:c,zs===null)var _=!1;else{if(c=zs,zs=null,Jd=0,At&6)throw Error(o(331));var E=At;for(At|=4,Le=c.current;Le!==null;){var C=Le,U=C.child;if(Le.flags&16){var X=C.deletions;if(X!==null){for(var fe=0;feFn()-Cg?jo(c,0):wg|=g),Mi(c,u)}function KA(c,u){u===0&&(c.mode&1?(u=ld,ld<<=1,!(ld&130023424)&&(ld=4194304)):u=1);var g=hi();c=Yd(c,u),c!==null&&(kc(c,u,g),Mi(c,g))}function iP(c){var u=c.memoizedState,g=0;u!==null&&(g=u.retryLane),KA(c,g)}function rP(c,u){var g=0;switch(c.tag){case 13:var _=c.stateNode,E=c.memoizedState;E!==null&&(g=E.retryLane);break;case 19:_=c.stateNode;break;default:throw Error(o(314))}_!==null&&_.delete(u),KA(c,g)}var YA;YA=function(c,u,g){if(c!==null)if(c.memoizedProps!==u.pendingProps||an.current)Fi=!0;else{if(!(c.lanes&g)&&!(u.flags&128))return Fi=!1,XB(c,u,g);Fi=!!(c.flags&131072)}else Fi=!1,Yt&&u.flags&1048576&&Nx(u,_d,u.index);switch(u.lanes=0,u.tag){case 2:var _=u.type;c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),c=u.pendingProps;var E=qi(u,xt.current);Za(u,g),E=rg(null,u,_,c,E,g);var C=sg();return u.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Nn(_)?(C=!0,Wn(u)):C=!1,u.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,X0(u),E.updater=vd,u.stateNode=E,E._reactInternals=u,j0(u,_,c,g),u=dg(null,u,_,!0,C,g)):(u.tag=0,Yt&&C&&K0(u),di(null,u,E,g),u=u.child),u;case 16:_=u.elementType;e:{switch(c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),c=u.pendingProps,E=_._init,_=E(_._payload),u.type=_,E=u.tag=oP(_),c=gr(_,c),E){case 0:u=fg(null,u,_,c,g);break e;case 1:u=_A(null,u,_,c,g);break e;case 11:u=pA(null,u,_,c,g);break e;case 14:u=mA(null,u,_,gr(_.type,c),g);break e}throw Error(o(306,_,""))}return u;case 0:return _=u.type,E=u.pendingProps,E=u.elementType===_?E:gr(_,E),fg(c,u,_,E,g);case 1:return _=u.type,E=u.pendingProps,E=u.elementType===_?E:gr(_,E),_A(c,u,_,E,g);case 3:e:{if(xA(u),c===null)throw Error(o(387));_=u.pendingProps,C=u.memoizedState,E=C.element,Rx(c,u),gd(u,_,null,g);var U=u.memoizedState;if(_=U.element,ye&&C.isDehydrated)if(C={element:_,isDehydrated:!1,cache:U.cache,transitions:U.transitions},u.updateQueue.baseState=C,u.memoizedState=C,u.flags&256){E=Error(o(423)),u=AA(c,u,_,g,E);break e}else if(_!==E){E=Error(o(424)),u=AA(c,u,_,g,E);break e}else for(ye&&(Ni=rd(u.stateNode.containerInfo),Di=u,Yt=!0,vr=null,Hc=!1),g=Gx(u,null,_,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(el(),_===E){u=ds(c,u,g);break e}di(c,u,_,g)}u=u.child}return u;case 5:return zx(u),c===null&&Z0(u),_=u.type,E=u.pendingProps,C=c!==null?c.memoizedProps:null,U=E.children,ge(_,E)?U=null:C!==null&&ge(_,C)&&(u.flags|=32),yA(c,u),di(c,u,U,g),u.child;case 6:return c===null&&Z0(u),null;case 13:return SA(c,u,g);case 4:return $0(u,u.stateNode.containerInfo),_=u.pendingProps,c===null?u.child=tl(u,null,_,g):di(c,u,_,g),u.child;case 11:return _=u.type,E=u.pendingProps,E=u.elementType===_?E:gr(_,E),pA(c,u,_,E,g);case 7:return di(c,u,u.pendingProps,g),u.child;case 8:return di(c,u,u.pendingProps.children,g),u.child;case 12:return di(c,u,u.pendingProps.children,g),u.child;case 10:e:{if(_=u.type._context,E=u.pendingProps,C=u.memoizedProps,U=E.value,Tx(u,_,U),C!==null)if(Gr(C.value,U)){if(C.children===E.children&&!an.current){u=ds(c,u,g);break e}}else for(C=u.child,C!==null&&(C.return=u);C!==null;){var X=C.dependencies;if(X!==null){U=C.child;for(var fe=X.firstContext;fe!==null;){if(fe.context===_){if(C.tag===1){fe=ls(-1,g&-g),fe.tag=2;var Me=C.updateQueue;if(Me!==null){Me=Me.shared;var ze=Me.pending;ze===null?fe.next=fe:(fe.next=ze.next,ze.next=fe),Me.pending=fe}}C.lanes|=g,fe=C.alternate,fe!==null&&(fe.lanes|=g),W0(C.return,g,u),X.lanes|=g;break}fe=fe.next}}else if(C.tag===10)U=C.type===u.type?null:C.child;else if(C.tag===18){if(U=C.return,U===null)throw Error(o(341));U.lanes|=g,X=U.alternate,X!==null&&(X.lanes|=g),W0(U,g,u),U=C.sibling}else U=C.child;if(U!==null)U.return=C;else for(U=C;U!==null;){if(U===u){U=null;break}if(C=U.sibling,C!==null){C.return=U.return,U=C;break}U=U.return}C=U}di(c,u,E.children,g),u=u.child}return u;case 9:return E=u.type,_=u.pendingProps.children,Za(u,g),E=$i(E),_=_(E),u.flags|=1,di(c,u,_,g),u.child;case 14:return _=u.type,E=gr(_,u.pendingProps),E=gr(_.type,E),mA(c,u,_,E,g);case 15:return gA(c,u,u.type,u.pendingProps,g);case 17:return _=u.type,E=u.pendingProps,E=u.elementType===_?E:gr(_,E),c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),u.tag=1,Nn(_)?(c=!0,Wn(u)):c=!1,Za(u,g),Ix(u,_,E),j0(u,_,E,g),dg(null,u,_,!0,c,g);case 19:return CA(c,u,g);case 22:return vA(c,u,g)}throw Error(o(156,u.tag))};function QA(c,u){return U0(c,u)}function sP(c,u,g,_){this.tag=c,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sr(c,u,g,_){return new sP(c,u,g,_)}function Dg(c){return c=c.prototype,!(!c||!c.isReactComponent)}function oP(c){if(typeof c=="function")return Dg(c)?1:0;if(c!=null){if(c=c.$$typeof,c===S)return 11;if(c===A)return 14}return 2}function Xs(c,u){var g=c.alternate;return g===null?(g=sr(c.tag,u,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=u,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&14680064,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,u=c.dependencies,g.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g}function Zd(c,u,g,_,E,C){var U=2;if(_=c,typeof c=="function")Dg(c)&&(U=1);else if(typeof c=="string")U=5;else e:switch(c){case d:return Qo(g.children,E,C,u);case h:U=8,E|=8;break;case p:return c=sr(12,g,u,E|2),c.elementType=p,c.lanes=C,c;case x:return c=sr(13,g,u,E),c.elementType=x,c.lanes=C,c;case m:return c=sr(19,g,u,E),c.elementType=m,c.lanes=C,c;case w:return qd(g,E,C,u);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case v:U=10;break e;case y:U=9;break e;case S:U=11;break e;case A:U=14;break e;case M:U=16,_=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return u=sr(U,g,u,E),u.elementType=c,u.type=_,u.lanes=C,u}function Qo(c,u,g,_){return c=sr(7,c,_,u),c.lanes=g,c}function qd(c,u,g,_){return c=sr(22,c,_,u),c.elementType=w,c.lanes=g,c.stateNode={},c}function Ng(c,u,g){return c=sr(6,c,null,u),c.lanes=g,c}function Fg(c,u,g){return u=sr(4,c.children!==null?c.children:[],c.key,u),u.lanes=g,u.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},u}function aP(c,u,g,_,E){this.tag=u,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=st,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=N0(0),this.expirationTimes=N0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=N0(0),this.identifierPrefix=_,this.onRecoverableError=E,ye&&(this.mutableSourceEagerHydrationData=null)}function ZA(c,u,g,_,E,C,U,X,fe){return c=new aP(c,u,g,X,fe),u===1?(u=1,C===!0&&(u|=8)):u=0,C=sr(3,null,null,u),c.current=C,C.stateNode=c,C.memoizedState={element:_,isDehydrated:g,cache:null,transitions:null},X0(C),c}function qA(c){if(!c)return Zi;c=c._reactInternals;e:{if(R(c)!==c||c.tag!==1)throw Error(o(170));var u=c;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Nn(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(o(171))}if(c.tag===1){var g=c.type;if(Nn(g))return Ka(c,g,u)}return u}function $A(c){var u=c._reactInternals;if(u===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=J(u),c===null?null:c.stateNode}function eS(c,u){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g=Me&&C>=ht&&E<=ze&&U<=qe){c.splice(u,1);break}else if(_!==Me||g.width!==fe.width||qeU){if(!(C!==ht||g.height!==fe.height||ze<_||Me>E)){Me>_&&(fe.width+=Me-_,fe.x=_),zeC&&(fe.height+=ht-C,fe.y=C),qeg&&(g=U)),U ")+` + +No matching component was found for: + `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return re(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:lP,findFiberByHostInstance:c.findFiberByHostInstance||cP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)c=!0;else{try{ud=u.inject(c),Hr=u}catch{}c=!!u.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,u,g,_){if(!et)throw Error(o(363));c=Mg(c,u);var E=ve(c,g,_).disconnect;return{disconnect:function(){E()}}},t.registerMutableSourceForHydration=function(c,u){var g=u._getVersion;g=g(u._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[u,g]:c.mutableSourceEagerHydrationData.push(u,g)},t.runWithPriority=function(c,u){var g=It;try{return It=c,u()}finally{It=g}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,u,g,_){var E=u.current,C=hi(),U=Vs(E);return g=qA(g),u.context===null?u.context=g:u.pendingContext=g,u=ls(C,U),u.payload={element:c},_=_===void 0?null:_,_!==null&&(u.callback=_),Hs(E,u),c=rr(E,U,C),c!==null&&md(c,E,U),U},t};db.exports=DO;var NO=db.exports;const FO=m1(NO);var hb={exports:{}},pb={};/** + * @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(n){function e(D,k){var G=D.length;D.push(k);e:for(;0>>1,$=D[Y];if(0>>1;Yr(ge,G))we<$&&0>r(Re,ge)?(D[Y]=Re,D[we]=G,Y=we):(D[Y]=ge,D[ue]=G,Y=ue);else if(we<$&&0>r(Re,G))D[Y]=Re,D[we]=G,Y=we;else break e}}return k}function r(D,k){var G=D.sortIndex-k.sortIndex;return G!==0?G:D.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],f=[],d=1,h=null,p=3,v=!1,y=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(D){for(var k=t(f);k!==null;){if(k.callback===null)i(f);else if(k.startTime<=D)i(f),k.sortIndex=k.expirationTime,e(l,k);else break;k=t(f)}}function w(D){if(S=!1,M(D),!y)if(t(l)!==null)y=!0,re(T);else{var k=t(f);k!==null&&ae(w,k.startTime-D)}}function T(D,k){y=!1,S&&(S=!1,m(I),I=-1),v=!0;var G=p;try{for(M(k),h=t(l);h!==null&&(!(h.expirationTime>k)||D&&!H());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,p=h.priorityLevel;var $=Y(h.expirationTime<=k);k=n.unstable_now(),typeof $=="function"?h.callback=$:h===t(l)&&i(l),M(k)}else i(l);h=t(l)}if(h!==null)var Z=!0;else{var ue=t(f);ue!==null&&ae(w,ue.startTime-k),Z=!1}return Z}finally{h=null,p=G,v=!1}}var b=!1,B=null,I=-1,R=5,P=-1;function H(){return!(n.unstable_now()-PD||125Y?(D.sortIndex=G,e(f,D),t(l)===null&&D===t(f)&&(S?(m(I),I=-1):S=!0,ae(w,G-Y))):(D.sortIndex=$,e(l,D),y||v||(y=!0,re(T))),D},n.unstable_shouldYield=H,n.unstable_wrapCallback=function(D){var k=p;return function(){var G=p;p=k;try{return D.apply(this,arguments)}finally{p=G}}}})(pb);hb.exports=pb;var KE=hb.exports;const UO=n=>typeof n=="object"&&typeof n.then=="function",Aa=[];function mb(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=Aa.indexOf(r);s!==-1&&Aa.splice(s,1)},promise:(UO(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(Aa.push(r),!t)throw r.promise}const OO=(n,e,t)=>gb(n,e,!1,t),kO=(n,e,t)=>void gb(n,e,!0,t),HO=n=>{if(n===void 0||n.length===0)Aa.splice(0,Aa.length);else{const e=Aa.find(t=>mb(n,t.keys,t.equal));e&&e.remove()}},ix={},vb=n=>void Object.assign(ix,n);function GO(n,e){function t(d,{args:h=[],attach:p,...v},y){let S=`${d[0].toUpperCase()}${d.slice(1)}`,x;if(d==="primitive"){if(v.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const m=v.object;x=Ll(m,{type:d,root:y,attach:p,primitive:!0})}else{const m=ix[S];if(!m)throw new Error(`R3F: ${S} 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(h))throw new Error("R3F: The args prop must be an array!");x=Ll(new m(...h),{type:d,root:y,attach:p,memoizedProps:{args:h}})}return x.__r3f.attach===void 0&&(x instanceof mt?x.__r3f.attach="geometry":x instanceof wn&&(x.__r3f.attach="material")),S!=="inject"&&$v(x,v),x}function i(d,h){let p=!1;if(h){var v,y;(v=h.__r3f)!=null&&v.attach?qv(d,h,h.__r3f.attach):h.isObject3D&&d.isObject3D&&(d.add(h),p=!0),p||(y=d.__r3f)==null||y.objects.push(h),h.__r3f||Ll(h,{}),h.__r3f.parent=d,t1(h),Il(h)}}function r(d,h,p){let v=!1;if(h){var y,S;if((y=h.__r3f)!=null&&y.attach)qv(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){h.parent=d,h.dispatchEvent({type:"added"});const x=d.children.filter(A=>A!==h),m=x.indexOf(p);d.children=[...x.slice(0,m),h,...x.slice(m)],v=!0}v||(S=d.__r3f)==null||S.objects.push(h),h.__r3f||Ll(h,{}),h.__r3f.parent=d,t1(h),Il(h)}}function s(d,h,p=!1){d&&[...d].forEach(v=>o(h,v,p))}function o(d,h,p){if(h){var v,y,S;if(h.__r3f&&(h.__r3f.parent=null),(v=d.__r3f)!=null&&v.objects&&(d.__r3f.objects=d.__r3f.objects.filter(w=>w!==h)),(y=h.__r3f)!=null&&y.attach)$E(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){var x;d.remove(h),(x=h.__r3f)!=null&&x.root&&QO(h.__r3f.root,h)}const A=(S=h.__r3f)==null?void 0:S.primitive,M=!A&&(p===void 0?h.dispose!==null:p);if(!A){var m;s((m=h.__r3f)==null?void 0:m.objects,h,M),s(h.children,h,M)}if(delete h.__r3f,M&&h.dispose&&h.type!=="Scene"){const w=()=>{try{h.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?KE.unstable_scheduleCallback(KE.unstable_IdlePriority,w):w()}Il(d)}}function a(d,h,p,v){var y;const S=(y=d.__r3f)==null?void 0:y.parent;if(!S)return;const x=t(h,p,d.__r3f.root);if(d.children){for(const m of d.children)m.__r3f&&i(x,m);d.children=d.children.filter(m=>!m.__r3f)}d.__r3f.objects.forEach(m=>i(x,m)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||o(S,d),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),i(S,x),x.raycast&&x.__r3f.eventCount&&x.__r3f.root.getState().internal.interaction.push(x),[v,v.alternate].forEach(m=>{m!==null&&(m.stateNode=x,m.ref&&(typeof m.ref=="function"?m.ref(x):m.ref.current=x))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:FO({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,h)=>{if(!h)return;const p=d.getState().scene;p.__r3f&&(p.__r3f.root=d,i(p,h))},removeChildFromContainer:(d,h)=>{h&&o(d.getState().scene,h)},insertInContainerBefore:(d,h,p)=>{if(!h||!p)return;const v=d.getState().scene;v.__r3f&&r(v,h,p)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var h;return!!((h=d==null?void 0:d.__r3f)!=null?h:{}).handlers},prepareUpdate(d,h,p,v){var y;if(((y=d==null?void 0:d.__r3f)!=null?y:{}).primitive&&v.object&&v.object!==d)return[!0];{const{args:x=[],children:m,...A}=v,{args:M=[],children:w,...T}=p;if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((B,I)=>B!==M[I]))return[!0];const b=Eb(d,A,T,!0);return b.changes.length?[!1,b]:null}},commitUpdate(d,[h,p],v,y,S,x){h?a(d,v,S,x):$v(d,p)},commitMount(d,h,p,v){var y;const S=(y=d.__r3f)!=null?y:{};d.raycast&&S.handlers&&S.eventCount&&d.__r3f.root.getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>Ll(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var h;const{attach:p,parent:v}=(h=d.__r3f)!=null?h:{};p&&v&&$E(v,d,p),d.isObject3D&&(d.visible=!1),Il(d)},unhideInstance(d,h){var p;const{attach:v,parent:y}=(p=d.__r3f)!=null?p:{};v&&y&&qv(y,d,v),(d.isObject3D&&h.visible==null||h.visible)&&(d.visible=!0),Il(d)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Yl.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&jt.fun(performance.now)?performance.now:jt.fun(Date.now)?Date.now:()=>0,scheduleTimeout:jt.fun(setTimeout)?setTimeout:void 0,cancelTimeout:jt.fun(clearTimeout)?clearTimeout:void 0}),applyProps:$v}}var YE,QE;const Zv=n=>"colorSpace"in n||"outputColorSpace"in n,yb=()=>{var n;return(n=ix.ColorManagement)!=null?n:null},_b=n=>n&&n.isOrthographicCamera,zO=n=>n&&n.hasOwnProperty("current"),$f=typeof window<"u"&&((YE=window.document)!=null&&YE.createElement||((QE=window.navigator)==null?void 0:QE.product)==="ReactNative")?j.useLayoutEffect:j.useEffect;function xb(n){const e=j.useRef(n);return $f(()=>void(e.current=n),[n]),e}function VO({set:n}){return $f(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class Ab extends j.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}Ab.getDerivedStateFromError=()=>({error:!0});const Sb="__default",ZE=new Map,WO=n=>n&&!!n.memoized&&!!n.changes;function Mb(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Su=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},jt={obj:n=>n===Object(n)&&!jt.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,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(jt.str(n)||jt.num(n))return n===e;const s=jt.obj(n);if(s&&i==="reference")return n===e;const o=jt.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!jt.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(jt.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function XO(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function JO(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Ll(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function e1(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const qE=/-\d+$/;function qv(n,e,t){if(jt.str(t)){if(qE.test(t)){const s=t.replace(qE,""),{target:o,key:a}=e1(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=e1(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function $E(n,e,t){var i,r;if(jt.str(t)){const{target:s,key:o}=e1(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function Eb(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},f=!1){var d;const h=(d=n==null?void 0:n.__r3f)!=null?d:{},p=Object.entries(r),v=[];if(f){const S=Object.keys(l);for(let x=0;x{var m;if((m=n.__r3f)!=null&&m.primitive&&S==="object"||jt.equ(x,l[S]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(S))return v.push([S,x,!0,[]]);let A=[];S.includes("-")&&(A=S.split("-")),v.push([S,x,!1,A]);for(const M in r){const w=r[M];M.startsWith(`${S}-`)&&v.push([M,w,!1,M.split("-")])}});const y={...r};return h.memoizedProps&&h.memoizedProps.args&&(y.args=h.memoizedProps.args),h.memoizedProps&&h.memoizedProps.attach&&(y.attach=h.memoizedProps.attach),{memoized:y,changes:v}}const jO=typeof process<"u"&&!1;function $v(n,e){var t,i,r;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(i=o==null||o.getState==null?void 0:o.getState())!=null?i:{},{memoized:l,changes:f}=WO(e)?e:Eb(n,e),d=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let p=0;pM[w],n),!(A&&A.set))){const[M,...w]=x.reverse();m=w.reverse().reduce((T,b)=>T[b],n),v=M}if(y===Sb+"remove")if(m.constructor){let M=ZE.get(m.constructor);M||(M=new m.constructor,ZE.set(m.constructor,M)),y=M[v]}else y=0;if(S)y?s.handlers[v]=y:delete s.handlers[v],s.eventCount=Object.keys(s.handlers).length;else if(A&&A.set&&(A.copy||A instanceof Ca)){if(Array.isArray(y))A.fromArray?A.fromArray(y):A.set(...y);else if(A.copy&&y&&y.constructor&&(jO?A.constructor.name===y.constructor.name:A.constructor===y.constructor))A.copy(y);else if(y!==void 0){const M=A instanceof Pe;!M&&A.setScalar?A.setScalar(y):A instanceof Ca&&y instanceof Ca?A.mask=y.mask:A.set(y),!yb()&&!a.linear&&M&&A.convertSRGBToLinear()}}else if(m[v]=y,m[v]instanceof qt&&m[v].format===vi&&m[v].type===$r){const M=m[v];Zv(M)&&Zv(a.gl)?M.colorSpace=a.gl.outputColorSpace:M.encoding=a.gl.outputEncoding}Il(n)}if(s.parent&&a.internal&&n.raycast&&d!==s.eventCount){const p=a.internal.interaction.indexOf(n);p>-1&&a.internal.interaction.splice(p,1),s.eventCount&&a.internal.interaction.push(n)}return!(f.length===1&&f[0][0]==="onUpdate")&&f.length&&(r=n.__r3f)!=null&&r.parent&&t1(n),n}function Il(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function t1(n){n.onUpdate==null||n.onUpdate(n)}function KO(n,e){n.manual||(_b(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function lp(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function YO(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Yl.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Yl.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Yl.ContinuousEventPriority;default:return Yl.DefaultEventPriority}}function wb(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function QO(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{wb(t.capturedMap,e,i,r)})}function ZO(n){function e(l){const{internal:f}=n.getState(),d=l.offsetX-f.initialClick[0],h=l.offsetY-f.initialClick[1];return Math.round(Math.sqrt(d*d+h*h))}function t(l){return l.filter(f=>["Move","Over","Enter","Out","Leave"].some(d=>{var h;return(h=f.__r3f)==null?void 0:h.handlers["onPointer"+d]}))}function i(l,f){const d=n.getState(),h=new Set,p=[],v=f?f(d.internal.interaction):d.internal.interaction;for(let m=0;m{const M=Su(m.object),w=Su(A.object);return!M||!w?m.distance-A.distance:w.events.priority-M.events.priority||m.distance-A.distance}).filter(m=>{const A=lp(m);return h.has(A)?!1:(h.add(A),!0)});d.events.filter&&(S=d.events.filter(S,d));for(const m of S){let A=m.object;for(;A;){var x;(x=A.__r3f)!=null&&x.eventCount&&p.push({...m,eventObject:A}),A=A.parent}}if("pointerId"in l&&d.internal.capturedMap.has(l.pointerId))for(let m of d.internal.capturedMap.get(l.pointerId).values())h.has(lp(m.intersection))||p.push(m.intersection);return p}function r(l,f,d,h){const p=n.getState();if(l.length){const v={stopped:!1};for(const y of l){const S=Su(y.object)||p,{raycaster:x,pointer:m,camera:A,internal:M}=S,w=new F(m.x,m.y,0).unproject(A),T=P=>{var H,J;return(H=(J=M.capturedMap.get(P))==null?void 0:J.has(y.eventObject))!=null?H:!1},b=P=>{const H={intersection:y,target:f.target};M.capturedMap.has(P)?M.capturedMap.get(P).set(y.eventObject,H):M.capturedMap.set(P,new Map([[y.eventObject,H]])),f.target.setPointerCapture(P)},B=P=>{const H=M.capturedMap.get(P);H&&wb(M.capturedMap,y.eventObject,H,P)};let I={};for(let P in f){let H=f[P];typeof H!="function"&&(I[P]=H)}let R={...y,...I,pointer:m,intersections:l,stopped:v.stopped,delta:d,unprojectedPoint:w,ray:x.ray,camera:A,stopPropagation(){const P="pointerId"in f&&M.capturedMap.get(f.pointerId);if((!P||P.has(y.eventObject))&&(R.stopped=v.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(H=>H.eventObject===y.eventObject))){const H=l.slice(0,l.indexOf(y));s([...H,y])}},target:{hasPointerCapture:T,setPointerCapture:b,releasePointerCapture:B},currentTarget:{hasPointerCapture:T,setPointerCapture:b,releasePointerCapture:B},nativeEvent:f};if(h(R),v.stopped===!0)break}}return l}function s(l){const{internal:f}=n.getState();for(const d of f.hovered.values())if(!l.length||!l.find(h=>h.object===d.object&&h.index===d.index&&h.instanceId===d.instanceId)){const p=d.eventObject.__r3f,v=p==null?void 0:p.handlers;if(f.hovered.delete(lp(d)),p!=null&&p.eventCount){const y={...d,intersections:l};v.onPointerOut==null||v.onPointerOut(y),v.onPointerLeave==null||v.onPointerLeave(y)}}}function o(l,f){for(let d=0;ds([]);case"onLostPointerCapture":return f=>{const{internal:d}=n.getState();"pointerId"in f&&d.capturedMap.has(f.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(f.pointerId)&&(d.capturedMap.delete(f.pointerId),s([]))})}}return function(d){const{onPointerMissed:h,internal:p}=n.getState();p.lastEvent.current=d;const v=l==="onPointerMove",y=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",x=i(d,v?t:void 0),m=y?e(d):0;l==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=x.map(M=>M.eventObject)),y&&!x.length&&m<=2&&(o(d,p.interaction),h&&h(d)),v&&s(x);function A(M){const w=M.eventObject,T=w.__r3f,b=T==null?void 0:T.handlers;if(T!=null&&T.eventCount)if(v){if(b.onPointerOver||b.onPointerEnter||b.onPointerOut||b.onPointerLeave){const B=lp(M),I=p.hovered.get(B);I?I.stopped&&M.stopPropagation():(p.hovered.set(B,M),b.onPointerOver==null||b.onPointerOver(M),b.onPointerEnter==null||b.onPointerEnter(M))}b.onPointerMove==null||b.onPointerMove(M)}else{const B=b[l];B?(!y||p.initialHits.includes(w))&&(o(d,p.interaction.filter(I=>!p.initialHits.includes(I))),B(M)):y&&p.initialHits.includes(w)&&o(d,p.interaction.filter(I=>!p.initialHits.includes(I)))}}r(x,d,m,A)}}return{handlePointer:a}}const Cb=n=>!!(n!=null&&n.render),Tb=j.createContext(null),qO=(n,e)=>{const t=PO((a,l)=>{const f=new F,d=new F,h=new F;function p(m=l().camera,A=d,M=l().size){const{width:w,height:T,top:b,left:B}=M,I=w/T;A instanceof F?h.copy(A):h.set(...A);const R=m.getWorldPosition(f).distanceTo(h);if(_b(m))return{width:w/m.zoom,height:T/m.zoom,top:b,left:B,factor:1,distance:R,aspect:I};{const P=m.fov*Math.PI/180,H=2*Math.tan(P/2)*R,J=H*(w/T);return{width:J,height:H,top:b,left:B,factor:w/J,distance:R,aspect:I}}}let v;const y=m=>a(A=>({performance:{...A.performance,current:m}})),S=new pe;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(m=1)=>n(l(),m),advance:(m,A)=>e(m,A,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new $_,pointer:S,mouse:S,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const m=l();v&&clearTimeout(v),m.performance.current!==m.performance.min&&y(m.performance.min),v=setTimeout(()=>y(l().performance.max),m.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:m=>a(A=>({...A,events:{...A.events,...m}})),setSize:(m,A,M,w,T)=>{const b=l().camera,B={width:m,height:A,top:w||0,left:T||0,updateStyle:M};a(I=>({size:B,viewport:{...I.viewport,...p(b,d,B)}}))},setDpr:m=>a(A=>{const M=Mb(m);return{viewport:{...A.viewport,dpr:M,initialDpr:A.viewport.initialDpr||M}}}),setFrameloop:(m="always")=>{const A=l().clock;A.stop(),A.elapsedTime=0,m!=="never"&&(A.start(),A.elapsedTime=0),a(()=>({frameloop:m}))},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:(m,A,M)=>{const w=l().internal;return w.priority=w.priority+(A>0?1:0),w.subscribers.push({ref:m,priority:A,store:M}),w.subscribers=w.subscribers.sort((T,b)=>T.priority-b.priority),()=>{const T=l().internal;T!=null&&T.subscribers&&(T.priority=T.priority-(A>0?1:0),T.subscribers=T.subscribers.filter(b=>b.ref!==m))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:f,gl:d,set:h}=t.getState();if(l.width!==r.width||l.height!==r.height||f.dpr!==s){var p;r=l,s=f.dpr,KO(a,l),d.setPixelRatio(f.dpr);const v=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&d.domElement instanceof HTMLCanvasElement;d.setSize(l.width,l.height,v)}a!==o&&(o=a,h(v=>({viewport:{...v.viewport,...v.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};function $O(n,e){const t={callback:n};return e.add(t),()=>void e.delete(t)}let cp,Rb=new Set,e6=new Set,t6=new Set;const n6=n=>$O(n,Rb);function ey(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Mu(n,e){switch(n){case"before":return ey(Rb,e);case"after":return ey(e6,e);case"tail":return ey(t6,e)}}let ty,ny;function iy(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),ty=e.internal.subscribers,cp=0;cp0)&&!((f=r.gl.xr)!=null&&f.isPresenting)&&(t+=iy(l,r))}if(Mu("after",l),t===0)return Mu("tail",l),e=!1,cancelAnimationFrame(i)}function o(l,f=1){var d;if(!l)return n.forEach(h=>o(h.store.getState()),f);(d=l.gl.xr)!=null&&d.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+f),e||(e=!0,requestAnimationFrame(s)))}function a(l,f=!0,d,h){if(f&&Mu("before",l),d)iy(l,d,h);else for(const p of n.values())iy(l,p.store.getState());f&&Mu("after",l)}return{loop:s,invalidate:o,advance:a}}function bb(){const n=j.useContext(Tb);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function r6(n=t=>t,e){return bb()(n,e)}function E0(n,e=0){const t=bb(),i=t.getState().internal.subscribe,r=xb(n);return $f(()=>i(r,e,t),[e,i,t]),null}const ew=new WeakMap;function Bb(n,e){return function(t,...i){let r=ew.get(t);return r||(r=new t,ew.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,XO(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`)))))).finally(()=>r.dispose==null?void 0:r.dispose())}}function ed(n,e,t,i){const r=Array.isArray(e)?e:[e],s=OO(Bb(t,i),[n,...r],{equal:jt.equ});return Array.isArray(e)?s:s[0]}ed.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return kO(Bb(t),[n,...i])};ed.clear=function(n,e){const t=Array.isArray(e)?e:[e];return HO([n,...t])};const Mc=new Map,{invalidate:tw,advance:nw}=i6(Mc),{reconciler:_m,applyProps:da}=GO(Mc,YO),Bl={objects:"shallow",strict:!1},s6=(n,e)=>{const t=typeof n=="function"?n(e):n;return Cb(t)?t:new L_({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function o6(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function a6(n){const e=Mc.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||qO(tw,nw),o=t||_m.createContainer(s,Yl.ConcurrentRoot,null,!1,null,"",r,null);e||Mc.set(n,{fiber:o,store:s});let a,l=!1,f;return{configure(d={}){let{gl:h,size:p,scene:v,events:y,onCreated:S,shadows:x=!1,linear:m=!1,flat:A=!1,legacy:M=!1,orthographic:w=!1,frameloop:T="always",dpr:b=[1,2],performance:B,raycaster:I,camera:R,onPointerMissed:P}=d,H=s.getState(),J=H.gl;H.gl||H.set({gl:J=s6(h,n)});let te=H.raycaster;te||H.set({raycaster:te=new lb});const{params:V,...q}=I||{};if(jt.equ(q,te,Bl)||da(te,{...q}),jt.equ(V,te.params,Bl)||da(te,{params:{...te.params,...V}}),!H.camera||H.camera===f&&!jt.equ(f,R,Bl)){f=R;const $=R instanceof Vf,Z=$?R:w?new Lc(0,0,0,0,.1,1e3):new bn(75,0,.1,1e3);$||(Z.position.z=5,R&&da(Z,R),!H.camera&&!(R!=null&&R.rotation)&&Z.lookAt(0,0,0)),H.set({camera:Z}),te.camera=Z}if(!H.scene){let $;v instanceof vm?$=v:($=new vm,v&&da($,v)),H.set({scene:Ll($)})}if(!H.xr){var re;const $=(ge,we)=>{const Re=s.getState();Re.frameloop!=="never"&&nw(ge,!0,Re,we)},Z=()=>{const ge=s.getState();ge.gl.xr.enabled=ge.gl.xr.isPresenting,ge.gl.xr.setAnimationLoop(ge.gl.xr.isPresenting?$:null),ge.gl.xr.isPresenting||tw(ge)},ue={connect(){const ge=s.getState().gl;ge.xr.addEventListener("sessionstart",Z),ge.xr.addEventListener("sessionend",Z)},disconnect(){const ge=s.getState().gl;ge.xr.removeEventListener("sessionstart",Z),ge.xr.removeEventListener("sessionend",Z)}};typeof((re=J.xr)==null?void 0:re.addEventListener)=="function"&&ue.connect(),H.set({xr:ue})}if(J.shadowMap){const $=J.shadowMap.enabled,Z=J.shadowMap.type;if(J.shadowMap.enabled=!!x,jt.boo(x))J.shadowMap.type=Gu;else if(jt.str(x)){var ae;const ue={basic:rT,percentage:Qm,soft:Gu,variance:Mr};J.shadowMap.type=(ae=ue[x])!=null?ae:Gu}else jt.obj(x)&&Object.assign(J.shadowMap,x);($!==J.shadowMap.enabled||Z!==J.shadowMap.type)&&(J.shadowMap.needsUpdate=!0)}const D=yb();D&&("enabled"in D?D.enabled=!M:"legacyMode"in D&&(D.legacyMode=M)),da(J,{outputEncoding:m?3e3:3001,toneMapping:A?qr:f_}),H.legacy!==M&&H.set(()=>({legacy:M})),H.linear!==m&&H.set(()=>({linear:m})),H.flat!==A&&H.set(()=>({flat:A})),h&&!jt.fun(h)&&!Cb(h)&&!jt.equ(h,J,Bl)&&da(J,h),y&&!H.events.handlers&&H.set({events:y(s)});const Y=o6(n,p);return jt.equ(Y,H.size,Bl)||H.setSize(Y.width,Y.height,Y.updateStyle,Y.top,Y.left),b&&H.viewport.dpr!==Mb(b)&&H.setDpr(b),H.frameloop!==T&&H.setFrameloop(T),H.onPointerMissed||H.set({onPointerMissed:P}),B&&!jt.equ(B,H.performance,Bl)&&H.set($=>({performance:{...$.performance,...B}})),a=S,l=!0,this},render(d){return l||this.configure(),_m.updateContainer(j.createElement(l6,{store:s,children:d,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){Pb(n)}}}function l6({store:n,children:e,onCreated:t,rootElement:i}){return $f(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),j.createElement(Tb.Provider,{value:n},e)}function Pb(n,e){const t=Mc.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),_m.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),JO(r),Mc.delete(n),e&&e(n)}catch{}},500)})}}_m.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:j.version});function xm(){return xm=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?i=setTimeout(l,e-d):(i=null,t||(a=n.apply(s,r),s=r=null))}var f=function(){s=this,r=arguments,o=Date.now();var d=t&&!i;return i||(i=setTimeout(l,e)),d&&(a=n.apply(s,r),s=r=null),a};return f.clear=function(){i&&(clearTimeout(i),i=null)},f.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},f}n1.debounce=n1;var c6=n1;const iw=m1(c6);function u6(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:r}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=j.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=j.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),f=e?typeof e=="number"?e:e.scroll:null,d=e?typeof e=="number"?e:e.resize:null,h=j.useRef(!1);j.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[p,v,y]=j.useMemo(()=>{const A=()=>{if(!l.current.element)return;const{left:M,top:w,width:T,height:b,bottom:B,right:I,x:R,y:P}=l.current.element.getBoundingClientRect(),H={left:M,top:w,width:T,height:b,bottom:B,right:I,x:R,y:P};l.current.element instanceof HTMLElement&&r&&(H.height=l.current.element.offsetHeight,H.width=l.current.element.offsetWidth),Object.freeze(H),h.current&&!p6(l.current.lastBounds,H)&&a(l.current.lastBounds=H)};return[A,d?iw(A,d):A,f?iw(A,f):A]},[a,r,f,d]);function S(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(A=>A.removeEventListener("scroll",y,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function x(){l.current.element&&(l.current.resizeObserver=new s(y),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(A=>A.addEventListener("scroll",y,{capture:!0,passive:!0})))}const m=A=>{!A||A===l.current.element||(S(),l.current.element=A,l.current.scrollContainers=Lb(A),x())};return d6(y,!!t),f6(v),j.useEffect(()=>{S(),x()},[t,y,v]),j.useEffect(()=>S,[]),[m,o,p]}function f6(n){j.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function d6(n,e){j.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function Lb(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...Lb(n.parentElement)]}const h6=["x","y","top","bottom","left","right","width","height"],p6=(n,e)=>h6.every(t=>n[t]===e[t]);var m6=Object.defineProperty,g6=Object.defineProperties,v6=Object.getOwnPropertyDescriptors,rw=Object.getOwnPropertySymbols,y6=Object.prototype.hasOwnProperty,_6=Object.prototype.propertyIsEnumerable,sw=(n,e,t)=>e in n?m6(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ow=(n,e)=>{for(var t in e||(e={}))y6.call(e,t)&&sw(n,t,e[t]);if(rw)for(var t of rw(e))_6.call(e,t)&&sw(n,t,e[t]);return n},x6=(n,e)=>g6(n,v6(e));function Ib(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=Ib(i,e,t);if(r)return r;i=e?null:i.sibling}}function Db(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const rx=Db(j.createContext(null));class Nb extends j.Component{render(){return j.createElement(rx.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:aw,ReactCurrentDispatcher:lw}=j.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A6(){const n=j.useContext(rx);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=j.useId();return j.useMemo(()=>{for(const i of[aw==null?void 0:aw.current,n,n==null?void 0:n.alternate]){if(!i)continue;const r=Ib(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function S6(){var n,e;const t=A6(),[i]=j.useState(()=>new Map);i.clear();let r=t;for(;r;){const s=(n=r.type)==null?void 0:n._context;s&&s!==rx&&!i.has(s)&&i.set(s,(e=lw==null?void 0:lw.current)==null?void 0:e.readContext(Db(s))),r=r.return}return i}function M6(){const n=S6();return j.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>j.createElement(e,null,j.createElement(t.Provider,x6(ow({},i),{value:n.get(t)}))),e=>j.createElement(Nb,ow({},e))),[n])}const ry={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 E6(n){const{handlePointer:e}=ZO(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(ry).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,f]=ry[o];t.addEventListener(l,a,{passive:f})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=ry[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const w6=j.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=E6,eventSource:a,eventPrefix:l,shadows:f,linear:d,flat:h,legacy:p,orthographic:v,frameloop:y,dpr:S,performance:x,raycaster:m,camera:A,scene:M,onPointerMissed:w,onCreated:T,...b},B){j.useMemo(()=>vb(ub),[]);const I=M6(),[R,P]=u6({scroll:!0,debounce:{scroll:50,resize:0},...i}),H=j.useRef(null),J=j.useRef(null);j.useImperativeHandle(B,()=>H.current);const te=xb(w),[V,q]=j.useState(!1),[re,ae]=j.useState(!1);if(V)throw V;if(re)throw re;const D=j.useRef(null);$f(()=>{const G=H.current;P.width>0&&P.height>0&&G&&(D.current||(D.current=a6(G)),D.current.configure({gl:s,events:o,shadows:f,linear:d,flat:h,legacy:p,orthographic:v,frameloop:y,dpr:S,performance:x,raycaster:m,camera:A,scene:M,size:P,onPointerMissed:(...Y)=>te.current==null?void 0:te.current(...Y),onCreated:Y=>{Y.events.connect==null||Y.events.connect(a?zO(a)?a.current:a:J.current),l&&Y.setEvents({compute:($,Z)=>{const ue=$[l+"X"],ge=$[l+"Y"];Z.pointer.set(ue/Z.size.width*2-1,-(ge/Z.size.height)*2+1),Z.raycaster.setFromCamera(Z.pointer,Z.camera)}}),T==null||T(Y)}}),D.current.render(j.createElement(I,null,j.createElement(Ab,{set:ae},j.createElement(j.Suspense,{fallback:j.createElement(VO,{set:q})},e)))))}),j.useEffect(()=>{const G=H.current;if(G)return()=>Pb(G)},[]);const k=a?"none":"auto";return j.createElement("div",xm({ref:J,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:k,...r}},b),j.createElement("div",{ref:R,style:{width:"100%",height:"100%"}},j.createElement("canvas",{ref:H,style:{display:"block"}},t)))}),Fb=j.forwardRef(function(e,t){return j.createElement(Nb,null,j.createElement(w6,xm({},e,{ref:t})))}),C6=()=>ne.jsx("div",{className:"flex justify-center items-center",children:ne.jsx("div",{className:`w-20 h-20 border-2 border-opacity-20\r + border-blue-500 border-t-blue-500 rounded-full animate-spin`})});let sx=nd();const bt=n=>td(n,sx);let ox=nd();bt.write=n=>td(n,ox);let w0=nd();bt.onStart=n=>td(n,w0);let ax=nd();bt.onFrame=n=>td(n,ax);let lx=nd();bt.onFinish=n=>td(n,lx);let rc=[];bt.setTimeout=(n,e)=>{let t=bt.now()+e,i=()=>{let s=rc.findIndex(o=>o.cancel==i);~s&&rc.splice(s,1),go-=~s?1:0},r={time:t,handler:n,cancel:i};return rc.splice(Ub(t),0,r),go+=1,Ob(),r};let Ub=n=>~(~rc.findIndex(e=>e.time>n)||~rc.length);bt.cancel=n=>{w0.delete(n),ax.delete(n),lx.delete(n),sx.delete(n),ox.delete(n)};bt.sync=n=>{i1=!0,bt.batchedUpdates(n),i1=!1};bt.throttle=n=>{let e;function t(){try{n(...e)}finally{e=null}}function i(...r){e=r,bt.onStart(t)}return i.handler=n,i.cancel=()=>{w0.delete(t),e=null},i};let cx=typeof window<"u"?window.requestAnimationFrame:()=>{};bt.use=n=>cx=n;bt.now=typeof performance<"u"?()=>performance.now():Date.now;bt.batchedUpdates=n=>n();bt.catch=console.error;bt.frameLoop="always";bt.advance=()=>{bt.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Hb()};let mo=-1,go=0,i1=!1;function td(n,e){i1?(e.delete(n),n(0)):(e.add(n),Ob())}function Ob(){mo<0&&(mo=0,bt.frameLoop!=="demand"&&cx(kb))}function T6(){mo=-1}function kb(){~mo&&(cx(kb),bt.batchedUpdates(Hb))}function Hb(){let n=mo;mo=bt.now();let e=Ub(mo);if(e&&(Gb(rc.splice(0,e),t=>t.handler()),go-=e),!go){T6();return}w0.flush(),sx.flush(n?Math.min(64,mo-n):16.667),ax.flush(),ox.flush(),lx.flush()}function nd(){let n=new Set,e=n;return{add(t){go+=e==n&&!n.has(t)?1:0,n.add(t)},delete(t){return go-=e==n&&n.has(t)?1:0,n.delete(t)},flush(t){e.size&&(n=new Set,go-=e.size,Gb(e,i=>i(t)&&n.add(i)),go+=n.size,e=n)}}}function Gb(n,e){n.forEach(t=>{try{e(t)}catch(i){bt.catch(i)}})}function R6(){}const b6=(n,e,t)=>Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0}),pn={arr:Array.isArray,obj:n=>!!n&&n.constructor.name==="Object",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",und:n=>n===void 0};function B6(n,e){if(pn.arr(n)){if(!pn.arr(e)||n.length!==e.length)return!1;for(let t=0;tn.forEach(e);function r1(n,e,t){if(pn.arr(n)){for(let i=0;ipn.und(n)?[]:pn.arr(n)?n:[n],ux=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let fx,zb,bo=null,Vb=!1,dx=R6;const P6=n=>{n.to&&(zb=n.to),n.now&&(bt.now=n.now),n.colors!==void 0&&(bo=n.colors),n.skipAnimation!=null&&(Vb=n.skipAnimation),n.createStringInterpolator&&(fx=n.createStringInterpolator),n.requestAnimationFrame&&bt.use(n.requestAnimationFrame),n.batchedUpdates&&(bt.batchedUpdates=n.batchedUpdates),n.willAdvance&&(dx=n.willAdvance),n.frameLoop&&(bt.frameLoop=n.frameLoop)};var Rf=Object.freeze({__proto__:null,get createStringInterpolator(){return fx},get to(){return zb},get colors(){return bo},get skipAnimation(){return Vb},get willAdvance(){return dx},assign:P6});const Ju=new Set;let fr=[],sy=[],Am=0;const hx={get idle(){return!Ju.size&&!fr.length},start(n){Am>n.priority?(Ju.add(n),bt.onStart(L6)):(Wb(n),bt(s1))},advance:s1,sort(n){if(Am)bt.onFrame(()=>hx.sort(n));else{const e=fr.indexOf(n);~e&&(fr.splice(e,1),Xb(n))}},clear(){fr=[],Ju.clear()}};function L6(){Ju.forEach(Wb),Ju.clear(),bt(s1)}function Wb(n){fr.includes(n)||Xb(n)}function Xb(n){fr.splice(I6(fr,e=>e.priority>n.priority),0,n)}function s1(n){const e=sy;for(let t=0;t0}function I6(n,e){const t=n.findIndex(e);return t<0?n.length:t}const D6=(n,e,t)=>Math.min(Math.max(t,n),e),N6={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Br="[-+]?\\d*\\.?\\d+",Sm=Br+"%";function C0(...n){return"\\(\\s*("+n.join(")\\s*,\\s*(")+")\\s*\\)"}const F6=new RegExp("rgb"+C0(Br,Br,Br)),U6=new RegExp("rgba"+C0(Br,Br,Br,Br)),O6=new RegExp("hsl"+C0(Br,Sm,Sm)),k6=new RegExp("hsla"+C0(Br,Sm,Sm,Br)),H6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,G6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,z6=/^#([0-9a-fA-F]{6})$/,V6=/^#([0-9a-fA-F]{8})$/;function W6(n){let e;return typeof n=="number"?n>>>0===n&&n>=0&&n<=4294967295?n:null:(e=z6.exec(n))?parseInt(e[1]+"ff",16)>>>0:bo&&bo[n]!==void 0?bo[n]:(e=F6.exec(n))?(Pl(e[1])<<24|Pl(e[2])<<16|Pl(e[3])<<8|255)>>>0:(e=U6.exec(n))?(Pl(e[1])<<24|Pl(e[2])<<16|Pl(e[3])<<8|fw(e[4]))>>>0:(e=H6.exec(n))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=V6.exec(n))?parseInt(e[1],16)>>>0:(e=G6.exec(n))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=O6.exec(n))?(cw(uw(e[1]),fp(e[2]),fp(e[3]))|255)>>>0:(e=k6.exec(n))?(cw(uw(e[1]),fp(e[2]),fp(e[3]))|fw(e[4]))>>>0:null}function oy(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function cw(n,e,t){const i=t<.5?t*(1+e):t+e-t*e,r=2*t-i,s=oy(r,i,n+1/3),o=oy(r,i,n),a=oy(r,i,n-1/3);return Math.round(s*255)<<24|Math.round(o*255)<<16|Math.round(a*255)<<8}function Pl(n){const e=parseInt(n,10);return e<0?0:e>255?255:e}function uw(n){return(parseFloat(n)%360+360)%360/360}function fw(n){const e=parseFloat(n);return e<0?0:e>1?255:Math.round(e*255)}function fp(n){const e=parseFloat(n);return e<0?0:e>100?1:e/100}function dw(n){let e=W6(n);if(e===null)return n;e=e||0;let t=(e&4278190080)>>>24,i=(e&16711680)>>>16,r=(e&65280)>>>8,s=(e&255)/255;return`rgba(${t}, ${i}, ${r}, ${s})`}const bf=(n,e,t)=>{if(pn.fun(n))return n;if(pn.arr(n))return bf({range:n,output:e,extrapolate:t});if(pn.str(n.output[0]))return fx(n);const i=n,r=i.output,s=i.range||[0,1],o=i.extrapolateLeft||i.extrapolate||"extend",a=i.extrapolateRight||i.extrapolate||"extend",l=i.easing||(f=>f);return f=>{const d=J6(f,s);return X6(f,s[d],s[d+1],r[d],r[d+1],l,o,a,i.map)}};function X6(n,e,t,i,r,s,o,a,l){let f=l?l(n):n;if(ft){if(a==="identity")return f;a==="clamp"&&(f=t)}return i===r?i:e===t?n<=e?i:r:(e===-1/0?f=-f:t===1/0?f=f-e:f=(f-e)/(t-e),f=s(f),i===-1/0?f=-f:r===1/0?f=f+i:f=f*(r-i)+i,f)}function J6(n,e){for(var t=1;t=n);++t);return t-1}const j6=(n,e="end")=>t=>{t=e==="end"?Math.min(t,.999):Math.max(t,.001);const i=t*n,r=e==="end"?Math.floor(i):Math.ceil(i);return D6(0,1,r/n)},Mm=1.70158,dp=Mm*1.525,hw=Mm+1,pw=2*Math.PI/3,mw=2*Math.PI/4.5,hp=n=>n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375,K6={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>1-(1-n)*(1-n),easeInOutQuad:n=>n<.5?2*n*n:1-Math.pow(-2*n+2,2)/2,easeInCubic:n=>n*n*n,easeOutCubic:n=>1-Math.pow(1-n,3),easeInOutCubic:n=>n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,easeInQuart:n=>n*n*n*n,easeOutQuart:n=>1-Math.pow(1-n,4),easeInOutQuart:n=>n<.5?8*n*n*n*n:1-Math.pow(-2*n+2,4)/2,easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>1-Math.pow(1-n,5),easeInOutQuint:n=>n<.5?16*n*n*n*n*n:1-Math.pow(-2*n+2,5)/2,easeInSine:n=>1-Math.cos(n*Math.PI/2),easeOutSine:n=>Math.sin(n*Math.PI/2),easeInOutSine:n=>-(Math.cos(Math.PI*n)-1)/2,easeInExpo:n=>n===0?0:Math.pow(2,10*n-10),easeOutExpo:n=>n===1?1:1-Math.pow(2,-10*n),easeInOutExpo:n=>n===0?0:n===1?1:n<.5?Math.pow(2,20*n-10)/2:(2-Math.pow(2,-20*n+10))/2,easeInCirc:n=>1-Math.sqrt(1-Math.pow(n,2)),easeOutCirc:n=>Math.sqrt(1-Math.pow(n-1,2)),easeInOutCirc:n=>n<.5?(1-Math.sqrt(1-Math.pow(2*n,2)))/2:(Math.sqrt(1-Math.pow(-2*n+2,2))+1)/2,easeInBack:n=>hw*n*n*n-Mm*n*n,easeOutBack:n=>1+hw*Math.pow(n-1,3)+Mm*Math.pow(n-1,2),easeInOutBack:n=>n<.5?Math.pow(2*n,2)*((dp+1)*2*n-dp)/2:(Math.pow(2*n-2,2)*((dp+1)*(n*2-2)+dp)+2)/2,easeInElastic:n=>n===0?0:n===1?1:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*pw),easeOutElastic:n=>n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n*10-.75)*pw)+1,easeInOutElastic:n=>n===0?0:n===1?1:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*mw))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*mw)/2+1,easeInBounce:n=>1-hp(1-n),easeOutBounce:hp,easeInOutBounce:n=>n<.5?(1-hp(1-2*n))/2:(1+hp(2*n-1))/2,steps:j6};function o1(){return o1=Object.assign?Object.assign.bind():function(n){for(var e=1;e!!(n&&n[Ec]),wm=n=>n&&n[Ec]?n[Ec]():n;function Y6(n,e){n.eventObserved?n.eventObserved(e):n(e)}function a1(n,e){let t=n[wc];t&&t.forEach(i=>{Y6(i,e)})}class Q6{constructor(e){if(this[Ec]=void 0,this[wc]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Z6(this,e)}}const Z6=(n,e)=>jb(n,Ec,e);function Jb(n,e){if(n[Ec]){let t=n[wc];t||jb(n,wc,t=new Set),t.has(e)||(t.add(e),n.observerAdded&&n.observerAdded(t.size,e))}return e}function l1(n,e){let t=n[wc];if(t&&t.has(e)){const i=t.size-1;i?t.delete(e):n[wc]=null,n.observerRemoved&&n.observerRemoved(i,e)}}const jb=(n,e,t)=>Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0}),Up=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q6=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,gw=new RegExp(`(${Up.source})(%|[a-z]+)`,"i"),$6=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,T0=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Kb=n=>{const[e,t]=ek(n);if(!e||ux())return n;const i=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(i)return i.trim();if(t&&t.startsWith("--")){const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r||n}else{if(t&&T0.test(t))return Kb(t);if(t)return t}return n},ek=n=>{const e=T0.exec(n);if(!e)return[,];const[,t,i]=e;return[t,i]};let ay;const tk=(n,e,t,i,r)=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(i)}, ${r})`,Yb=n=>{ay||(ay=bo?new RegExp(`(${Object.keys(bo).join("|")})(?!\\w)`,"g"):/^\b$/);const e=n.output.map(s=>wm(s).replace(T0,Kb).replace(q6,dw).replace(ay,dw)),t=e.map(s=>s.match(Up).map(Number)),r=t[0].map((s,o)=>t.map(a=>{if(!(o in a))throw Error('The arity of each "output" value must be equal');return a[o]})).map(s=>bf(o1({},n,{output:s})));return s=>{var o;const a=!gw.test(e[0])&&((o=e.find(f=>gw.test(f)))==null?void 0:o.replace(Up,""));let l=0;return e[0].replace(Up,()=>`${r[l++](s)}${a||""}`).replace($6,tk)}},Qb="react-spring: ",Zb=n=>{const e=n;let t=!1;if(typeof e!="function")throw new TypeError(`${Qb}once requires a function parameter`);return(...i)=>{t||(e(...i),t=!0)}},nk=Zb(console.warn);function ik(){nk(`${Qb}The "interpolate" function is deprecated in v9 (use "to" instead)`)}Zb(console.warn);function qb(n){return pn.str(n)&&(n[0]=="#"||/\d/.test(n)||!ux()&&T0.test(n)||n in(bo||{}))}const $b=ux()?j.useEffect:j.useLayoutEffect,rk=()=>{const n=j.useRef(!1);return $b(()=>(n.current=!0,()=>{n.current=!1}),[]),n};function sk(){const n=j.useState()[1],e=rk();return()=>{e.current&&n(Math.random())}}function ok(n,e){const[t]=j.useState(()=>({inputs:e,result:n()})),i=j.useRef(),r=i.current;let s=r;return s?e&&s.inputs&&ak(e,s.inputs)||(s={inputs:e,result:n()}):s=t,j.useEffect(()=>{i.current=s,r==t&&(t.inputs=t.result=void 0)},[s]),s.result}function ak(n,e){if(n.length!==e.length)return!1;for(let t=0;tj.useEffect(n,ck),ck=[],Bf=Symbol.for("Animated:node"),uk=n=>!!n&&n[Bf]===n,px=n=>n&&n[Bf],eB=(n,e)=>b6(n,Bf,e),mx=n=>n&&n[Bf]&&n[Bf].getPayload();class tB{constructor(){this.payload=void 0,eB(this,this)}getPayload(){return this.payload||[]}}class id extends tB{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,pn.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new id(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return pn.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,pn.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class R0 extends id{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=bf({output:[e,e]})}static create(e){return new R0(e)}getValue(){let e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(pn.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=bf({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Cm={dependencies:null};class gx extends tB{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return r1(this.source,(i,r)=>{uk(i)?t[r]=i.getValue(e):Em(i)?t[r]=wm(i):e||(t[r]=i)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Rs(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return r1(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Cm.dependencies&&Em(e)&&Cm.dependencies.add(e);const t=mx(e);t&&Rs(t,i=>this.add(i))}}class vx extends gx{constructor(e){super(e)}static create(e){return new vx(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((i,r)=>i.setValue(e[r])).some(Boolean):(super.setValue(e.map(fk)),!0)}}function fk(n){return(qb(n)?R0:id).create(n)}function dk(n){const e=px(n);return e?e.constructor:pn.arr(n)?vx:qb(n)?R0:id}function Tm(){return Tm=Object.assign?Object.assign.bind():function(n){for(var e=1;e{const t=!pn.fun(n)||n.prototype&&n.prototype.isReactComponent;return j.forwardRef((i,r)=>{const s=j.useRef(null),o=t&&j.useCallback(y=>{s.current=mk(r,y)},[r]),[a,l]=pk(i,e),f=sk(),d=()=>{const y=s.current;if(t&&!y)return;(y?e.applyAnimatedValues(y,a.getValue(!0)):!1)===!1&&f()},h=new hk(d,l),p=j.useRef();$b(()=>(p.current=h,Rs(l,y=>Jb(y,h)),()=>{p.current&&(Rs(p.current.deps,y=>l1(y,p.current)),bt.cancel(p.current.update))})),j.useEffect(d,[]),lk(()=>()=>{const y=p.current;Rs(y.deps,S=>l1(S,y))});const v=e.getComponentProps(a.getValue());return j.createElement(n,Tm({},v,{ref:o}))})};class hk{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&bt.write(this.update)}}function pk(n,e){const t=new Set;return Cm.dependencies=t,n.style&&(n=Tm({},n,{style:e.createAnimatedStyle(n.style)})),n=new gx(n),Cm.dependencies=null,[n,t]}function mk(n,e){return n&&(pn.fun(n)?n(e):n.current=e),e}const yw=Symbol.for("AnimatedComponent"),gk=(n,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:t=r=>new gx(r),getComponentProps:i=r=>r}={})=>{const r={applyAnimatedValues:e,createAnimatedStyle:t,getComponentProps:i},s=o=>{const a=_w(o)||"Anonymous";return pn.str(o)?o=s[o]||(s[o]=vw(o,r)):o=o[yw]||(o[yw]=vw(o,r)),o.displayName=`Animated(${a})`,o};return r1(n,(o,a)=>{pn.arr(n)&&(a=_w(o)),s[a]=s(o)}),{animated:s}},_w=n=>pn.str(n)?n:n&&pn.str(n.displayName)?n.displayName:pn.fun(n)&&n.name||null;function c1(){return c1=Object.assign?Object.assign.bind():function(n){for(var e=1;en instanceof nB;let yk=1;class nB extends Q6{constructor(...e){super(...e),this.id=yk++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=px(this);return e&&e.getValue()}to(...e){return Rf.to(this,e)}interpolate(...e){return ik(),Rf.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){a1(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||hx.sort(this),a1(this,{type:"priority",parent:this,priority:e})}}function _k(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s=0)&&(t[r]=n[r]);return t}const xk=["children"],yx=n=>{let{children:e}=n,t=_k(n,xk);const i=j.useContext(Rm),r=t.pause||!!i.pause,s=t.immediate||!!i.immediate;t=ok(()=>({pause:r,immediate:s}),[r,s]);const{Provider:o}=Rm;return j.createElement(o,{value:t},e)},Rm=Ak(yx,{});yx.Provider=Rm.Provider;yx.Consumer=Rm.Consumer;function Ak(n,e){return Object.assign(n,j.createContext(e)),n.Provider._context=n,n.Consumer._context=n,n}let Aw;(function(n){n.MOUNT="mount",n.ENTER="enter",n.UPDATE="update",n.LEAVE="leave"})(Aw||(Aw={}));class Sk extends nB{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=bf(...t);const i=this._get(),r=dk(i);eB(this,r.create(i))}advance(e){const t=this._get(),i=this.get();B6(t,i)||(px(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Sw(this._active)&&ly(this)}_get(){const e=pn.arr(this.source)?this.source.map(wm):up(wm(this.source));return this.calc(...e)}_start(){this.idle&&!Sw(this._active)&&(this.idle=!1,Rs(mx(this),e=>{e.done=!1}),Rf.skipAnimation?(bt.batchedUpdates(()=>this.advance()),ly(this)):hx.start(this))}_attach(){let e=1;Rs(up(this.source),t=>{Em(t)&&Jb(t,this),xw(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Rs(up(this.source),e=>{Em(e)&&l1(e,this)}),this._active.clear(),ly(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=up(this.source).reduce((t,i)=>Math.max(t,(xw(i)?i.priority:0)+1),0))}}function Mk(n){return n.idle!==!1}function Sw(n){return!n.size||Array.from(n).every(Mk)}function ly(n){n.idle||(n.idle=!0,Rs(mx(n),e=>{e.done=!0}),a1(n,{type:"idle",parent:n}))}Rf.assign({createStringInterpolator:Yb,to:(n,e)=>new Sk(n,e)});const Ek=["primitive"].concat(Object.keys(ub).filter(n=>/^[A-Z]/.test(n)).map(n=>n[0].toLowerCase()+n.slice(1)));Rf.assign({createStringInterpolator:Yb,colors:N6,frameLoop:"demand"});n6(()=>{bt.advance()});const wk=gk(Ek,{applyAnimatedValues:da}),Ck=wk.animated;function Mw(n,e){if(e===JT)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===pm||e===x_){let t=n.getIndex();if(t===null){const o=[],a=n.getAttribute("position");if(a!==void 0){for(let l=0;l=2.0 are supported."));return}const l=new r7(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let f=0;f=0&&a[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function Rk(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const Tt={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_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_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 bk{constructor(e){this.parser=e,this.name=Tt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class Gk{constructor(e){this.parser=e,this.name=Tt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const f=i.options.manager.getHandler(a.uri);f!==null&&(l=f)}return this.detectSupport().then(function(f){if(f)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class zk{constructor(e){this.parser=e,this.name=Tt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const f=i.options.manager.getHandler(a.uri);f!==null&&(l=f)}return this.detectSupport().then(function(f){if(f)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Vk{constructor(e){this.name=Tt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,f=r.byteLength||0,d=r.count,h=r.byteStride,p=new Uint8Array(a,l,f);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,h,p,r.mode,r.filter).then(function(v){return v.buffer}):o.ready.then(function(){const v=new ArrayBuffer(d*h);return o.decodeGltfBuffer(new Uint8Array(v),d,h,p,r.mode,r.filter),v})})}else return null}}class Wk{constructor(e){this.name=Tt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const f of r.primitives)if(f.mode!==lr.TRIANGLES&&f.mode!==lr.TRIANGLE_STRIP&&f.mode!==lr.TRIANGLE_FAN&&f.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const f in o)a.push(this.parser.getDependency("accessor",o[f]).then(d=>(l[f]=d,l[f])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(f=>{const d=f.pop(),h=d.isGroup?d.children:[d],p=f[0].count,v=[];for(const y of h){const S=new $e,x=new F,m=new ai,A=new F(1,1,1),M=new N_(y.geometry,y.material,p);for(let w=0;w=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},to={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Zk={CUBICSPLINE:void 0,LINEAR:Na,STEP:mc},uy={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function qk(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new qf({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ns})),n.DefaultMaterial}function aa(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function ao(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function $k(n,e,t){let i=!1,r=!1,s=!1;for(let f=0,d=e.length;f0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const i7=new $e;class r7{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Rk,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,s=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,s=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||r&&s<98?this.textureLoader=new YR(this.options.manager):this.textureLoader=new ib(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new ji(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};aa(s,a,r),ao(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[f,d]of o.children.entries())s(d,a.children[f])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&x.setY(R,b[B*l+1]),l>=3&&x.setZ(R,b[B*l+2]),l>=4&&x.setW(R,b[B*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return x})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const f=this.loadImageSource(t,i).then(function(d){d.flipY=!1,d.name=o.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const p=(s.samplers||{})[o.sampler]||{};return d.magFilter=ww[p.magFilter]||nn,d.minFilter=ww[p.minFilter]||is,d.wrapS=Cw[p.wrapS]||Io,d.wrapT=Cw[p.wrapT]||Io,r.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=f,f}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",f=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(h){f=!0;const p=new Blob([h],{type:o.mimeType});return l=a.createObjectURL(p),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(l).then(function(h){return new Promise(function(p,v){let y=p;t.isImageBitmapLoader===!0&&(y=function(S){const x=new qt(S);x.needsUpdate=!0,p(x)}),t.load(ts.resolveURL(h,s.path),y,void 0,v)})}).then(function(h){return f===!0&&a.revokeObjectURL(l),h.userData.mimeType=o.mimeType||n7(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=d,d}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[Tt.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Tt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[Tt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&("colorSpace"in o?o.colorSpace=r===3001?"srgb":"srgb-linear":o.encoding=r),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new a0,wn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new ui,wn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return qf}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},f=[];if(l[Tt.KHR_MATERIALS_UNLIT]){const h=r[Tt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),f.push(h.extendParams(a,s,t))}else{const h=s.pbrMetallicRoughness||{};if(a.color=new Pe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){const p=h.baseColorFactor;a.color.fromArray(p),a.opacity=p[3]}h.baseColorTexture!==void 0&&f.push(t.assignTexture(a,"map",h.baseColorTexture,3001)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(f.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),f.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),f.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Tr);const d=s.alphaMode||uy.OPAQUE;if(d===uy.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===uy.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Vi&&(f.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new pe(1,1),s.normalTexture.scale!==void 0)){const h=s.normalTexture.scale;a.normalScale.set(h,h)}return s.occlusionTexture!==void 0&&o!==Vi&&(f.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Vi&&(a.emissive=new Pe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==Vi&&f.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,3001)),Promise.all(f).then(function(){const h=new o(a);return s.name&&(h.name=s.name),ao(h,s),t.associations.set(h,{materials:e}),s.extensions&&aa(r,h,s),h})}createUniqueName(e){const t=Rt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[Tt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return Tw(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&e7(m,s),m.name=t.createUniqueName(s.name||"mesh_"+e),ao(m,s),x.extensions&&aa(r,m,x),t.assignFinalMaterial(m),h.push(m)}for(let v=0,y=h.length;v1?d=new ws:f.length===1?d=f[0]:d=new wt,d!==f[0])for(let h=0,p=f.length;h{const h=new Map;for(const[p,v]of r.associations)(p instanceof wn||p instanceof qt)&&h.set(p,v);return d.traverse(p=>{const v=r.associations.get(p);v!=null&&h.set(p,v)}),h};return r.associations=f(s),s})}}function s7(n,e,t){const i=e.attributes,r=new li;if(i.POSITION!==void 0){const a=t.json.accessors[i.POSITION],l=a.min,f=a.max;if(l!==void 0&&f!==void 0){if(r.set(new F(l[0],l[1],l[2]),new F(f[0],f[1],f[2])),a.normalized){const d=f1(sc[a.componentType]);r.min.multiplyScalar(d),r.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new F,l=new F;for(let f=0,d=s.length;f{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(r)},i,r)}decodeDracoFile(e,t,i,r){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const f=t.attributeTypes[l];f.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=f.name)}const i=JSON.stringify(t);if(dy.has(e)){const l=dy.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(r=l,new Promise((f,d)=>{r._callbacks[s]={resolve:f,reject:d},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),dy.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new mt;e.index&&t.setIndex(new Bt(e.index.array,1));for(let i=0;i{i.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=a7.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const h=d.draco,p=new h.Decoder,v=new h.DecoderBuffer;v.Init(new Int8Array(l),l.byteLength);try{const y=t(h,p,v,f),S=y.attributes.map(x=>x.array.buffer);y.index&&S.push(y.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:y},S)}catch(y){console.error(y),self.postMessage({type:"error",id:a.id,error:y.message})}finally{h.destroy(v),h.destroy(p)}});break}};function t(o,a,l,f){const d=f.attributeIDs,h=f.attributeTypes;let p,v;const y=a.GetEncodedGeometryType(l);if(y===o.TRIANGULAR_MESH)p=new o.Mesh,v=a.DecodeBufferToMesh(l,p);else if(y===o.POINT_CLOUD)p=new o.PointCloud,v=a.DecodeBufferToPointCloud(l,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!v.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+v.error_msg());const S={index:null,attributes:[]};for(const x in d){const m=self[h[x]];let A,M;if(f.useUniqueIDs)M=d[x],A=a.GetAttributeByUniqueId(p,M);else{if(M=a.GetAttributeId(p,o[d[x]]),M===-1)continue;A=a.GetAttribute(p,M)}S.attributes.push(r(o,a,p,x,m,A))}return y===o.TRIANGULAR_MESH&&(S.index=i(o,a,p)),o.destroy(p),S}function i(o,a,l){const d=l.num_faces()*3,h=d*4,p=o._malloc(h);a.GetTrianglesUInt32Array(l,h,p);const v=new Uint32Array(o.HEAPF32.buffer,p,d).slice();return o._free(p),{array:v,itemSize:1}}function r(o,a,l,f,d,h){const p=h.num_components(),y=l.num_points()*p,S=y*d.BYTES_PER_ELEMENT,x=s(o,d),m=o._malloc(S);a.GetAttributeDataArrayForAllPoints(l,h,x,S,m);const A=new d(o.HEAPF32.buffer,m,y).slice();return o._free(m),{name:f,array:A,itemSize:p}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let pp;const hy=()=>{if(pp)return pp;const n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let r=n;WebAssembly.validate(t)&&(r=e);let s;const o=WebAssembly.instantiate(a(r),{}).then(h=>{s=h.instance,s.exports.__wasm_call_ctors()});function a(h){const p=new Uint8Array(h.length);for(let y=0;y96?S-71:S>64?S-65:S>47?S+4:S>46?63:62}let v=0;for(let y=0;y{t&&t(i),n&&(mp||(mp=new o7),mp.setDecoderPath(typeof n=="string"?n:sB),i.setDRACOLoader(mp)),e&&i.setMeshoptDecoder(typeof hy=="function"?hy():hy)}}function Us(n,e=!0,t=!0,i){return ed(_x,n,oB(e,t,i))}Us.preload=(n,e=!0,t=!0,i)=>ed.preload(_x,n,oB(e,t,i));Us.clear=n=>ed.clear(_x,n);Us.setDecoderPath=n=>{sB=n};function xx(n,e){const t=j.useRef(),[i]=j.useState(()=>e?e instanceof wt?{current:e}:e:t),[r]=j.useState(()=>new ab(void 0));j.useLayoutEffect(()=>{e&&(i.current=e instanceof wt?e:e.current),r._root=i.current});const s=j.useRef({}),o=j.useMemo(()=>{const a={};return n.forEach(l=>Object.defineProperty(a,l.name,{enumerable:!0,get(){if(i.current)return s.current[l.name]||(s.current[l.name]=r.clipAction(l,i.current))},configurable:!0})),{ref:i,clips:n,actions:a,names:n.map(l=>l.name),mixer:r}},[n]);return E0((a,l)=>r.update(l)),j.useEffect(()=>{const a=i.current;return()=>{s.current={},r.stopAllAction(),Object.values(o.actions).forEach(l=>{a&&r.uncacheAction(l,a)})}},[n]),o}var aB={exports:{}},l7="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",c7=l7,u7=c7;function lB(){}function cB(){}cB.resetWarningCache=lB;var f7=function(){function n(i,r,s,o,a,l){if(l!==u7){var f=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 f.name="Invariant Violation",f}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:cB,resetWarningCache:lB};return t.PropTypes=t,t};aB.exports=f7();var uB=aB.exports;const d7="/assets/island-Te-uwlMA.glb",h7=({isRotating:n,setIsRotating:e,setCurrentStage:t,...i})=>{const r=j.useRef(),{gl:s,viewport:o}=r6(),{nodes:a,materials:l}=Us(d7),f=j.useRef(0),d=j.useRef(0),h=.95,p=m=>{m.stopPropagation(),m.preventDefault(),e(!0);const A=m.touches?m.touches[0].clientX:m.clientX;f.current=A},v=m=>{m.stopPropagation(),m.preventDefault(),e(!1)},y=m=>{if(m.stopPropagation(),m.preventDefault(),n){const A=m.touches?m.touches[0].clientX:m.clientX,M=(A-f.current)/o.width;r.current.rotation.y+=M*.01*Math.PI,f.current=A,d.current=M*.01*Math.PI}},S=m=>{m.key==="ArrowLeft"?(n||e(!0),r.current.rotation.y+=.01*Math.PI,d.current=.017):m.key==="ArrowRight"&&(n||e(!0),r.current.rotation.y-=.01*Math.PI,d.current=-.017)},x=m=>{(m.key==="ArrowLeft"||m.key==="ArrowRight")&&e(!1)};return E0(()=>{if(!n)d.current*=h,Math.abs(d.current)<.001&&(d.current=0),r.current.rotation.y+=d.current;else{const A=(r.current.rotation.y%(2*Math.PI)+2*Math.PI)%(2*Math.PI);switch(!0){case(A>=5.45&&A<=5.85):t(4);break;case(A>=.85&&A<=1.3):t(3);break;case(A>=2.4&&A<=2.6):t(2);break;case(A>=4.25&&A<=4.75):t(1);break;default:t(null)}}}),j.useEffect(()=>{const m=s.domElement;return m.addEventListener("pointerdown",p),m.addEventListener("pointerup",v),m.addEventListener("pointermove",y),document.addEventListener("keydown",S),document.addEventListener("keyup",x),()=>{m.removeEventListener("pointerdown",p),m.removeEventListener("pointerup",v),m.removeEventListener("pointermove",y),document.removeEventListener("keydown",S),document.removeEventListener("keyup",x)}},[s,p,v,y]),ne.jsxs(Ck.group,{ref:r,...i,children:[ne.jsx("mesh",{geometry:a.polySurface944_tree_body_0.geometry,material:l.PaletteMaterial001}),ne.jsx("mesh",{geometry:a.polySurface945_tree1_0.geometry,material:l.PaletteMaterial001}),ne.jsx("mesh",{geometry:a.polySurface946_tree2_0.geometry,material:l.PaletteMaterial001}),ne.jsx("mesh",{geometry:a.polySurface947_tree1_0.geometry,material:l.PaletteMaterial001}),ne.jsx("mesh",{geometry:a.polySurface948_tree_body_0.geometry,material:l.PaletteMaterial001}),ne.jsx("mesh",{geometry:a.polySurface949_tree_body_0.geometry,material:l.PaletteMaterial001}),ne.jsx("mesh",{geometry:a.pCube11_rocks1_0.geometry,material:l.PaletteMaterial001})]})};Us.preload("/island.glb");const p7="/assets/sky-dANZL6D7.glb",m7=({isRotating:n})=>{const e=Us(p7),t=j.useRef();return E0((i,r)=>{n&&(t.current.rotation.y+=.2*r)}),ne.jsx("mesh",{ref:t,children:ne.jsx("primitive",{object:e.scene})})},g7="/assets/plane-5N2wQY0V.glb",v7=({isRotating:n,...e})=>{const t=j.useRef();console.log(n);const{scene:i,animations:r}=Us(g7),{actions:s}=xx(r,t);return j.useEffect(()=>{console.log(" line 14",{isRotating:n}),n?s["Take 001"].play():s["Take 001"].stop()},[s,n]),ne.jsx("mesh",{...e,ref:t,children:ne.jsx("primitive",{object:i})})},y7="/assets/bird-_WCJ2UsO.glb",_7=()=>{const{scene:n,animations:e}=Us(y7),t=j.useRef(),{actions:i}=xx(e,t);return j.useEffect(()=>{i["Take 001"].play()},[]),E0(({clock:r,camera:s})=>{t.current.position.y=Math.sin(r.elapsedTime)*.5+.2,t.current.position.x>s.position.x+10?t.current.rotation.y=Math.PI:t.current.position.xne.jsxs("div",{className:"info-box",children:[ne.jsx("p",{className:"font-medium sm: text-m text-center",children:n}),ne.jsxs(Ym,{to:e,className:"neo-brutalism-white neo-btn",children:[t,ne.jsx("img",{src:fB,className:"w-4 h-4 object-contain"})]})]}),O7={1:ne.jsxs("h1",{className:`sm-text-xl sm:leading-snug text-center neo-brutalism-blue\r + py-2 px-8 text-white mx-3 my-6`,children:[" Hi I am ",ne.jsx("span",{className:"font-semibold",children:"Pooja Thalur"}),"👋",ne.jsx("br",{}),"An experienced Software Engineer from India. ",ne.jsx("br",{}),"A Grad student in Information Technology from ASU (2023 - 2025)"]}),2:ne.jsx(py,{text:ne.jsxs("span",{children:[" Worked with UrbanPro.com and Yugasys.",ne.jsx("br",{})," I picked up a lot of backend engineering skills along the way."]}),link:"/about",btnText:"Know More About Me"}),3:ne.jsx(py,{text:ne.jsxs("span",{children:["Worked on a lot of projects including backend using ",ne.jsx("br",{}),"JAVA, Python, AWS, Data Analytics. etc. , some of which are detailed here"]}),link:"/projects",btnText:"Visit Projects"}),4:ne.jsx(py,{text:ne.jsxs("span",{children:["I am just a message away. ",ne.jsx("br",{}),"Connect and talk about anything under the sun. "]}),link:"/contact",btnText:"Do Get in Touch"})},k7=({currentStage:n})=>O7[n]||null,H7=()=>{const[n,e]=j.useState(!1),[t,i]=j.useState(1),r=()=>{let h=null,p=[0,-6.5,-43],v=[.1,4.7,0];return console.log("window.innerWidth",window.innerWidth),window.innerWidth<=768?(h=[.9,.9,.9],p=[0,-6.5,-43]):(h=[1,1,1],p=[0,-9.5,-43]),[h,p,v]},s=()=>{let h,p;return window.innerWidth<768?(h=[1.5,1.5,1.5],p=[0,-1.5,0]):(h=[3,3,3],p=[0,-4,-4]),[h,p]},[o,a,l]=r(),[f,d]=s();return console.log("planePosition",d),ne.jsxs("section",{className:"w-full h-screen relative",children:[ne.jsx("div",{className:"absolute top-8 left-0 right-0 z-10 flex items-center justify-center",children:t&&ne.jsx(k7,{currentStage:t})}),ne.jsx(Fb,{className:"w-full h-screen bg-transparent ${isRotating ? cursor-grabbing : cursor-grab}",camera:{near:.1,far:1e3},children:ne.jsxs(j.Suspense,{fullback:ne.jsx(C6,{}),children:[ne.jsx("directionalLight",{position:[1,1,1],intensity:1.7}),ne.jsx("ambientLight",{intensity:.75}),ne.jsx("hemisphereLight",{skyColor:"#b1e1ff",groundColor:"#000000",intensity:.5}),ne.jsx(_7,{}),ne.jsx(m7,{isRotating:n}),ne.jsx(h7,{position:a,scale:o,rotation:l,isRotating:n,setIsRotating:e,setCurrentStage:i}),ne.jsx(v7,{isRotating:n,scale:f,position:d,rotation:[0,20,0]})]})}),ne.jsx("p",{children:"Made this with lot of effort, Please do go around and explore"})]})},G7=[{imageUrl:N7,name:"JAVA",type:"Backend"},{imageUrl:F7,name:"Python",type:"Backend"},{imageUrl:U7,name:"MySQL",type:"Backend"},{imageUrl:D7,name:"AWS",type:"Backend"},{imageUrl:x7,name:"CSS",type:"Frontend"},{imageUrl:A7,name:"Git",type:"Version Control"},{imageUrl:S7,name:"GitHub",type:"Version Control"},{imageUrl:M7,name:"HTML",type:"Frontend"},{imageUrl:E7,name:"JavaScript",type:"Frontend"},{imageUrl:w7,name:"MongoDB",type:"Database"},{imageUrl:C7,name:"Next.js",type:"Frontend"},{imageUrl:T7,name:"React",type:"Frontend"},{imageUrl:R7,name:"Redux",type:"State Management"},{imageUrl:b7,name:"TypeScript",type:"Frontend"}],z7=[{title:"Data Science Intern",company_name:"Yugasys",icon:k4,iconBg:"#accbe1",date:"June 2018 - September 2018",points:["Delivered, mentored team of 4, tasks included managing, cleaning a dataset, designing and visualizing reports. ","Collaborating with cross-functional teams including designers, product managers, and other developers to create high-quality products.","Conducted analysis of plotted charts, leveraging visualization techniques and statistical models to identify revenue-boosting patterns and inform strategic decision-making."]},{title:"Software Engineer",company_name:"UrbanPro.com",icon:H4,iconBg:"#fbc3bc",date:"Oct 2019 - July 2023",points:["Built an advertisement-based model for tutors, adding extra revenue to system and tracking its performance, boosted ROI of tutors by approximately 18%, integrated and upgraded Zoom APIs, Web SDKs into platform. ","Collaborated with cross-functional teams including designers, product managers, and other developers to create high-quality products.","Led, helped, managed and reviewed a referral system, and a reminder system for student payments, classes by raising attendance rate, a violation reporting system employed by customer support, boosting revenue","Participating in code reviews and providing constructive feedback to other developers."]}],V7=[{iconUrl:L7,theme:"btn-back-pink",name:"Analysing Recession using Python",description:"Analyzing the trend in recession in the US economy using Python and Pandas. ",link:"https://github.com/pooja-thalur/steganography"},{iconUrl:P7,theme:"btn-back-red",name:"Steganography",description:"eveloped an Image, audio, video steganographic encryption and decryption. Provided a whole interface to perform the user required actions using LSB algorithm",link:"https://github.com/pooja-thalur/steganography"},{iconUrl:I7,theme:"btn-back-green",name:"TV Series",description:"Created a full-stack site get the tv series reviews, ratings, and other details using frontend tools.",link:"https://github.com/pooja-thalur/tvseries"},{iconUrl:B7,theme:"btn-back-blue",name:"Election Tracker",description:"Designed and built a data analysis application to view the election candidates details, compare and analyze them for better perspective during elections .",link:"https://github.com/pooja-thalur/Electiontracker"}];var b0={},dB={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var i=[],r=0;r(typeof window=="object"&&document.documentElement.style.setProperty("--line-color",i),W7.default.createElement("div",{className:(0,X7.default)(e,"vertical-timeline",{"vertical-timeline--animate":n,"vertical-timeline--two-columns":t==="2-columns","vertical-timeline--one-column-left":t==="1-column"||t==="1-column-left","vertical-timeline--one-column-right":t==="1-column-right"})},r));pB.propTypes={children:no.default.oneOfType([no.default.arrayOf(no.default.node),no.default.node]).isRequired,className:no.default.string,animate:no.default.bool,layout:no.default.oneOf(["1-column-left","1-column","2-columns","1-column-right"]),lineColor:no.default.string};var J7=pB;b0.default=J7;var B0={};function d1(){return d1=Object.assign||function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}var p1=new Map,gp=new WeakMap,Rw=0,mB=void 0;function Y7(n){mB=n}function Q7(n){return n?(gp.has(n)||(Rw+=1,gp.set(n,Rw.toString())),gp.get(n)):"0"}function Z7(n){return Object.keys(n).sort().filter(function(e){return n[e]!==void 0}).map(function(e){return e+"_"+(e==="root"?Q7(n.root):n[e])}).toString()}function q7(n){var e=Z7(n),t=p1.get(e);if(!t){var i=new Map,r,s=new IntersectionObserver(function(o){o.forEach(function(a){var l,f=a.isIntersecting&&r.some(function(d){return a.intersectionRatio>=d});n.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=f),(l=i.get(a.target))==null||l.forEach(function(d){d(f,a)})})},n);r=s.thresholds||(Array.isArray(n.threshold)?n.threshold:[n.threshold||0]),t={id:e,observer:s,elements:i},p1.set(e,t)}return t}function Sx(n,e,t,i){if(t===void 0&&(t={}),i===void 0&&(i=mB),typeof window.IntersectionObserver>"u"&&i!==void 0){var r=n.getBoundingClientRect();return e(i,{isIntersecting:i,target:n,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:r,intersectionRect:r,rootBounds:r}),function(){}}var s=q7(t),o=s.id,a=s.observer,l=s.elements,f=l.get(n)||[];return l.has(n)||l.set(n,f),f.push(e),a.observe(n),function(){f.splice(f.indexOf(e),1),f.length===0&&(l.delete(n),a.unobserve(n)),l.size===0&&(a.disconnect(),p1.delete(o))}}var $7=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function bw(n){return typeof n.children!="function"}var bm=function(n){j7(e,n);function e(i){var r;return r=n.call(this,i)||this,r.node=null,r._unobserveCb=null,r.handleNode=function(s){r.node&&(r.unobserve(),!s&&!r.props.triggerOnce&&!r.props.skip&&r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=s||null,r.observeNode()},r.handleChange=function(s,o){s&&r.props.triggerOnce&&r.unobserve(),bw(r.props)||r.setState({inView:s,entry:o}),r.props.onChange&&r.props.onChange(s,o)},r.state={inView:!!i.initialInView,entry:void 0},r}var t=e.prototype;return t.componentDidUpdate=function(r){(r.rootMargin!==this.props.rootMargin||r.root!==this.props.root||r.threshold!==this.props.threshold||r.skip!==this.props.skip||r.trackVisibility!==this.props.trackVisibility||r.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(!(!this.node||this.props.skip)){var r=this.props,s=r.threshold,o=r.root,a=r.rootMargin,l=r.trackVisibility,f=r.delay,d=r.fallbackInView;this._unobserveCb=Sx(this.node,this.handleChange,{threshold:s,root:o,rootMargin:a,trackVisibility:l,delay:f},d)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!bw(this.props)){var r=this.state,s=r.inView,o=r.entry;return this.props.children({inView:s,entry:o,ref:this.handleNode})}var a=this.props,l=a.children,f=a.as,d=K7(a,$7);return j.createElement(f||"div",d1({ref:this.handleNode},d),l)},e}(j.Component);bm.displayName="InView";bm.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function eH(n){var e=n===void 0?{}:n,t=e.threshold,i=e.delay,r=e.trackVisibility,s=e.rootMargin,o=e.root,a=e.triggerOnce,l=e.skip,f=e.initialInView,d=e.fallbackInView,h=j.useRef(),p=j.useState({inView:!!f}),v=p[0],y=p[1],S=j.useCallback(function(m){h.current!==void 0&&(h.current(),h.current=void 0),!l&&m&&(h.current=Sx(m,function(A,M){y({inView:A,entry:M}),M.isIntersecting&&a&&h.current&&(h.current(),h.current=void 0)},{root:o,rootMargin:s,threshold:t,trackVisibility:r,delay:i},d))},[Array.isArray(t)?t.toString():t,o,s,a,l,r,d,i]);j.useEffect(function(){!h.current&&v.entry&&!a&&!l&&y({inView:!!f})});var x=[S,v.inView,v.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}const tH=Object.freeze(Object.defineProperty({__proto__:null,InView:bm,default:bm,defaultFallbackInView:Y7,observe:Sx,useInView:eH},Symbol.toStringTag,{value:"Module"})),nH=dP(tH);B0.__esModule=!0;B0.default=void 0;var io=Mx(j),Qt=Mx(uB),vp=Mx(hB),iH=nH;function Mx(n){return n&&n.__esModule?n:{default:n}}const gB=({children:n="",className:e="",contentArrowStyle:t=null,contentStyle:i=null,date:r="",dateClassName:s="",icon:o=null,iconClassName:a="",iconOnClick:l=null,onTimelineElementClick:f=null,iconStyle:d=null,id:h="",position:p="",style:v=null,textClassName:y="",intersectionObserverProps:S={rootMargin:"0px 0px -40px 0px",triggerOnce:!0},visible:x=!1})=>io.default.createElement(iH.InView,S,({inView:m,ref:A})=>io.default.createElement("div",{ref:A,id:h,className:(0,vp.default)(e,"vertical-timeline-element",{"vertical-timeline-element--left":p==="left","vertical-timeline-element--right":p==="right","vertical-timeline-element--no-children":n===""}),style:v},io.default.createElement(io.default.Fragment,null,io.default.createElement("span",{style:d,onClick:l,className:(0,vp.default)(a,"vertical-timeline-element-icon",{"bounce-in":m||x,"is-hidden":!(m||x)})},o),io.default.createElement("div",{style:i,onClick:f,className:(0,vp.default)(y,"vertical-timeline-element-content",{"bounce-in":m||x,"is-hidden":!(m||x)})},io.default.createElement("div",{style:t,className:"vertical-timeline-element-content-arrow"}),n,io.default.createElement("span",{className:(0,vp.default)(s,"vertical-timeline-element-date")},r)))));gB.propTypes={children:Qt.default.oneOfType([Qt.default.arrayOf(Qt.default.node),Qt.default.node]),className:Qt.default.string,contentArrowStyle:Qt.default.shape({}),contentStyle:Qt.default.shape({}),date:Qt.default.node,dateClassName:Qt.default.string,icon:Qt.default.element,iconClassName:Qt.default.string,iconStyle:Qt.default.shape({}),iconOnClick:Qt.default.func,onTimelineElementClick:Qt.default.func,id:Qt.default.string,position:Qt.default.string,style:Qt.default.shape({}),textClassName:Qt.default.string,visible:Qt.default.bool,intersectionObserverProps:Qt.default.shape({root:Qt.default.object,rootMargin:Qt.default.string,threshold:Qt.default.number,triggerOnce:Qt.default.bool})};var rH=gB;B0.default=rH;var Bw={VerticalTimeline:b0.default,VerticalTimelineElement:B0.default};const vB=()=>ne.jsxs("section",{className:"cta",children:[ne.jsxs("p",{className:"!text-slate-200 cta-text",children:[" You can contact me here ",ne.jsx("br",{className:"sm:block hidden"}),"Let's build it!!"]}),ne.jsx(Ym,{to:"/contact",className:"btn",children:"Contact me"})]}),sH=()=>ne.jsxs("section",{className:" max-container bg-gray-800 text-gray-100 body-font",children:[ne.jsxs("h1",{className:"head-text",children:[" Hello, I am ",ne.jsx("span",{className:"blue-gradient_text font-semibold drop-shadow",children:" Pooja Thalur"})]}),ne.jsx("div",{children:ne.jsx("p",{className:"mt-5 flex flex-col gap-3 text-slate-500",children:" A Software Engineer from India, pursuing masters in Information Technology in Arizona State University, United States. I am always curious about learning new technologies. I have worked as a Software Engineer in India specializing in Backend Development also did a lot of Frontend Engineering using ReactJs. Used Techologies and tools related to full stack and few IT management tools like Jira, Notion, etc. I have also worked as a Data Science Intern building models and preparing various charts using Python, Tableau, JS. Now learning and exploring deeper in those fields and specializing in Data Science as well."})}),ne.jsxs("div",{className:"py-10 flex flex-col ",children:[ne.jsx("h3",{className:"subhead",children:"My Skills"}),ne.jsx("div",{className:"mt-16 flex flex-wrap gap-12",children:G7.map((n,e)=>ne.jsx("div",{className:"block-container w-20 h-20",children:ne.jsx("div",{className:"btn-black rounded-xl",children:ne.jsx("div",{className:"btn-front rounded-xl flex justify-center items-center",children:ne.jsx("img",{src:n.imageUrl,alt:n.name,className:"w-16 h-16 object-contain"})})})}))})]}),ne.jsxs("div",{className:"py-16 ",children:[ne.jsx("h3",{className:"subhead-text",children:" Work Experience"}),ne.jsx("div",{className:"mt-5 flex flex-col gap-3 text-slate-500",children:ne.jsx("p",{children:"I've worked with UrbanPro.com as a Software Engineer, gained in-depth experience in scaling systems, backend development, performance optimization of the applications. Developed lot of revenue generating features for the company. Teamed up with smart minds there and leveled up my knowledge."})}),ne.jsx("div",{className:" mt-12 flex ",children:ne.jsx(Bw.VerticalTimeline,{children:z7.map(n=>ne.jsx(Bw.VerticalTimelineElement,{date:n.date,icon:ne.jsx("div",{className:"flex justify-center items-center w-full h-full",children:ne.jsx("img",{src:n.imageUrl,alt:n.company_name,className:"w-[60%] h-[60%] object-contain"})}),iconStyle:{background:n.iconBg},contentStyle:{borderStyle:"solid",borderBottom:"8px",borderBottomColor:n.iconBg,boxShadow:"none"},children:ne.jsxs("div",{children:[ne.jsx("h3",{className:"text-black text-xl font-poppins font-semibold",children:n.title}),ne.jsx("p",{className:"text-black-500 font-medium font-base",style:{margin:0},children:n.company_name}),ne.jsx("ul",{className:"my-5 list-disc ml-5 space-y-2",children:n.points.map((e,t)=>ne.jsx("li",{className:"text-black-500/50 font-normal pl-1 text-small",children:e},"experience-point-4{index}"))}),ne.jsx("p",{className:"text-black-500 font-medium font-base",style:{margin:0},children:n.date}),ne.jsx("p",{className:"text-black-500 font-medium font-base",children:n.description})]})},n.company_name))})})]}),ne.jsx("div",{className:"border-slate-200 ",children:ne.jsx(vB,{})})]}),Pf={_origin:"https://api.emailjs.com"},oH=(n,e="https://api.emailjs.com")=>{Pf._userID=n,Pf._origin=e},yB=(n,e,t)=>{if(!n)throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e)throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t)throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates";return!0};class Pw{constructor(e){this.status=e?e.status:0,this.text=e?e.responseText:"Network Error"}}const _B=(n,e,t={})=>new Promise((i,r)=>{const s=new XMLHttpRequest;s.addEventListener("load",({target:o})=>{const a=new Pw(o);a.status===200||a.text==="OK"?i(a):r(a)}),s.addEventListener("error",({target:o})=>{r(new Pw(o))}),s.open("POST",Pf._origin+n,!0),Object.keys(t).forEach(o=>{s.setRequestHeader(o,t[o])}),s.send(e)}),aH=(n,e,t,i)=>{const r=i||Pf._userID;return yB(r,n,e),_B("/api/v1.0/email/send",JSON.stringify({lib_version:"3.11.0",user_id:r,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"})},lH=n=>{let e;if(typeof n=="string"?e=document.querySelector(n):e=n,!e||e.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of form";return e},cH=(n,e,t,i)=>{const r=i||Pf._userID,s=lH(t);yB(r,n,e);const o=new FormData(s);return o.append("lib_version","3.11.0"),o.append("service_id",n),o.append("template_id",e),o.append("user_id",r),_B("/api/v1.0/email/send-form",o)},uH={init:oH,send:aH,sendForm:cH},fH="/assets/fox-FuRos4rq.glb",xB=({currentAnimation:n,...e})=>{const t=j.useRef(),{nodes:i,materials:r,animations:s}=Us(fH),{actions:o}=xx(s,t);return j.useEffect(()=>{Object.values(o).forEach(a=>a.stop()),o[n]&&o[n].play()},[o,n]),ne.jsx("group",{ref:t,...e,dispose:null,children:ne.jsxs("group",{name:"Sketchfab_Scene",children:[ne.jsx("primitive",{object:i.GLTF_created_0_rootJoint}),ne.jsx("skinnedMesh",{name:"Object_7",geometry:i.Object_7.geometry,material:r.PaletteMaterial001,skeleton:i.Object_7.skeleton}),ne.jsx("skinnedMesh",{name:"Object_8",geometry:i.Object_8.geometry,material:r.PaletteMaterial001,skeleton:i.Object_8.skeleton}),ne.jsx("skinnedMesh",{name:"Object_9",geometry:i.Object_9.geometry,material:r.PaletteMaterial001,skeleton:i.Object_9.skeleton}),ne.jsx("skinnedMesh",{name:"Object_10",geometry:i.Object_10.geometry,material:r.PaletteMaterial001,skeleton:i.Object_10.skeleton}),ne.jsx("skinnedMesh",{name:"Object_11",geometry:i.Object_11.geometry,material:r.PaletteMaterial001,skeleton:i.Object_11.skeleton})]})})},dH=({type:n,text:e})=>ne.jsx("div",{className:"absolute top-10 left-0 right-0 flex justify-center items-center",children:ne.jsx("div",{className:"bg-blue-800 p-2 text-indigo-100 leading-none lg:rounded-full flex ",role:"alert",children:ne.jsx("p",{className:"mr-2 text-left",children:e})})}),hH=()=>{const[n,e]=j.useState({show:!1,text:"",type:"danger"});return{alert:n,showAlert:({text:r,type:s="danger"})=>e({show:!0,text:r,type:s}),hideAlert:()=>e({show:!1,text:"",type:"danger"})}};vb({Animal:xB});const pH=()=>{j.useRef(null);const[n,e]=j.useState({name:"",email:"",message:""}),[t,i]=j.useState(!1),[r,s]=j.useState("idle"),{alert:o,showAlert:a,hideAlert:l}=hH(),f=v=>{e({...n,[v.target.name]:v.target.value})},d=()=>{s("walk")},h=()=>{s("idle")},p=v=>{v.preventDefault(),i(!0),s("hit"),console.log("pub key","_65Tphvxy_HlC1MM5"),console.log("service id","template_a2zy7hh"),uH.send("service_b6mgwyq","template_a2zy7hh",{from_name:n.name,to_name:"Pooja",from_email:n.email,to_email:"poojathalurdev@gmail.com",message:n.message},"_65Tphvxy_HlC1MM5").then(()=>{i(!1),a({show:!0,type:"success",text:"Message sent successfully! I will get back to you soon."}),setTimeout(()=>{s("idle")},[2e3]),e({name:"",email:"",message:""})}).catch(y=>{i(!1),s("idle"),console.log(y),a({show:!0,type:"danger",text:"Something went wrong!! No problem, you can reach me at poojathalur@gmail.com"})})};return ne.jsxs("section",{className:"relative flex lg:flex-row flex-col max-container",children:[o.show&&ne.jsx(dH,{...o}),ne.jsxs("div",{className:"flex-1 min-w-[50%] flex flex-col",children:[ne.jsx("h1",{className:"head-text",children:" Get in touch with Pooja Thalur!"}),ne.jsxs("form",{className:"w-full flex flex-col gap-7 mt-14",onSubmit:p,children:[ne.jsx("label",{className:"text-black-500 font-semibold",children:"Name"}),ne.jsx("input",{className:"input w-full h-12 rounded-md px-4",type:"text",name:"name",placeholder:"Your name",required:!0,value:n.name,onChange:f,onFocus:d,onBlur:h}),ne.jsx("label",{className:"text-black-500 font-semibold",children:"Email"}),ne.jsx("input",{className:"input w-full h-12 rounded-md px-4",type:"email",name:"email",placeholder:"Your email",required:!0,value:n.email,onChange:f,onFocus:d,onBlur:h}),ne.jsx("label",{className:"text-black-500 font-semibold",children:"Message"}),ne.jsx("textarea",{className:"textarea rounded-md px-4",rows:4,name:"message",placeholder:"Your message to me...",required:!0,value:n.message,onChange:f,onFocus:d,onBlur:h}),ne.jsx("button",{className:"btn btn-primary w-full h-12 rounded-md",type:"submit",disabled:t,onFocus:d,onBlur:h,children:t?"Sending...":"Send Message"})]})]}),ne.jsx("div",{className:"lg-w-1/2 w-full lg:h-auto md:h-[3000px] h-[400px] lg:mt-0 mt-14",children:ne.jsxs(Fb,{camera:{position:[0,0,5],fov:75,near:.1,far:1e3},children:[ne.jsx("directionalLight",{intensity:1.5,position:[0,0,5]}),ne.jsx("ambientLight",{intensity:.5}),ne.jsx(xB,{currentAnimation:r,position:[.5,.35,0],rotation:[13,-1.2,0],scale:[.5,.5,.5]})]})})]})},mH=()=>ne.jsxs("section",{className:" max-container",children:[ne.jsxs("h1",{className:"head-text",children:[" My ",ne.jsx("span",{className:"blue-gradient_text font-semibold drop-shadow",children:" Projects "})]}),ne.jsx("p",{className:"mt-5 flex flex-col gap-3 text-slate-500",children:"I have embarked on numerous projects in the past few years. These are the ones closest to my heart and the ones I am most proud of. Few of them are out of curiosity to learn, few from the need to solve a problem for the company I was working for and few just for fun. Your feedback is always welcome."}),ne.jsx("div",{className:"flex flex-wrap my-20 gap-16",children:V7.map(n=>ne.jsxs("div",{className:"lg:w-[400px] w-full",children:[ne.jsxs("div",{className:"block-container w-12 h-12",children:[ne.jsx("div",{className:`btn-back rounded-xl ${n.theme}`}),ne.jsx("div",{className:"btn-front rounded-xl flex justify-center items-center",children:ne.jsx("img",{src:n.iconUrl,alt:n.name,className:"w-1/2 h-1/2 object-contain"})})]}),ne.jsxs("div",{className:"mt-5 flex flex-col",children:[ne.jsx("h4",{className:"text-2xl font-poppins font-semibold ",children:n.name}),ne.jsx("p",{className:"mt-2 text-slate-500",children:n.description}),ne.jsxs("div",{className:"mt-5 flex items-center gap-2 font-poppins",children:[ne.jsx(Ym,{to:n.link,target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-blue-600",children:"LiveLink"}),ne.jsx("img",{src:fB,alt:"arrow",className:"w-4 h-4 object-contain"})]})]})]},n.name))}),ne.jsx("hr",{className:"border-slate-200"}),ne.jsx(vB,{})]}),gH=()=>ne.jsx("main",{className:"bg-slate-300 h-full",children:ne.jsxs(I4,{children:[ne.jsx(z4,{}),ne.jsxs(C4,{children:[ne.jsx(bu,{path:"/",element:ne.jsx(H7,{})}),ne.jsx(bu,{path:"/about",element:ne.jsx(sH,{})}),ne.jsx(bu,{path:"/projects",element:ne.jsx(mH,{})}),ne.jsx(bu,{path:"/contact",element:ne.jsx(pH,{})})]})]})});my.createRoot(document.getElementById("root")).render(ne.jsx(gH,{})); diff --git a/dist/assets/island-Te-uwlMA.glb b/dist/assets/island-Te-uwlMA.glb new file mode 100644 index 0000000..0adf802 Binary files /dev/null and b/dist/assets/island-Te-uwlMA.glb differ diff --git a/dist/assets/java-pRtI3RBy.png b/dist/assets/java-pRtI3RBy.png new file mode 100644 index 0000000..2ea9290 Binary files /dev/null and b/dist/assets/java-pRtI3RBy.png differ diff --git a/dist/assets/meta-wwPXefW1.png b/dist/assets/meta-wwPXefW1.png new file mode 100644 index 0000000..d0ceea5 Binary files /dev/null and b/dist/assets/meta-wwPXefW1.png differ diff --git a/dist/assets/plane-5N2wQY0V.glb b/dist/assets/plane-5N2wQY0V.glb new file mode 100644 index 0000000..1f5ef84 Binary files /dev/null and b/dist/assets/plane-5N2wQY0V.glb differ diff --git a/dist/assets/python-yMxSFEkd.png b/dist/assets/python-yMxSFEkd.png new file mode 100644 index 0000000..d854971 Binary files /dev/null and b/dist/assets/python-yMxSFEkd.png differ diff --git a/dist/assets/shopify-fb2A323g.png b/dist/assets/shopify-fb2A323g.png new file mode 100644 index 0000000..bba215c Binary files /dev/null and b/dist/assets/shopify-fb2A323g.png differ diff --git a/dist/assets/sky-dANZL6D7.glb b/dist/assets/sky-dANZL6D7.glb new file mode 100644 index 0000000..11bd152 Binary files /dev/null and b/dist/assets/sky-dANZL6D7.glb differ diff --git a/dist/assets/soundoff-f3VS7Hxn.png b/dist/assets/soundoff-f3VS7Hxn.png new file mode 100644 index 0000000..052c71e Binary files /dev/null and b/dist/assets/soundoff-f3VS7Hxn.png differ diff --git a/dist/assets/soundon-OBiR5jo4.png b/dist/assets/soundon-OBiR5jo4.png new file mode 100644 index 0000000..8e5dc29 Binary files /dev/null and b/dist/assets/soundon-OBiR5jo4.png differ diff --git a/dist/assets/starbucks-Y_GH9OfM.png b/dist/assets/starbucks-Y_GH9OfM.png new file mode 100644 index 0000000..6d1a9b1 Binary files /dev/null and b/dist/assets/starbucks-Y_GH9OfM.png differ diff --git a/dist/assets/summiz-Kiqitc3C.svg b/dist/assets/summiz-Kiqitc3C.svg new file mode 100644 index 0000000..5864bc3 --- /dev/null +++ b/dist/assets/summiz-Kiqitc3C.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dist/assets/tesla-weNJuekE.png b/dist/assets/tesla-weNJuekE.png new file mode 100644 index 0000000..593899a Binary files /dev/null and b/dist/assets/tesla-weNJuekE.png differ diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000..b48dd41 --- /dev/null +++ b/dist/index.html @@ -0,0 +1,15 @@ + + + + + + + Pooja Thalur + + + + +
+ + + diff --git a/dist/vite.svg b/dist/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/dist/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file