diff --git a/apps/dashboard/build/_app/immutable/assets/0.3Bakyq8T.css b/apps/dashboard/build/_app/immutable/assets/0.3Bakyq8T.css new file mode 100644 index 0000000..e1b18bc --- /dev/null +++ b/apps/dashboard/build/_app/immutable/assets/0.3Bakyq8T.css @@ -0,0 +1 @@ +/*! tailwindcss v4.2.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:"JetBrains Mono", "Fira Code", "SF Mono", monospace;--color-amber-400:oklch(82.8% .189 84.429);--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-lg:.5rem;--radius-xl:.75rem;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-void:#050510;--color-deep:#10102a;--color-subtle:#2a2a5e;--color-muted:#4a4a7a;--color-dim:#7a7aaa;--color-text:#e0e0ff;--color-bright:#fff;--color-synapse:#6366f1;--color-synapse-glow:#818cf8;--color-dream:#a855f7;--color-dream-glow:#c084fc;--color-memory:#3b82f6;--color-recall:#10b981;--color-decay:#ef4444;--color-warning:#f59e0b}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.end\!{inset-inline-end:var(--spacing)!important}.top-0{top:calc(var(--spacing) * 0)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-1\/2{left:50%}.left-4{left:calc(var(--spacing) * 4)}.left-6{left:calc(var(--spacing) * 6)}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-\[-12px\]{margin-top:-12px}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-24{width:calc(var(--spacing) * 24)}.w-96{width:calc(var(--spacing) * 96)}.w-\[90\%\]{width:90%}.w-full{width:100%}.w-px{width:1px}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-64{min-width:calc(var(--spacing) * 64)}.min-w-\[2rem\]{min-width:2rem}.min-w-\[3\.5rem\]{min-width:3.5rem}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x) var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-around{justify-content:space-around}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\!border-decay\/20{border-color:#ef444433!important}@supports (color:color-mix(in lab,red,red)){.\!border-decay\/20{border-color:color-mix(in oklab,var(--color-decay) 20%,transparent)!important}}.\!border-dream\/20{border-color:#a855f733!important}@supports (color:color-mix(in lab,red,red)){.\!border-dream\/20{border-color:color-mix(in oklab,var(--color-dream) 20%,transparent)!important}}.\!border-synapse\/20{border-color:#6366f133!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/20{border-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)!important}}.\!border-synapse\/30{border-color:#6366f14d!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/30{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)!important}}.\!border-synapse\/40{border-color:#6366f166!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/40{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)!important}}.border-dream\/10{border-color:#a855f71a}@supports (color:color-mix(in lab,red,red)){.border-dream\/10{border-color:color-mix(in oklab,var(--color-dream) 10%,transparent)}}.border-dream\/20{border-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.border-dream\/20{border-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.border-dream\/30{border-color:#a855f74d}@supports (color:color-mix(in lab,red,red)){.border-dream\/30{border-color:color-mix(in oklab,var(--color-dream) 30%,transparent)}}.border-dream\/40{border-color:#a855f766}@supports (color:color-mix(in lab,red,red)){.border-dream\/40{border-color:color-mix(in oklab,var(--color-dream) 40%,transparent)}}.border-dream\/50{border-color:#a855f780}@supports (color:color-mix(in lab,red,red)){.border-dream\/50{border-color:color-mix(in oklab,var(--color-dream) 50%,transparent)}}.border-recall\/30{border-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.border-recall\/30{border-color:color-mix(in oklab,var(--color-recall) 30%,transparent)}}.border-subtle\/15{border-color:#2a2a5e26}@supports (color:color-mix(in lab,red,red)){.border-subtle\/15{border-color:color-mix(in oklab,var(--color-subtle) 15%,transparent)}}.border-subtle\/20{border-color:#2a2a5e33}@supports (color:color-mix(in lab,red,red)){.border-subtle\/20{border-color:color-mix(in oklab,var(--color-subtle) 20%,transparent)}}.border-synapse{border-color:var(--color-synapse)}.border-synapse\/10{border-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.border-synapse\/10{border-color:color-mix(in oklab,var(--color-synapse) 10%,transparent)}}.border-synapse\/30{border-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.border-synapse\/30{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.border-synapse\/40{border-color:#6366f166}@supports (color:color-mix(in lab,red,red)){.border-synapse\/40{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)}}.border-transparent{border-color:#0000}.border-warning\/40{border-color:#f59e0b66}@supports (color:color-mix(in lab,red,red)){.border-warning\/40{border-color:color-mix(in oklab,var(--color-warning) 40%,transparent)}}.border-warning\/50{border-color:#f59e0b80}@supports (color:color-mix(in lab,red,red)){.border-warning\/50{border-color:color-mix(in oklab,var(--color-warning) 50%,transparent)}}.border-t-dream{border-top-color:var(--color-dream)}.border-t-synapse{border-top-color:var(--color-synapse)}.border-t-warning{border-top-color:var(--color-warning)}.bg-amber-400{background-color:var(--color-amber-400)}.bg-decay{background-color:var(--color-decay)}.bg-decay\/10{background-color:#ef44441a}@supports (color:color-mix(in lab,red,red)){.bg-decay\/10{background-color:color-mix(in oklab,var(--color-decay) 10%,transparent)}}.bg-decay\/20{background-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.bg-decay\/20{background-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.bg-deep{background-color:var(--color-deep)}.bg-dream{background-color:var(--color-dream)}.bg-dream\/5{background-color:#a855f70d}@supports (color:color-mix(in lab,red,red)){.bg-dream\/5{background-color:color-mix(in oklab,var(--color-dream) 5%,transparent)}}.bg-dream\/10{background-color:#a855f71a}@supports (color:color-mix(in lab,red,red)){.bg-dream\/10{background-color:color-mix(in oklab,var(--color-dream) 10%,transparent)}}.bg-dream\/20{background-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.bg-dream\/20{background-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.bg-recall{background-color:var(--color-recall)}.bg-recall\/10{background-color:#10b9811a}@supports (color:color-mix(in lab,red,red)){.bg-recall\/10{background-color:color-mix(in oklab,var(--color-recall) 10%,transparent)}}.bg-recall\/20{background-color:#10b98133}@supports (color:color-mix(in lab,red,red)){.bg-recall\/20{background-color:color-mix(in oklab,var(--color-recall) 20%,transparent)}}.bg-synapse{background-color:var(--color-synapse)}.bg-synapse\/10{background-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/10{background-color:color-mix(in oklab,var(--color-synapse) 10%,transparent)}}.bg-synapse\/15{background-color:#6366f126}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/15{background-color:color-mix(in oklab,var(--color-synapse) 15%,transparent)}}.bg-synapse\/20{background-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/20{background-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)}}.bg-transparent{background-color:#0000}.bg-void{background-color:var(--color-void)}.bg-void\/60{background-color:#05051099}@supports (color:color-mix(in lab,red,red)){.bg-void\/60{background-color:color-mix(in oklab,var(--color-void) 60%,transparent)}}.bg-warning\/20{background-color:#f59e0b33}@supports (color:color-mix(in lab,red,red)){.bg-warning\/20{background-color:color-mix(in oklab,var(--color-warning) 20%,transparent)}}.bg-white\/\[0\.02\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.02\]{background-color:color-mix(in oklab,var(--color-white) 2%,transparent)}}.bg-white\/\[0\.03\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.03\]{background-color:color-mix(in oklab,var(--color-white) 3%,transparent)}}.bg-white\/\[0\.04\]{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.bg-white\/\[0\.06\]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-dream{--tw-gradient-from:var(--color-dream);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-synapse{--tw-gradient-to:var(--color-synapse);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-\[10vh\]{padding-top:10vh}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-16{padding-bottom:calc(var(--spacing) * 16)}.pl-14{padding-left:calc(var(--spacing) * 14)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-400{color:var(--color-amber-400)}.text-bright{color:var(--color-bright)}.text-decay{color:var(--color-decay)}.text-decay\/60{color:#ef444499}@supports (color:color-mix(in lab,red,red)){.text-decay\/60{color:color-mix(in oklab,var(--color-decay) 60%,transparent)}}.text-dim{color:var(--color-dim)}.text-dream{color:var(--color-dream)}.text-dream-glow{color:var(--color-dream-glow)}.text-memory{color:var(--color-memory)}.text-muted{color:var(--color-muted)}.text-muted\/50{color:#4a4a7a80}@supports (color:color-mix(in lab,red,red)){.text-muted\/50{color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.text-recall{color:var(--color-recall)}.text-subtle{color:var(--color-subtle)}.text-synapse{color:var(--color-synapse)}.text-synapse-glow{color:var(--color-synapse-glow)}.text-text{color:var(--color-text)}.text-warning{color:var(--color-warning)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.accent-synapse{accent-color:var(--color-synapse)}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow\!{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(99\,102\,241\,0\.15\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#6366f126);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-synapse\/10{--tw-shadow-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.shadow-synapse\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-synapse) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-synapse\/20{--tw-shadow-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.shadow-synapse\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-synapse) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.blur{--tw-blur:blur(8px);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,)}.filter{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,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.select-none{-webkit-user-select:none;user-select:none}.placeholder\:text-muted::placeholder{color:var(--color-muted)}@media(hover:hover){.hover\:bg-decay\/20:hover{background-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.hover\:bg-decay\/20:hover{background-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.hover\:bg-decay\/30:hover{background-color:#ef44444d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-decay\/30:hover{background-color:color-mix(in oklab,var(--color-decay) 30%,transparent)}}.hover\:bg-dream\/20:hover{background-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.hover\:bg-dream\/20:hover{background-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.hover\:bg-dream\/30:hover{background-color:#a855f74d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-dream\/30:hover{background-color:color-mix(in oklab,var(--color-dream) 30%,transparent)}}.hover\:bg-recall\/30:hover{background-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-recall\/30:hover{background-color:color-mix(in oklab,var(--color-recall) 30%,transparent)}}.hover\:bg-synapse\/30:hover{background-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-synapse\/30:hover{background-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.hover\:bg-warning\/30:hover{background-color:#f59e0b4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-warning\/30:hover{background-color:color-mix(in oklab,var(--color-warning) 30%,transparent)}}.hover\:bg-white\/\[0\.03\]:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.03\]:hover{background-color:color-mix(in oklab,var(--color-white) 3%,transparent)}}.hover\:bg-white\/\[0\.04\]:hover{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.04\]:hover{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.hover\:text-dim:hover{color:var(--color-dim)}.hover\:text-text:hover{color:var(--color-text)}}.focus\:\!border-synapse\/40:focus{border-color:#6366f166!important}@supports (color:color-mix(in lab,red,red)){.focus\:\!border-synapse\/40:focus{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)!important}}.focus\:border-dream\/40:focus{border-color:#a855f766}@supports (color:color-mix(in lab,red,red)){.focus\:border-dream\/40:focus{border-color:color-mix(in oklab,var(--color-dream) 40%,transparent)}}.focus\:border-synapse\/40:focus{border-color:#6366f166}@supports (color:color-mix(in lab,red,red)){.focus\:border-synapse\/40:focus{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)}}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-synapse\/20:focus{--tw-ring-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.focus\:ring-synapse\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-synapse) 20%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:48rem){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:pt-\[15vh\]{padding-top:15vh}.md\:pb-0{padding-bottom:calc(var(--spacing) * 0)}}@media(min-width:64rem){.lg\:block{display:block}.lg\:w-56{width:calc(var(--spacing) * 56)}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\:\:-webkit-slider-thumb\]\:h-3::-webkit-slider-thumb{height:calc(var(--spacing) * 3)}.\[\&\:\:-webkit-slider-thumb\]\:w-3::-webkit-slider-thumb{width:calc(var(--spacing) * 3)}.\[\&\:\:-webkit-slider-thumb\]\:appearance-none::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:\:-webkit-slider-thumb\]\:rounded-full::-webkit-slider-thumb{border-radius:3.40282e38px}.\[\&\:\:-webkit-slider-thumb\]\:bg-synapse-glow::-webkit-slider-thumb{background-color:var(--color-synapse-glow)}.\[\&\:\:-webkit-slider-thumb\]\:shadow-\[0_0_8px_rgba\(129\,140\,248\,0\.4\)\]::-webkit-slider-thumb{--tw-shadow:0 0 8px var(--tw-shadow-color,#818cf866);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}html{background:var(--color-void);color:var(--color-text);font-family:var(--font-mono)}body{min-height:100vh;margin:0;overflow:hidden}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-subtle);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--color-muted)}.glass{-webkit-backdrop-filter:blur(20px)saturate(180%);background:#16163873;border:1px solid #6366f114;box-shadow:inset 0 1px #ffffff08,0 4px 24px #0000004d}.glass-subtle{-webkit-backdrop-filter:blur(12px)saturate(150%);background:#10102a66;border:1px solid #6366f10f;box-shadow:inset 0 1px #ffffff05,0 2px 12px #0003}.glass-sidebar{-webkit-backdrop-filter:blur(24px)saturate(180%);background:#0a0a1a99;border-right:1px solid #6366f11a;box-shadow:inset -1px 0 #ffffff05,4px 0 24px #0000004d}.glass-panel{-webkit-backdrop-filter:blur(24px)saturate(180%);background:#0a0a1acc;border:1px solid #6366f11a;box-shadow:inset 0 1px #ffffff08,0 8px 32px #0006}.glow-synapse{box-shadow:0 0 20px #6366f14d,0 0 60px #6366f11a}.glow-dream{box-shadow:0 0 20px #a855f74d,0 0 60px #a855f71a}.glow-memory{box-shadow:0 0 20px #3b82f64d,0 0 60px #3b82f61a}@keyframes pulse-glow{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse-glow{animation:2s ease-in-out infinite pulse-glow}@keyframes orb-float-1{0%,to{transform:translate(0)scale(1)}25%{transform:translate(60px,-40px)scale(1.1)}50%{transform:translate(-30px,-80px)scale(.95)}75%{transform:translate(-60px,-20px)scale(1.05)}}@keyframes orb-float-2{0%,to{transform:translate(0)scale(1)}25%{transform:translate(-50px,30px)scale(1.08)}50%{transform:translate(40px,60px)scale(.92)}75%{transform:translate(20px,-40px)scale(1.03)}}@keyframes orb-float-3{0%,to{transform:translate(0)scale(1)}25%{transform:translate(30px,50px)scale(1.05)}50%{transform:translate(-60px,20px)scale(.98)}75%{transform:translate(40px,-30px)scale(1.1)}}.ambient-orb{filter:blur(80px);pointer-events:none;z-index:0;opacity:.35;border-radius:50%;position:fixed}.ambient-orb-1{background:radial-gradient(circle,#a855f766,#0000 70%);width:400px;height:400px;animation:20s ease-in-out infinite orb-float-1;top:-10%;right:-5%}.ambient-orb-2{background:radial-gradient(circle,#6366f159,#0000 70%);width:350px;height:350px;animation:25s ease-in-out infinite orb-float-2;bottom:-15%;left:-5%}.ambient-orb-3{background:radial-gradient(circle,#f59e0b33,#0000 70%);width:300px;height:300px;animation:22s ease-in-out infinite orb-float-3;top:40%;left:40%}.nav-active-border{position:relative}.nav-active-border:before{content:"";background:linear-gradient(180deg,var(--color-synapse),var(--color-dream),var(--color-synapse));background-size:100% 200%;border-radius:1px;width:2px;animation:3s ease-in-out infinite gradient-shift;position:absolute;top:4px;bottom:4px;left:0}@keyframes gradient-shift{0%,to{background-position:0 0}50%{background-position:0 100%}}@keyframes float{0%,to{transform:translateY(0)translate(0)}25%{transform:translateY(-10px)translate(5px)}50%{transform:translateY(-5px)translate(-5px)}75%{transform:translateY(-15px)translate(3px)}}.retention-critical{color:var(--color-decay)}.retention-low{color:var(--color-warning)}.retention-good{color:var(--color-recall)}.retention-strong{color:var(--color-synapse)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}.safe-bottom.svelte-12qhfyh{padding-bottom:env(safe-area-inset-bottom,0px)}@keyframes svelte-12qhfyh-page-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.animate-page-in.svelte-12qhfyh{animation:svelte-12qhfyh-page-in .2s ease-out} diff --git a/apps/dashboard/build/_app/immutable/assets/0.3Bakyq8T.css.br b/apps/dashboard/build/_app/immutable/assets/0.3Bakyq8T.css.br new file mode 100644 index 0000000..7440637 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/assets/0.3Bakyq8T.css.br differ diff --git a/apps/dashboard/build/_app/immutable/assets/0.3Bakyq8T.css.gz b/apps/dashboard/build/_app/immutable/assets/0.3Bakyq8T.css.gz new file mode 100644 index 0000000..4c7eb06 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/assets/0.3Bakyq8T.css.gz differ diff --git a/apps/dashboard/build/_app/immutable/assets/0.CH63xIC0.css b/apps/dashboard/build/_app/immutable/assets/0.CH63xIC0.css deleted file mode 100644 index 1831ae3..0000000 --- a/apps/dashboard/build/_app/immutable/assets/0.CH63xIC0.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.2.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:"JetBrains Mono", "Fira Code", "SF Mono", monospace;--color-amber-400:oklch(82.8% .189 84.429);--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-void:#050510;--color-abyss:#0a0a1a;--color-deep:#10102a;--color-surface:#161638;--color-subtle:#2a2a5e;--color-muted:#4a4a7a;--color-dim:#7a7aaa;--color-text:#e0e0ff;--color-bright:#fff;--color-synapse:#6366f1;--color-synapse-glow:#818cf8;--color-dream:#a855f7;--color-dream-glow:#c084fc;--color-memory:#3b82f6;--color-recall:#10b981;--color-decay:#ef4444;--color-warning:#f59e0b}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.end\!{inset-inline-end:var(--spacing)!important}.top-0{top:calc(var(--spacing) * 0)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-4{left:calc(var(--spacing) * 4)}.left-6{left:calc(var(--spacing) * 6)}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-24{width:calc(var(--spacing) * 24)}.w-96{width:calc(var(--spacing) * 96)}.w-full{width:100%}.w-px{width:1px}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-64{min-width:calc(var(--spacing) * 64)}.min-w-\[2rem\]{min-width:2rem}.min-w-\[3\.5rem\]{min-width:3.5rem}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-around{justify-content:space-around}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-decay\/20{border-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.border-decay\/20{border-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.border-dream\/10{border-color:#a855f71a}@supports (color:color-mix(in lab,red,red)){.border-dream\/10{border-color:color-mix(in oklab,var(--color-dream) 10%,transparent)}}.border-dream\/20{border-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.border-dream\/20{border-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.border-dream\/30{border-color:#a855f74d}@supports (color:color-mix(in lab,red,red)){.border-dream\/30{border-color:color-mix(in oklab,var(--color-dream) 30%,transparent)}}.border-dream\/40{border-color:#a855f766}@supports (color:color-mix(in lab,red,red)){.border-dream\/40{border-color:color-mix(in oklab,var(--color-dream) 40%,transparent)}}.border-dream\/50{border-color:#a855f780}@supports (color:color-mix(in lab,red,red)){.border-dream\/50{border-color:color-mix(in oklab,var(--color-dream) 50%,transparent)}}.border-recall\/30{border-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.border-recall\/30{border-color:color-mix(in oklab,var(--color-recall) 30%,transparent)}}.border-subtle\/10{border-color:#2a2a5e1a}@supports (color:color-mix(in lab,red,red)){.border-subtle\/10{border-color:color-mix(in oklab,var(--color-subtle) 10%,transparent)}}.border-subtle\/15{border-color:#2a2a5e26}@supports (color:color-mix(in lab,red,red)){.border-subtle\/15{border-color:color-mix(in oklab,var(--color-subtle) 15%,transparent)}}.border-subtle\/20{border-color:#2a2a5e33}@supports (color:color-mix(in lab,red,red)){.border-subtle\/20{border-color:color-mix(in oklab,var(--color-subtle) 20%,transparent)}}.border-subtle\/30{border-color:#2a2a5e4d}@supports (color:color-mix(in lab,red,red)){.border-subtle\/30{border-color:color-mix(in oklab,var(--color-subtle) 30%,transparent)}}.border-subtle\/40{border-color:#2a2a5e66}@supports (color:color-mix(in lab,red,red)){.border-subtle\/40{border-color:color-mix(in oklab,var(--color-subtle) 40%,transparent)}}.border-synapse{border-color:var(--color-synapse)}.border-synapse\/30{border-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.border-synapse\/30{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.border-synapse\/40{border-color:#6366f166}@supports (color:color-mix(in lab,red,red)){.border-synapse\/40{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)}}.border-synapse\/50{border-color:#6366f180}@supports (color:color-mix(in lab,red,red)){.border-synapse\/50{border-color:color-mix(in oklab,var(--color-synapse) 50%,transparent)}}.border-transparent{border-color:#0000}.border-warning\/40{border-color:#f59e0b66}@supports (color:color-mix(in lab,red,red)){.border-warning\/40{border-color:color-mix(in oklab,var(--color-warning) 40%,transparent)}}.border-warning\/50{border-color:#f59e0b80}@supports (color:color-mix(in lab,red,red)){.border-warning\/50{border-color:color-mix(in oklab,var(--color-warning) 50%,transparent)}}.border-t-dream{border-top-color:var(--color-dream)}.border-t-synapse{border-top-color:var(--color-synapse)}.border-t-warning{border-top-color:var(--color-warning)}.bg-abyss{background-color:var(--color-abyss)}.bg-abyss\/60{background-color:#0a0a1a99}@supports (color:color-mix(in lab,red,red)){.bg-abyss\/60{background-color:color-mix(in oklab,var(--color-abyss) 60%,transparent)}}.bg-abyss\/80{background-color:#0a0a1acc}@supports (color:color-mix(in lab,red,red)){.bg-abyss\/80{background-color:color-mix(in oklab,var(--color-abyss) 80%,transparent)}}.bg-abyss\/95{background-color:#0a0a1af2}@supports (color:color-mix(in lab,red,red)){.bg-abyss\/95{background-color:color-mix(in oklab,var(--color-abyss) 95%,transparent)}}.bg-amber-400{background-color:var(--color-amber-400)}.bg-decay{background-color:var(--color-decay)}.bg-decay\/5{background-color:#ef44440d}@supports (color:color-mix(in lab,red,red)){.bg-decay\/5{background-color:color-mix(in oklab,var(--color-decay) 5%,transparent)}}.bg-decay\/10{background-color:#ef44441a}@supports (color:color-mix(in lab,red,red)){.bg-decay\/10{background-color:color-mix(in oklab,var(--color-decay) 10%,transparent)}}.bg-decay\/20{background-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.bg-decay\/20{background-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.bg-deep{background-color:var(--color-deep)}.bg-deep\/50{background-color:#10102a80}@supports (color:color-mix(in lab,red,red)){.bg-deep\/50{background-color:color-mix(in oklab,var(--color-deep) 50%,transparent)}}.bg-dream{background-color:var(--color-dream)}.bg-dream\/5{background-color:#a855f70d}@supports (color:color-mix(in lab,red,red)){.bg-dream\/5{background-color:color-mix(in oklab,var(--color-dream) 5%,transparent)}}.bg-dream\/10{background-color:#a855f71a}@supports (color:color-mix(in lab,red,red)){.bg-dream\/10{background-color:color-mix(in oklab,var(--color-dream) 10%,transparent)}}.bg-dream\/20{background-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.bg-dream\/20{background-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.bg-recall{background-color:var(--color-recall)}.bg-recall\/10{background-color:#10b9811a}@supports (color:color-mix(in lab,red,red)){.bg-recall\/10{background-color:color-mix(in oklab,var(--color-recall) 10%,transparent)}}.bg-recall\/20{background-color:#10b98133}@supports (color:color-mix(in lab,red,red)){.bg-recall\/20{background-color:color-mix(in oklab,var(--color-recall) 20%,transparent)}}.bg-subtle\/30{background-color:#2a2a5e4d}@supports (color:color-mix(in lab,red,red)){.bg-subtle\/30{background-color:color-mix(in oklab,var(--color-subtle) 30%,transparent)}}.bg-surface{background-color:var(--color-surface)}.bg-surface\/30{background-color:#1616384d}@supports (color:color-mix(in lab,red,red)){.bg-surface\/30{background-color:color-mix(in oklab,var(--color-surface) 30%,transparent)}}.bg-surface\/40{background-color:#16163866}@supports (color:color-mix(in lab,red,red)){.bg-surface\/40{background-color:color-mix(in oklab,var(--color-surface) 40%,transparent)}}.bg-surface\/50{background-color:#16163880}@supports (color:color-mix(in lab,red,red)){.bg-surface\/50{background-color:color-mix(in oklab,var(--color-surface) 50%,transparent)}}.bg-surface\/60{background-color:#16163899}@supports (color:color-mix(in lab,red,red)){.bg-surface\/60{background-color:color-mix(in oklab,var(--color-surface) 60%,transparent)}}.bg-synapse{background-color:var(--color-synapse)}.bg-synapse\/10{background-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/10{background-color:color-mix(in oklab,var(--color-synapse) 10%,transparent)}}.bg-synapse\/15{background-color:#6366f126}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/15{background-color:color-mix(in oklab,var(--color-synapse) 15%,transparent)}}.bg-synapse\/20{background-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/20{background-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)}}.bg-transparent{background-color:#0000}.bg-void{background-color:var(--color-void)}.bg-void\/60{background-color:#05051099}@supports (color:color-mix(in lab,red,red)){.bg-void\/60{background-color:color-mix(in oklab,var(--color-void) 60%,transparent)}}.bg-warning\/20{background-color:#f59e0b33}@supports (color:color-mix(in lab,red,red)){.bg-warning\/20{background-color:color-mix(in oklab,var(--color-warning) 20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-dream{--tw-gradient-from:var(--color-dream);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-synapse{--tw-gradient-to:var(--color-synapse);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-\[10vh\]{padding-top:10vh}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-16{padding-bottom:calc(var(--spacing) * 16)}.pl-14{padding-left:calc(var(--spacing) * 14)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-400{color:var(--color-amber-400)}.text-bright{color:var(--color-bright)}.text-decay{color:var(--color-decay)}.text-decay\/60{color:#ef444499}@supports (color:color-mix(in lab,red,red)){.text-decay\/60{color:color-mix(in oklab,var(--color-decay) 60%,transparent)}}.text-dim{color:var(--color-dim)}.text-dream{color:var(--color-dream)}.text-dream-glow{color:var(--color-dream-glow)}.text-memory{color:var(--color-memory)}.text-muted{color:var(--color-muted)}.text-muted\/50{color:#4a4a7a80}@supports (color:color-mix(in lab,red,red)){.text-muted\/50{color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.text-recall{color:var(--color-recall)}.text-subtle{color:var(--color-subtle)}.text-synapse{color:var(--color-synapse)}.text-synapse-glow{color:var(--color-synapse-glow)}.text-text{color:var(--color-text)}.text-warning{color:var(--color-warning)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.accent-synapse{accent-color:var(--color-synapse)}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow\!{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(99\,102\,241\,0\.15\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#6366f126);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-synapse\/10{--tw-shadow-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.shadow-synapse\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-synapse) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-synapse\/20{--tw-shadow-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.shadow-synapse\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-synapse) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.blur{--tw-blur:blur(8px);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,)}.filter{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,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.select-none{-webkit-user-select:none;user-select:none}.placeholder\:text-muted::placeholder{color:var(--color-muted)}@media(hover:hover){.hover\:border-subtle\/30:hover{border-color:#2a2a5e4d}@supports (color:color-mix(in lab,red,red)){.hover\:border-subtle\/30:hover{border-color:color-mix(in oklab,var(--color-subtle) 30%,transparent)}}.hover\:border-subtle\/40:hover{border-color:#2a2a5e66}@supports (color:color-mix(in lab,red,red)){.hover\:border-subtle\/40:hover{border-color:color-mix(in oklab,var(--color-subtle) 40%,transparent)}}.hover\:border-synapse\/30:hover{border-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.hover\:border-synapse\/30:hover{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.hover\:bg-decay\/20:hover{background-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.hover\:bg-decay\/20:hover{background-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.hover\:bg-decay\/30:hover{background-color:#ef44444d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-decay\/30:hover{background-color:color-mix(in oklab,var(--color-decay) 30%,transparent)}}.hover\:bg-dream\/20:hover{background-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.hover\:bg-dream\/20:hover{background-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.hover\:bg-dream\/30:hover{background-color:#a855f74d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-dream\/30:hover{background-color:color-mix(in oklab,var(--color-dream) 30%,transparent)}}.hover\:bg-recall\/30:hover{background-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-recall\/30:hover{background-color:color-mix(in oklab,var(--color-recall) 30%,transparent)}}.hover\:bg-surface:hover{background-color:var(--color-surface)}.hover\:bg-surface\/40:hover{background-color:#16163866}@supports (color:color-mix(in lab,red,red)){.hover\:bg-surface\/40:hover{background-color:color-mix(in oklab,var(--color-surface) 40%,transparent)}}.hover\:bg-surface\/50:hover{background-color:#16163880}@supports (color:color-mix(in lab,red,red)){.hover\:bg-surface\/50:hover{background-color:color-mix(in oklab,var(--color-surface) 50%,transparent)}}.hover\:bg-synapse\/30:hover{background-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-synapse\/30:hover{background-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.hover\:bg-warning\/30:hover{background-color:#f59e0b4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-warning\/30:hover{background-color:color-mix(in oklab,var(--color-warning) 30%,transparent)}}.hover\:text-dim:hover{color:var(--color-dim)}.hover\:text-text:hover{color:var(--color-text)}}.focus\:border-dream\/60:focus{border-color:#a855f799}@supports (color:color-mix(in lab,red,red)){.focus\:border-dream\/60:focus{border-color:color-mix(in oklab,var(--color-dream) 60%,transparent)}}.focus\:border-synapse\/50:focus{border-color:#6366f180}@supports (color:color-mix(in lab,red,red)){.focus\:border-synapse\/50:focus{border-color:color-mix(in oklab,var(--color-synapse) 50%,transparent)}}.focus\:border-synapse\/60:focus{border-color:#6366f199}@supports (color:color-mix(in lab,red,red)){.focus\:border-synapse\/60:focus{border-color:color-mix(in oklab,var(--color-synapse) 60%,transparent)}}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-synapse\/30:focus{--tw-ring-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.focus\:ring-synapse\/30:focus{--tw-ring-color:color-mix(in oklab, var(--color-synapse) 30%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:48rem){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:pt-\[15vh\]{padding-top:15vh}.md\:pb-0{padding-bottom:calc(var(--spacing) * 0)}}@media(min-width:64rem){.lg\:block{display:block}.lg\:w-56{width:calc(var(--spacing) * 56)}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}html{background:var(--color-void);color:var(--color-text);font-family:var(--font-mono)}body{min-height:100vh;margin:0;overflow:hidden}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--color-abyss)}::-webkit-scrollbar-thumb{background:var(--color-subtle);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--color-muted)}.glow-synapse{box-shadow:0 0 20px #6366f14d,0 0 60px #6366f11a}.glow-dream{box-shadow:0 0 20px #a855f74d,0 0 60px #a855f71a}.glow-memory{box-shadow:0 0 20px #3b82f64d,0 0 60px #3b82f61a}@keyframes pulse-glow{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse-glow{animation:2s ease-in-out infinite pulse-glow}@keyframes float{0%,to{transform:translateY(0)translate(0)}25%{transform:translateY(-10px)translate(5px)}50%{transform:translateY(-5px)translate(-5px)}75%{transform:translateY(-15px)translate(3px)}}.retention-critical{color:var(--color-decay)}.retention-low{color:var(--color-warning)}.retention-good{color:var(--color-recall)}.retention-strong{color:var(--color-synapse)}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}.safe-bottom.svelte-12qhfyh{padding-bottom:env(safe-area-inset-bottom,0px)}@keyframes svelte-12qhfyh-page-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.animate-page-in.svelte-12qhfyh{animation:svelte-12qhfyh-page-in .2s ease-out} diff --git a/apps/dashboard/build/_app/immutable/assets/0.CH63xIC0.css.br b/apps/dashboard/build/_app/immutable/assets/0.CH63xIC0.css.br deleted file mode 100644 index 69a3753..0000000 Binary files a/apps/dashboard/build/_app/immutable/assets/0.CH63xIC0.css.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/assets/0.CH63xIC0.css.gz b/apps/dashboard/build/_app/immutable/assets/0.CH63xIC0.css.gz deleted file mode 100644 index 9fc876c..0000000 Binary files a/apps/dashboard/build/_app/immutable/assets/0.CH63xIC0.css.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css b/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css new file mode 100644 index 0000000..966b434 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css @@ -0,0 +1 @@ +@keyframes svelte-1n9p0vm-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in.svelte-1n9p0vm{animation:svelte-1n9p0vm-fade-in .3s ease-out} diff --git a/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css.br b/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css.br new file mode 100644 index 0000000..51ed7a8 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css.br differ diff --git a/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css.gz b/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css.gz new file mode 100644 index 0000000..8719f65 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DNwVrE-V.js b/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js similarity index 51% rename from apps/dashboard/build/_app/immutable/chunks/DNwVrE-V.js rename to apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js index edaefe1..95bd407 100644 --- a/apps/dashboard/build/_app/immutable/chunks/DNwVrE-V.js +++ b/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js @@ -1 +1 @@ -import{N as s,B as o,H as c,O as b,Q as m,R as h,T as v,U as y}from"./DEYVqDYQ.js";function _(e,r,f=!1){if(e.multiple){if(r==null)return;if(!b(r))return m();for(var a of e.options)a.selected=r.includes(i(a));return}for(a of e.options){var t=i(a);if(h(t,r)){a.selected=!0;return}}(!f||r!==void 0)&&(e.selectedIndex=-1)}function q(e){var r=new MutationObserver(()=>{_(e,e.__value)});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),c(()=>{r.disconnect()})}function p(e,r,f=r){var a=new WeakSet,t=!0;s(e,"change",u=>{var l=u?"[selected]":":checked",n;if(e.multiple)n=[].map.call(e.querySelectorAll(l),i);else{var d=e.querySelector(l)??e.querySelector("option:not([disabled])");n=d&&i(d)}f(n),v!==null&&a.add(v)}),o(()=>{var u=r();if(e===document.activeElement){var l=y??v;if(a.has(l))return}if(_(e,u,t),t&&u===void 0){var n=e.querySelector(":checked");n!==null&&(u=i(n),f(u))}e.__value=u,t=!1}),q(e)}function i(e){return"__value"in e?e.__value:e.value}export{p as b}; +import{H as s,k as o,V as c,Z as b,_ as m,$ as h,K as v,M as y}from"./C9Z4nxhR.js";function d(e,r,f=!1){if(e.multiple){if(r==null)return;if(!b(r))return m();for(var a of e.options)a.selected=r.includes(i(a));return}for(a of e.options){var t=i(a);if(h(t,r)){a.selected=!0;return}}(!f||r!==void 0)&&(e.selectedIndex=-1)}function q(e){var r=new MutationObserver(()=>{d(e,e.__value)});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),c(()=>{r.disconnect()})}function k(e,r,f=r){var a=new WeakSet,t=!0;s(e,"change",u=>{var l=u?"[selected]":":checked",n;if(e.multiple)n=[].map.call(e.querySelectorAll(l),i);else{var _=e.querySelector(l)??e.querySelector("option:not([disabled])");n=_&&i(_)}f(n),v!==null&&a.add(v)}),o(()=>{var u=r();if(e===document.activeElement){var l=y??v;if(a.has(l))return}if(d(e,u,t),t&&u===void 0){var n=e.querySelector(":checked");n!==null&&(u=i(n),f(u))}e.__value=u,t=!1}),q(e)}function i(e){return"__value"in e?e.__value:e.value}export{k as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.br b/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.br new file mode 100644 index 0000000..b06137d Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.gz b/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.gz new file mode 100644 index 0000000..f8623d9 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/B-yQpXHS.js b/apps/dashboard/build/_app/immutable/chunks/B-yQpXHS.js deleted file mode 100644 index 1a7a286..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/B-yQpXHS.js +++ /dev/null @@ -1 +0,0 @@ -var Xt=t=>{throw TypeError(t)};var Pe=(t,e,n)=>e.has(t)||Xt("Cannot "+n);var w=(t,e,n)=>(Pe(t,e,"read from private field"),n?n.call(t):e.get(t)),A=(t,e,n)=>e.has(t)?Xt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{s as T,g as I,h as P,al as pt,b8 as Oe}from"./DEYVqDYQ.js";import{w as jt}from"./Dr_bhyBn.js";import{o as Qt}from"./BycUxjt3.js";class Nt{constructor(e,n){this.status=e,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Dt{constructor(e,n){this.status=e,this.location=n}}class Vt extends Error{constructor(e,n,r){super(r),this.status=e,this.text=n}}new URL("sveltekit-internal://");function $e(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function Ce(t){return t.split("%25").map(decodeURI).join("%25")}function je(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function Lt({href:t}){return t.split("#")[0]}function Ne(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)e=e*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function De(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&Y.delete(qt(t)),Ve(t,e));const Y=new Map;function qe(t,e){const n=qt(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&Y.set(n,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=De(a)),Promise.resolve(new Response(a,s))}return window.fetch(t,e)}function Be(t,e,n){if(Y.size>0){const r=qt(t,n),a=Y.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return e.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return e.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return Ut(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return Ut(String.fromCharCode(...l.slice(2).split("-").map(_=>parseInt(_,16))));const d=Ke.exec(l),[,u,v,f,h]=d;return e.push({name:f,matcher:h,optional:!!u,rest:!!v,chained:v?c===1&&o[0]==="":!1}),v?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return Ut(l)}).join("")}).join("")}/?$`),params:e}}function Fe(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function Ge(t){return t.slice(1).split("/").filter(Fe)}function We(t,e,n){const r={},a=t.slice(1),s=a.filter(i=>i!==void 0);let o=0;for(let i=0;id).join("/"),o=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=e[i+1],u=a[i+1];d&&!d.rest&&d.optional&&u&&l.chained&&(o=0),!d&&!u&&Object.keys(r).length===s.length&&(o=0);continue}if(l.optional&&l.chained){o++;continue}return}if(!o)return r}function Ut(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ye({nodes:t,server_loads:e,dictionary:n,matchers:r}){const a=new Set(e);return Object.entries(n).map(([i,[l,c,d]])=>{const{pattern:u,params:v}=Me(i),f={id:i,exec:h=>{const _=u.exec(h);if(_)return We(_,v,r)},errors:[1,...d||[]].map(h=>t[h]),layouts:[0,...c||[]].map(o),leaf:s(l)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(i){const l=i<0;return l&&(i=~i),[l,t[i]]}function o(i){return i===void 0?i:[a.has(i),t[i]]}}function ue(t,e=JSON.parse){try{return e(sessionStorage[t])}catch{}}function Zt(t,e,n=JSON.stringify){const r=n(e);try{sessionStorage[t]=r}catch{}}var se;const U=((se=globalThis.__sveltekit_7k5buk)==null?void 0:se.base)??"/dashboard";var ie;const ze=((ie=globalThis.__sveltekit_7k5buk)==null?void 0:ie.assets)??U??"",He="1771796675335",de="sveltekit:snapshot",he="sveltekit:scroll",pe="sveltekit:states",Je="sveltekit:pageurl",F="sveltekit:history",H="sveltekit:navigation",D={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Et=location.origin;function Bt(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function q(){return{x:pageXOffset,y:pageYOffset}}function M(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const te={...D,"":D.hover};function ge(t){let e=t.assignedSlot??t.parentNode;return(e==null?void 0:e.nodeType)===11&&(e=e.host),e}function me(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=ge(t)}}function It(t,e,n){let r;try{if(r=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const i=location.hash.split("#")[1]||"/";r.hash=`#${i}${r.hash}`}}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,s=!r||!!a||St(r,e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===Et&&t.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function gt(t){let e=null,n=null,r=null,a=null,s=null,o=null,i=t;for(;i&&i!==document.documentElement;)r===null&&(r=M(i,"preload-code")),a===null&&(a=M(i,"preload-data")),e===null&&(e=M(i,"keepfocus")),n===null&&(n=M(i,"noscroll")),s===null&&(s=M(i,"reload")),o===null&&(o=M(i,"replacestate")),i=ge(i);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:te[r??"off"],preload_data:te[a??"off"],keepfocus:l(e),noscroll:l(n),reload:l(s),replace_state:l(o)}}function ee(t){const e=jt(t);let n=!0;function r(){n=!0,e.update(o=>o)}function a(o){n=!1,e.set(o)}function s(o){let i;return e.subscribe(l=>{(i===void 0||n&&l!==i)&&o(i=l)})}return{notify:r,set:a,subscribe:s}}const _e={v:()=>{}};function Xe(){const{set:t,subscribe:e}=jt(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${ze}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==He;return o&&(t(!0),_e.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function St(t,e,n){return t.origin!==Et||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function Ln(t){}const we=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...we];const Qe=new Set([...we]);[...Qe];function Ze(t){return t.filter(e=>e!=null)}function Kt(t){return t instanceof Nt||t instanceof Vt?t.status:500}function tn(t){return t instanceof Vt?t.text:"Internal Error"}let R,J,At;const en=Qt.toString().includes("$$")||/function \w+\(\) \{\}/.test(Qt.toString());var et,nt,at,rt,ot,st,it,lt,le,ct,ce,ft,fe;en?(R={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},At={current:!1}):(R=new(le=class{constructor(){A(this,et,T({}));A(this,nt,T(null));A(this,at,T(null));A(this,rt,T({}));A(this,ot,T({id:null}));A(this,st,T({}));A(this,it,T(-1));A(this,lt,T(new URL("https://example.com")))}get data(){return I(w(this,et))}set data(e){P(w(this,et),e)}get form(){return I(w(this,nt))}set form(e){P(w(this,nt),e)}get error(){return I(w(this,at))}set error(e){P(w(this,at),e)}get params(){return I(w(this,rt))}set params(e){P(w(this,rt),e)}get route(){return I(w(this,ot))}set route(e){P(w(this,ot),e)}get state(){return I(w(this,st))}set state(e){P(w(this,st),e)}get status(){return I(w(this,it))}set status(e){P(w(this,it),e)}get url(){return I(w(this,lt))}set url(e){P(w(this,lt),e)}},et=new WeakMap,nt=new WeakMap,at=new WeakMap,rt=new WeakMap,ot=new WeakMap,st=new WeakMap,it=new WeakMap,lt=new WeakMap,le),J=new(ce=class{constructor(){A(this,ct,T(null))}get current(){return I(w(this,ct))}set current(e){P(w(this,ct),e)}},ct=new WeakMap,ce),At=new(fe=class{constructor(){A(this,ft,T(!1))}get current(){return I(w(this,ft))}set current(e){P(w(this,ft),e)}},ft=new WeakMap,fe),_e.v=()=>At.current=!0);function nn(t){Object.assign(R,t)}const an=new Set(["icon","shortcut icon","apple-touch-icon"]),j=ue(he)??{},X=ue(de)??{},C={url:ee({}),page:ee({}),navigating:jt(null),updated:Xe()};function Mt(t){j[t]=q()}function rn(t,e){let n=t+1;for(;j[n];)delete j[n],n+=1;for(n=e+1;X[n];)delete X[n],n+=1}function Q(t,e=!1){return e?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function ve(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(U||"/");t&&await t.update()}}function ne(){}let Ft,Pt,mt,O,Ot,E;const _t=[],wt=[];let y=null;function $t(){var t;(t=y==null?void 0:y.fork)==null||t.then(e=>e==null?void 0:e.discard()),y=null}const ht=new Map,ye=new Set,on=new Set,z=new Set;let m={branch:[],error:null,url:null},be=!1,vt=!1,ae=!0,Z=!1,W=!1,ke=!1,Gt=!1,Ee,k,L,V;const yt=new Set,re=new Map;async function In(t,e,n){var s,o,i,l,c;(s=globalThis.__sveltekit_7k5buk)!=null&&s.data&&globalThis.__sveltekit_7k5buk.data,document.URL!==location.href&&(location.href=location.href),E=t,await((i=(o=t.hooks).init)==null?void 0:i.call(o)),Ft=Ye(t),O=document.documentElement,Ot=e,Pt=t.nodes[0],mt=t.nodes[1],Pt(),mt(),k=(l=history.state)==null?void 0:l[F],L=(c=history.state)==null?void 0:c[H],k||(k=L=Date.now(),history.replaceState({...history.state,[F]:k,[H]:L},""));const r=j[k];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await vn(Ot,n)):(await G({type:"enter",url:Bt(E.hash?kn(new URL(location.href)):location.href),replace_state:!0}),a()),wn()}function sn(){_t.length=0,Gt=!1}function Se(t){wt.some(e=>e==null?void 0:e.snapshot)&&(X[t]=wt.map(e=>{var n;return(n=e==null?void 0:e.snapshot)==null?void 0:n.capture()}))}function Re(t){var e;(e=X[t])==null||e.forEach((n,r)=>{var a,s;(s=(a=wt[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function oe(){Mt(k),Zt(he,j),Se(L),Zt(de,X)}async function xe(t,e,n,r){let a;e.invalidateAll&&$t(),await G({type:"goto",url:Bt(t),keepfocus:e.keepFocus,noscroll:e.noScroll,replace_state:e.replaceState,state:e.state,redirect_count:n,nav_token:r,accept:()=>{e.invalidateAll&&(Gt=!0,a=[...re.keys()]),e.invalidate&&e.invalidate.forEach(_n)}}),e.invalidateAll&&pt().then(pt).then(()=>{re.forEach(({resource:s},o)=>{var i;a!=null&&a.includes(o)&&((i=s.refresh)==null||i.call(s))})})}async function ln(t){if(t.id!==(y==null?void 0:y.id)){$t();const e={};yt.add(e),y={id:t.id,token:e,promise:Ue({...t,preload:e}).then(n=>(yt.delete(e),n.type==="loaded"&&n.state.error&&$t(),n)),fork:null}}return y.promise}async function Tt(t){var n;const e=(n=await Rt(t,!1))==null?void 0:n.route;e&&await Promise.all([...e.layouts,e.leaf].filter(Boolean).map(r=>r[1]()))}async function Le(t,e,n){var a;m=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(R,t.props.page),Ee=new E.root({target:e,props:{...t.props,stores:C,components:wt},hydrate:n,sync:!1}),await Promise.resolve(),Re(L),n){const s={from:null,to:{params:m.params,route:{id:((a=m.route)==null?void 0:a.id)??null},url:new URL(location.href),scroll:j[k]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(o=>o(s))}vt=!0}function bt({url:t,params:e,branch:n,status:r,error:a,route:s,form:o}){let i="never";if(U&&(t.pathname===U||t.pathname===U+"/"))i="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(i=f.slash);t.pathname=$e(t.pathname,i),t.search=t.search;const l={type:"loaded",state:{url:t,params:e,branch:n,error:a,route:s},props:{constructors:Ze(n).map(f=>f.node.component),page:Jt(R)}};o!==void 0&&(l.props.form=o);let c={},d=!R,u=0;for(let f=0;fi(new URL(o))))return!0;return!1}function Yt(t,e){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?e??null:null}function un(t,e){if(!t)return new Set(e.searchParams.keys());const n=new Set([...t.searchParams.keys(),...e.searchParams.keys()]);for(const r of n){const a=t.searchParams.getAll(r),s=e.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&n.delete(r)}return n}function dn({error:t,url:e,route:n,params:r}){return{type:"loaded",state:{error:t,url:e,route:n,params:r,branch:[]},props:{page:Jt(R),constructors:[]}}}async function Ue({id:t,invalidating:e,url:n,params:r,route:a,preload:s}){if((y==null?void 0:y.id)===t)return yt.delete(y.token),y.promise;const{errors:o,layouts:i,leaf:l}=a,c=[...i,l];o.forEach(g=>g==null?void 0:g().catch(()=>{})),c.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));const d=m.url?t!==kt(m.url):!1,u=m.route?a.id!==m.route.id:!1,v=un(m.url,n);let f=!1;const h=c.map(async(g,p)=>{var $;if(!g)return;const b=m.branch[p];return g[1]===(b==null?void 0:b.loader)&&!fn(f,u,d,v,($=b.universal)==null?void 0:$.uses,r)?b:(f=!0,Wt({loader:g[1],url:n,params:r,route:a,parent:async()=>{var ut;const N={};for(let B=0;B{});const _=[];for(let g=0;gPromise.resolve({}),server_data_node:Yt(s)}),i={node:await mt(),loader:mt,universal:null,server:null,data:null};return bt({url:n,params:a,branch:[o,i],status:t,error:e,route:null})}catch(o){if(o instanceof Dt)return xe(new URL(o.location,location.href),{},0);throw o}}async function pn(t){const e=t.href;if(ht.has(e))return ht.get(e);let n;try{const r=(async()=>{let a=await E.hooks.reroute({url:new URL(t),fetch:async(s,o)=>cn(s,o,t).promise})??t;if(typeof a=="string"){const s=new URL(t);E.hash?s.hash=a:s.pathname=a,a=s}return a})();ht.set(e,r),n=await r}catch{ht.delete(e);return}return n}async function Rt(t,e){if(t&&!St(t,U,E.hash)){const n=await pn(t);if(!n)return;const r=gn(n);for(const a of Ft){const s=a.exec(r);if(s)return{id:kt(t),invalidating:e,route:a,params:je(s),url:t}}}}function gn(t){return Ce(E.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(U.length))||"/"}function kt(t){return(E.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Ae({url:t,type:e,intent:n,delta:r,event:a,scroll:s}){let o=!1;const i=Ht(m,n,t,e,s??null);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const l={...i.navigation,cancel:()=>{o=!0,i.reject(new Error("navigation cancelled"))}};return Z||ye.forEach(c=>c(l)),o?null:i}async function G({type:t,url:e,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:i=0,nav_token:l={},accept:c=ne,block:d=ne,event:u}){var B;const v=V;V=l;const f=await Rt(e,!1),h=t==="enter"?Ht(m,f,e,t):Ae({url:e,type:t,delta:n==null?void 0:n.delta,intent:f,scroll:n==null?void 0:n.scroll,event:u});if(!h){d(),V===l&&(V=v);return}const _=k,g=L;c(),Z=!0,vt&&h.navigation.type!=="enter"&&C.navigating.set(J.current=h.navigation);let p=f&&await Ue(f);if(!p){if(St(e,U,E.hash))return await Q(e,s);p=await Te(e,{id:null},await tt(new Vt(404,"Not Found",`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404,s)}if(e=(f==null?void 0:f.url)||e,V!==l)return h.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(i<20){await G({type:t,url:new URL(p.location,e),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o,redirect_count:i+1,nav_token:l}),h.fulfil(void 0);return}p=await zt({status:500,error:await tt(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}})}else p.props.page.status>=400&&await C.updated.check()&&(await ve(),await Q(e,s));if(sn(),Mt(_),Se(g),p.props.page.url.pathname!==e.pathname&&(e.pathname=p.props.page.url.pathname),o=n?n.state:o,!n){const S=s?0:1,dt={[F]:k+=S,[H]:L+=S,[pe]:o};(s?history.replaceState:history.pushState).call(history,dt,"",e),s||rn(k,L)}const b=f&&(y==null?void 0:y.id)===f.id?y.fork:null;y=null,p.props.page.state=o;let x;if(vt){const S=(await Promise.all(Array.from(on,K=>K(h.navigation)))).filter(K=>typeof K=="function");if(S.length>0){let K=function(){S.forEach(xt=>{z.delete(xt)})};S.push(K),S.forEach(xt=>{z.add(xt)})}m=p.state,p.props.page&&(p.props.page.url=e);const dt=b&&await b;dt?x=dt.commit():(Ee.$set(p.props),nn(p.props.page),x=(B=Oe)==null?void 0:B()),ke=!0}else await Le(p,Ot,!1);const{activeElement:$}=document;await x,await pt(),await pt();let N=null;if(ae){const S=n?n.scroll:a?q():null;S?scrollTo(S.x,S.y):(N=e.hash&&document.getElementById(Ie(e)))?N.scrollIntoView():scrollTo(0,0)}const ut=document.activeElement!==$&&document.activeElement!==document.body;!r&&!ut&&bn(e,!N),ae=!0,p.props.page&&Object.assign(R,p.props.page),Z=!1,t==="popstate"&&Re(L),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=q()),z.forEach(S=>S(h.navigation)),C.navigating.set(J.current=null)}async function Te(t,e,n,r,a){return t.origin===Et&&t.pathname===location.pathname&&!be?await zt({status:r,error:n,url:t,route:e}):await Q(t,a)}function mn(){let t,e={element:void 0,href:void 0},n;O.addEventListener("mousemove",i=>{const l=i.target;clearTimeout(t),t=setTimeout(()=>{s(l,D.hover)},20)});function r(i){i.defaultPrevented||s(i.composedPath()[0],D.tap)}O.addEventListener("mousedown",r),O.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(i=>{for(const l of i)l.isIntersecting&&(Tt(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function s(i,l){const c=me(i,O),d=c===e.element&&(c==null?void 0:c.href)===e.href&&l>=n;if(!c||d)return;const{url:u,external:v,download:f}=It(c,U,E.hash);if(v||f)return;const h=gt(c),_=u&&kt(m.url)===kt(u);if(!(h.reload||_))if(l<=h.preload_data){e={element:c,href:c.href},n=D.tap;const g=await Rt(u,!1);if(!g)return;ln(g)}else l<=h.preload_code&&(e={element:c,href:c.href},n=l,Tt(u))}function o(){a.disconnect();for(const i of O.querySelectorAll("a")){const{url:l,external:c,download:d}=It(i,U,E.hash);if(c||d)continue;const u=gt(i);u.reload||(u.preload_code===D.viewport&&a.observe(i),u.preload_code===D.eager&&Tt(l))}}z.add(o),o()}function tt(t,e){if(t instanceof Nt)return t.body;const n=Kt(t),r=tn(t);return E.hooks.handleError({error:t,event:e,status:n,message:r})??{message:r}}function Pn(t,e={}){return t=new URL(Bt(t)),t.origin!==Et?Promise.reject(new Error("goto: invalid URL")):xe(t,e,0)}function _n(t){if(typeof t=="function")_t.push(t);else{const{href:e}=new URL(t,location.href);_t.push(n=>n.href===e)}}function wn(){var e;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(oe(),!Z){const a=Ht(m,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};ye.forEach(o=>o(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&oe()}),(e=navigator.connection)!=null&&e.saveData||mn(),O.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=me(n.composedPath()[0],O);if(!r)return;const{url:a,external:s,target:o,download:i}=It(r,U,E.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const l=gt(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||i)return;const[d,u]=(E.hash?a.hash.replace(/^#/,""):a.href).split("#"),v=d===Lt(location);if(s||l.reload&&(!v||!u)){Ae({url:a,type:"link",event:n})?Z=!0:n.preventDefault();return}if(u!==void 0&&v){const[,f]=m.url.href.split("#");if(f===u){if(n.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=r.ownerDocument.getElementById(decodeURIComponent(u));h&&(h.scrollIntoView(),h.focus())}return}if(W=!0,Mt(k),t(a),!l.replace_state)return;W=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await G({type:"link",url:a,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??a.href===location.href,event:n})}),O.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(St(i,U,!1))return;const l=n.target,c=gt(l);if(c.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(l,a);i.search=new URLSearchParams(d).toString(),G({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Ct){if((r=n.state)!=null&&r[F]){const a=n.state[F];if(V={},a===k)return;const s=j[a],o=n.state[pe]??{},i=new URL(n.state[Je]??location.href),l=n.state[H],c=m.url?Lt(location)===Lt(m.url):!1;if(l===L&&(ke||c)){o!==R.state&&(R.state=o),t(i),j[k]=q(),s&&scrollTo(s.x,s.y),k=a;return}const u=a-k;await G({type:"popstate",url:i,popped:{state:o,scroll:s,delta:u},accept:()=>{k=a,L=l},block:()=>{history.go(-u)},nav_token:V,event:n})}else if(!W){const a=new URL(location.href);t(a),E.hash&&location.reload()}}}),addEventListener("hashchange",()=>{W&&(W=!1,history.replaceState({...history.state,[F]:++k,[H]:L},"",location.href))});for(const n of document.querySelectorAll("link"))an.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&C.navigating.set(J.current=null)});function t(n){m.url=R.url=n,C.page.set(Jt(R)),C.page.notify()}}async function vn(t,{status:e=200,error:n,node_ids:r,params:a,route:s,server_route:o,data:i,form:l}){be=!0;const c=new URL(location.href);let d;({params:a={},route:s={id:null}}=await Rt(c,!1)||{}),d=Ft.find(({id:f})=>f===s.id);let u,v=!0;try{const f=r.map(async(_,g)=>{const p=i[g];return p!=null&&p.uses&&(p.uses=yn(p.uses)),Wt({loader:E.nodes[_],url:c,params:a,route:s,parent:async()=>{const b={};for(let x=0;x{const i=history.state;Ct=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(i,"",t),e&&scrollTo(s,o),Ct=!1})}else{const s=document.body,o=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),o!==null?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let o=0;o{if(a.rangeCount===s.length){for(let o=0;o{s=u,o=v});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url,scroll:q()},to:n&&{params:(e==null?void 0:e.params)??null,route:{id:((d=e==null?void 0:e.route)==null?void 0:d.id)??null},url:n,scroll:a},willUnload:!e,type:r,complete:i},fulfil:s,reject:o}}function Jt(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function kn(t){const e=new URL(t);return e.hash=decodeURIComponent(t.hash),e}function Ie(t){let e;if(E.hash){const[,,n]=t.hash.split("#",3);e=n??""}else e=t.hash.slice(1);return decodeURIComponent(e)}export{In as a,U as b,Pn as g,Ln as l,R as p,C as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/B-yQpXHS.js.br b/apps/dashboard/build/_app/immutable/chunks/B-yQpXHS.js.br deleted file mode 100644 index 7beae86..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/B-yQpXHS.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/B-yQpXHS.js.gz b/apps/dashboard/build/_app/immutable/chunks/B-yQpXHS.js.gz deleted file mode 100644 index f5b99ba..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/B-yQpXHS.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/B9t3YtL9.js.br b/apps/dashboard/build/_app/immutable/chunks/B9t3YtL9.js.br deleted file mode 100644 index 8f799e2..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/B9t3YtL9.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/B9t3YtL9.js.gz b/apps/dashboard/build/_app/immutable/chunks/B9t3YtL9.js.gz deleted file mode 100644 index e62fc11..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/B9t3YtL9.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BbhZG17W.js b/apps/dashboard/build/_app/immutable/chunks/BbhZG17W.js deleted file mode 100644 index 3ac65f4..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/BbhZG17W.js +++ /dev/null @@ -1 +0,0 @@ -import{B as S,C as h,q as k,F as q,S as B}from"./DEYVqDYQ.js";function t(r,i){return r===i||(r==null?void 0:r[B])===i}function x(r={},i,a,T){return S(()=>{var f,s;return h(()=>{f=s,s=[],k(()=>{r!==a(...s)&&(i(r,...s),f&&t(a(...f),r)&&i(null,...f))})}),()=>{q(()=>{s&&t(a(...s),r)&&i(null,...s)})}}),r}export{x as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BbhZG17W.js.br b/apps/dashboard/build/_app/immutable/chunks/BbhZG17W.js.br deleted file mode 100644 index 64063ea..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/BbhZG17W.js.br +++ /dev/null @@ -1,2 +0,0 @@ -< T/Sˎts#h)vrypEc-O. ;1zTzjg8 \L7[kN:U3Ip0'+{dV_5R> ypj:_Y<[!i EQP SգD\22@XG -ZTέx  \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/BbhZG17W.js.gz b/apps/dashboard/build/_app/immutable/chunks/BbhZG17W.js.gz deleted file mode 100644 index 0bff5c4..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BbhZG17W.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Bew31VOg.js b/apps/dashboard/build/_app/immutable/chunks/Bew31VOg.js deleted file mode 100644 index f1b4807..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/Bew31VOg.js +++ /dev/null @@ -1 +0,0 @@ -import{M as d,F as k,af as S,ag as y,ah as A,ai as m,aj as E,ak as M,N as b,al as N,q as T,C as g,T as t,U as L}from"./DEYVqDYQ.js";const I=Symbol("is custom element"),C=Symbol("is html"),H=m?"link":"LINK";function w(a){if(d){var e=!1,r=()=>{if(!e){if(e=!0,a.hasAttribute("value")){var c=a.value;u(a,"value",null),a.value=c}if(a.hasAttribute("checked")){var s=a.checked;u(a,"checked",null),a.checked=s}}};a.__on_r=r,k(r),S()}}function u(a,e,r,c){var s=O(a);d&&(s[e]=a.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&a.nodeName===H)||s[e]!==(s[e]=r)&&(e==="loading"&&(a[y]=r),r==null?a.removeAttribute(e):typeof r!="string"&&U(a).includes(e)?a[e]=r:a.setAttribute(e,r))}function O(a){return a.__attributes??(a.__attributes={[I]:a.nodeName.includes("-"),[C]:a.namespaceURI===A})}var h=new Map;function U(a){var e=a.getAttribute("is")||a.nodeName,r=h.get(e);if(r)return r;h.set(e,r=[]);for(var c,s=a,o=Element.prototype;o!==s;){c=M(s);for(var l in c)c[l].set&&r.push(l);s=E(s)}return r}function G(a,e,r=e){var c=new WeakSet;b(a,"input",async s=>{var o=s?a.defaultValue:a.value;if(o=_(a)?i(o):o,r(o),t!==null&&c.add(t),await N(),o!==(o=e())){var l=a.selectionStart,f=a.selectionEnd,n=a.value.length;if(a.value=o??"",f!==null){var v=a.value.length;l===f&&f===n&&v>n?(a.selectionStart=v,a.selectionEnd=v):(a.selectionStart=l,a.selectionEnd=Math.min(f,v))}}}),(d&&a.defaultValue!==a.value||T(e)==null&&a.value)&&(r(_(a)?i(a.value):a.value),t!==null&&c.add(t)),g(()=>{var s=e();if(a===document.activeElement){var o=L??t;if(c.has(o))return}_(a)&&s===i(a.value)||a.type==="date"&&!s&&!a.value||s!==a.value&&(a.value=s??"")})}function _(a){var e=a.type;return e==="number"||e==="range"}function i(a){return a===""?null:+a}export{G as b,w as r,u as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/Bew31VOg.js.br b/apps/dashboard/build/_app/immutable/chunks/Bew31VOg.js.br deleted file mode 100644 index 52bbf17..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Bew31VOg.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Bew31VOg.js.gz b/apps/dashboard/build/_app/immutable/chunks/Bew31VOg.js.gz deleted file mode 100644 index e817534..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Bew31VOg.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/B9t3YtL9.js b/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js similarity index 74% rename from apps/dashboard/build/_app/immutable/chunks/B9t3YtL9.js rename to apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js index 4e74780..7fa8036 100644 --- a/apps/dashboard/build/_app/immutable/chunks/B9t3YtL9.js +++ b/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js @@ -1 +1 @@ -import{a as y}from"./CiJhRXcr.js";import{M as r}from"./DEYVqDYQ.js";function a(t,e,f,i){var l=t.__style;if(r||l!==e){var s=y(e);(!r||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}return i}export{a as s}; +import{a as y}from"./kH-DTQyy.js";import{J as r}from"./C9Z4nxhR.js";function a(t,e,f,i){var l=t.__style;if(r||l!==e){var s=y(e);(!r||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}return i}export{a as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.br b/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.br new file mode 100644 index 0000000..86cbc00 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.gz b/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.gz new file mode 100644 index 0000000..51b71ac Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DmEsXEQB.js b/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js similarity index 95% rename from apps/dashboard/build/_app/immutable/chunks/DmEsXEQB.js rename to apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js index 343c150..f806b0e 100644 --- a/apps/dashboard/build/_app/immutable/chunks/DmEsXEQB.js +++ b/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js @@ -1 +1 @@ -import{d as l,w as S}from"./Dr_bhyBn.js";const y=200;function H(){const{subscribe:n,set:c,update:e}=S({connected:!1,events:[],lastHeartbeat:null,error:null});let t=null,a=null,d=0;function m(r){const u=r||(window.location.port==="5173"?`ws://${window.location.hostname}:3927/ws`:`ws://${window.location.host}/ws`);if((t==null?void 0:t.readyState)!==WebSocket.OPEN)try{t=new WebSocket(u),t.onopen=()=>{d=0,e(o=>({...o,connected:!0,error:null}))},t.onmessage=o=>{try{const s=JSON.parse(o.data);e(b=>{if(s.type==="Heartbeat")return{...b,lastHeartbeat:s};const p=[s,...b.events].slice(0,y);return{...b,events:p}})}catch{}},t.onclose=()=>{e(o=>({...o,connected:!1})),f(u)},t.onerror=()=>{e(o=>({...o,error:"WebSocket connection failed"}))}}catch(o){e(s=>({...s,error:String(o)}))}}function f(r){a&&clearTimeout(a);const u=Math.min(1e3*2**d,3e4);d++,a=setTimeout(()=>m(r),u)}function w(){a&&clearTimeout(a),t==null||t.close(),t=null,c({connected:!1,events:[],lastHeartbeat:null,error:null})}function v(){e(r=>({...r,events:[]}))}return{subscribe:n,connect:m,disconnect:w,clearEvents:v}}const i=H(),k=l(i,n=>n.connected),T=l(i,n=>n.events);l(i,n=>n.lastHeartbeat);const g=l(i,n=>{var c,e;return((e=(c=n.lastHeartbeat)==null?void 0:c.data)==null?void 0:e.memory_count)??0}),E=l(i,n=>{var c,e;return((e=(c=n.lastHeartbeat)==null?void 0:c.data)==null?void 0:e.avg_retention)??0});export{E as a,T as e,k as i,g as m,i as w}; +import{d as l,w as S}from"./DnKV7_Y9.js";const y=200;function H(){const{subscribe:n,set:c,update:e}=S({connected:!1,events:[],lastHeartbeat:null,error:null});let t=null,a=null,d=0;function m(r){const u=r||(window.location.port==="5173"?`ws://${window.location.hostname}:3927/ws`:`ws://${window.location.host}/ws`);if((t==null?void 0:t.readyState)!==WebSocket.OPEN)try{t=new WebSocket(u),t.onopen=()=>{d=0,e(o=>({...o,connected:!0,error:null}))},t.onmessage=o=>{try{const s=JSON.parse(o.data);e(b=>{if(s.type==="Heartbeat")return{...b,lastHeartbeat:s};const p=[s,...b.events].slice(0,y);return{...b,events:p}})}catch{}},t.onclose=()=>{e(o=>({...o,connected:!1})),f(u)},t.onerror=()=>{e(o=>({...o,error:"WebSocket connection failed"}))}}catch(o){e(s=>({...s,error:String(o)}))}}function f(r){a&&clearTimeout(a);const u=Math.min(1e3*2**d,3e4);d++,a=setTimeout(()=>m(r),u)}function w(){a&&clearTimeout(a),t==null||t.close(),t=null,c({connected:!1,events:[],lastHeartbeat:null,error:null})}function v(){e(r=>({...r,events:[]}))}return{subscribe:n,connect:m,disconnect:w,clearEvents:v}}const i=H(),k=l(i,n=>n.connected),T=l(i,n=>n.events);l(i,n=>n.lastHeartbeat);const g=l(i,n=>{var c,e;return((e=(c=n.lastHeartbeat)==null?void 0:c.data)==null?void 0:e.memory_count)??0}),E=l(i,n=>{var c,e;return((e=(c=n.lastHeartbeat)==null?void 0:c.data)==null?void 0:e.avg_retention)??0});export{E as a,T as e,k as i,g as m,i as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.br b/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.br new file mode 100644 index 0000000..7892120 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.br @@ -0,0 +1,7 @@ +@v<ᥱ ;fNҌUv@iZvv=IXfI jr@mIbyLFccKؚ~0̉5g(&J edDK)UO.5EeOn2C"DBڒ ']KG8úKU7u? +J+ +7o#Em'Kng ]2z^)U2sjx?GѨO[ ʘ ;+~ W٣?t5|̒ yeK + g6 T|A)UvmxLR. \Qc RtF#Yw)#hdS4Tm'QokM  sź#]mE:0 s, +]d.nq#:*.tBG6L&ʶƽ(dhVɜo®aI٤-5)t&X4$jD@8 +㩬8 뎺sB[]zL3fjmn4F@!OϬj$\TjCT|)ne=CjPy`aj 鶢ܙvkb1'Wʻe2zr + L1Uf \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.gz b/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.gz new file mode 100644 index 0000000..d737d1c Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BycUxjt3.js b/apps/dashboard/build/_app/immutable/chunks/BycUxjt3.js deleted file mode 100644 index a2a3b52..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/BycUxjt3.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as c,a8 as t,v as u,q as o}from"./DEYVqDYQ.js";function a(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function l(e){t===null&&a(),u&&t.l!==null?i(t).m.push(e):c(()=>{const n=o(e);if(typeof n=="function")return n})}function f(e){t===null&&a(),l(()=>()=>o(e))}function i(e){var n=e.l;return n.u??(n.u={a:[],b:[],m:[]})}export{f as a,l as o}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BycUxjt3.js.br b/apps/dashboard/build/_app/immutable/chunks/BycUxjt3.js.br deleted file mode 100644 index ca8a01b..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BycUxjt3.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BycUxjt3.js.gz b/apps/dashboard/build/_app/immutable/chunks/BycUxjt3.js.gz deleted file mode 100644 index 3e00547..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BycUxjt3.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js b/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js new file mode 100644 index 0000000..658f7b1 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js @@ -0,0 +1 @@ +import{b as T,J as o,a0 as b,E as h,a1 as p,a2 as A,a3 as E,a4 as R,a5 as g,a6 as l}from"./C9Z4nxhR.js";import{B as v}from"./CY4crMrT.js";function S(t,u,_=!1){o&&b();var n=new v(t),c=_?h:0;function i(a,r){if(o){const e=p(t);var s;if(e===A?s=0:e===E?s=!1:s=parseInt(e.substring(1)),a!==s){var f=R();g(f),n.anchor=f,l(!1),n.ensure(a,r),l(!0);return}}n.ensure(a,r)}T(()=>{var a=!1;u((r,s=0)=>{a=!0,i(s,r)}),a||i(!1,null)},c)}export{S as i}; diff --git a/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.br b/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.br new file mode 100644 index 0000000..a1d46d5 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.gz b/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.gz new file mode 100644 index 0000000..80b6623 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DEYVqDYQ.js b/apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js similarity index 95% rename from apps/dashboard/build/_app/immutable/chunks/DEYVqDYQ.js rename to apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js index b6b36d1..fe4513c 100644 --- a/apps/dashboard/build/_app/immutable/chunks/DEYVqDYQ.js +++ b/apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js @@ -1 +1 @@ -var cn=Object.defineProperty;var wt=e=>{throw TypeError(e)};var _n=(e,t,n)=>t in e?cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t,n)=>_n(e,typeof t!="symbol"?t+"":t,n),Ke=(e,t,n)=>t.has(e)||wt("Cannot "+n);var p=(e,t,n)=>(Ke(e,t,"read from private field"),n?n.call(e):t.get(e)),F=(e,t,n)=>t.has(e)?wt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),z=(e,t,n,r)=>(Ke(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),K=(e,t,n)=>(Ke(e,t,"access private method"),n);var vn=Array.isArray,dn=Array.prototype.indexOf,Ee=Array.prototype.includes,ar=Array.from,lr=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,pn=Object.getOwnPropertyDescriptors,hn=Object.prototype,wn=Array.prototype,kt=Object.getPrototypeOf,yt=Object.isExtensible;const yn=()=>{};function or(e){return e()}function En(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}function ur(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const A=2,De=4,Ie=8,Dt=1<<24,G=16,H=32,ve=64,mn=128,P=512,g=1024,R=2048,Y=4096,j=8192,$=16384,oe=32768,je=65536,Et=1<<17,It=1<<18,Pe=1<<19,Pt=1<<20,cr=1<<25,ue=65536,$e=1<<21,st=1<<22,Z=1<<23,ae=Symbol("$state"),_r=Symbol("legacy props"),vr=Symbol(""),ne=new class extends Error{constructor(){super(...arguments);de(this,"name","StaleReactionError");de(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Nt;const pr=!!((Nt=globalThis.document)!=null&&Nt.contentType)&&globalThis.document.contentType.includes("xml"),Ue=3,Ct=8;function gn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function hr(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Tn(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function bn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function An(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Sn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function wr(){throw new Error("https://svelte.dev/e/hydration_failed")}function yr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Rn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function On(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Nn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Er(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const mr=1,gr=2,Tr=4,br=8,Ar=16,Sr=1,Rr=2,Or=4,Nr=8,kr=16,xr=1,Dr=2,kn="[",xn="[!",Ir="[?",Dn="]",ft={},T=Symbol(),In="http://www.w3.org/1999/xhtml";function it(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Pr(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Cr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let J=!1;function Fr(e){J=e}let m;function me(e){if(e===null)throw it(),ft;return m=e}function Mr(){return me(ee(m))}function Lr(e){if(J){if(ee(m)!==null)throw it(),ft;m=e}}function jr(e=1){if(J){for(var t=e,n=m;t--;)n=ee(n);m=n}}function Yr(e=!0){for(var t=0,n=m;;){if(n.nodeType===Ct){var r=n.data;if(r===Dn){if(t===0)return n;t-=1}else(r===kn||r===xn||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var s=ee(n);e&&n.remove(),n=s}}function Hr(e){if(!e||e.nodeType!==Ct)throw it(),ft;return e.data}function Ft(e){return e===this.v}function Pn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Mt(e){return!Pn(e,this.v)}let Be=!1;function qr(){Be=!0}let S=null;function Ye(e){S=e}function Vr(e,t=!1,n){S={p:S,i:!1,c:null,e:null,s:e,x:null,l:Be&&!t?{s:null,u:null,$:[]}:null}}function Ur(e){var t=S,n=t.e;if(n!==null){t.e=null;for(var r of n)Jt(r)}return t.i=!0,S=t.p,{}}function Ce(){return!Be||S!==null&&S.l===null}let re=[];function Lt(){var e=re;re=[],En(e)}function mt(e){if(re.length===0&&!Oe){var t=re;queueMicrotask(()=>{t===re&&Lt()})}re.push(e)}function Cn(){for(;re.length>0;)Lt()}function Fn(e){var t=w;if(t===null)return _.f|=Z,e;if((t.f&oe)===0&&(t.f&De)===0)throw e;He(e,t)}function He(e,t){for(;t!==null;){if((t.f&mn)!==0){if((t.f&oe)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Mn=-7169;function E(e,t){e.f=e.f&Mn|t}function at(e){(e.f&P)!==0||e.deps===null?E(e,g):E(e,Y)}function jt(e){if(e!==null)for(const t of e)(t.f&A)===0||(t.f&ue)===0||(t.f^=ue,jt(t.deps))}function Ln(e,t,n){(e.f&R)!==0?t.add(e):(e.f&Y)!==0&&n.add(e),jt(e.deps),E(e,g)}const Me=new Set;let d=null,gt=null,b=null,N=[],Ge=null,Ze=!1,Oe=!1;var pe,he,fe,we,ke,xe,ie,U,ye,D,We,Je,Qe,Yt;const dt=class dt{constructor(){F(this,D);de(this,"current",new Map);de(this,"previous",new Map);F(this,pe,new Set);F(this,he,new Set);F(this,fe,0);F(this,we,0);F(this,ke,null);F(this,xe,new Set);F(this,ie,new Set);F(this,U,new Map);de(this,"is_fork",!1);F(this,ye,!1)}skip_effect(t){p(this,U).has(t)||p(this,U).set(t,{d:[],m:[]})}unskip_effect(t){var n=p(this,U).get(t);if(n){p(this,U).delete(t);for(var r of n.d)E(r,R),B(r);for(r of n.m)E(r,Y),B(r)}}process(t){var s;N=[],this.apply();var n=[],r=[];for(const f of t)K(this,D,Je).call(this,f,n,r);if(K(this,D,We).call(this)){K(this,D,Qe).call(this,r),K(this,D,Qe).call(this,n);for(const[f,a]of p(this,U))Ut(f,a)}else{for(const f of p(this,pe))f();p(this,pe).clear(),p(this,fe)===0&&K(this,D,Yt).call(this),gt=this,d=null,Tt(r),Tt(n),gt=null,(s=p(this,ke))==null||s.resolve()}b=null}capture(t,n){n!==T&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&Z)===0&&(this.current.set(t,t.v),b==null||b.set(t,t.v))}activate(){d=this,this.apply()}deactivate(){d===this&&(d=null,b=null)}flush(){if(this.activate(),N.length>0){if(Ht(),d!==null&&d!==this)return}else p(this,fe)===0&&this.process([]);this.deactivate()}discard(){for(const t of p(this,he))t(this);p(this,he).clear()}increment(t){z(this,fe,p(this,fe)+1),t&&z(this,we,p(this,we)+1)}decrement(t){z(this,fe,p(this,fe)-1),t&&z(this,we,p(this,we)-1),!p(this,ye)&&(z(this,ye,!0),mt(()=>{z(this,ye,!1),K(this,D,We).call(this)?N.length>0&&this.flush():this.revive()}))}revive(){for(const t of p(this,xe))p(this,ie).delete(t),E(t,R),B(t);for(const t of p(this,ie))E(t,Y),B(t);this.flush()}oncommit(t){p(this,pe).add(t)}ondiscard(t){p(this,he).add(t)}settled(){return(p(this,ke)??z(this,ke,xt())).promise}static ensure(){if(d===null){const t=d=new dt;Me.add(d),Oe||mt(()=>{d===t&&t.flush()})}return d}apply(){}};pe=new WeakMap,he=new WeakMap,fe=new WeakMap,we=new WeakMap,ke=new WeakMap,xe=new WeakMap,ie=new WeakMap,U=new WeakMap,ye=new WeakMap,D=new WeakSet,We=function(){return this.is_fork||p(this,we)>0},Je=function(t,n,r){t.f^=g;for(var s=t.first;s!==null;){var f=s.f,a=(f&(H|ve))!==0,l=a&&(f&g)!==0,i=l||(f&j)!==0||p(this,U).has(s);if(!i&&s.fn!==null){a?s.f^=g:(f&De)!==0?n.push(s):Fe(s)&&((f&G)!==0&&p(this,ie).add(s),be(s));var o=s.first;if(o!==null){s=o;continue}}for(;s!==null;){var c=s.next;if(c!==null){s=c;break}s=s.parent}}},Qe=function(t){for(var n=0;n1){this.previous.clear();var t=b,n=!0;for(const f of Me){if(f===this){n=!1;continue}const a=[];for(const[i,o]of this.current){if(f.current.has(i))if(n&&o!==f.current.get(i))f.current.set(i,o);else continue;a.push(i)}if(a.length===0)continue;const l=[...f.current.keys()].filter(i=>!this.current.has(i));if(l.length>0){var r=N;N=[];const i=new Set,o=new Map;for(const c of a)qt(c,l,i,o);if(N.length>0){d=f,f.apply();for(const c of N)K(s=f,D,Je).call(s,c,[],[]);f.deactivate()}N=r}}d=null,b=t}Me.delete(this)};let ge=dt;function jn(e){var t=Oe;Oe=!0;try{for(var n;;){if(Cn(),N.length===0&&(d==null||d.flush(),N.length===0))return Ge=null,n;Ht()}}finally{Oe=t}}function Ht(){Ze=!0;var e=null;try{for(var t=0;N.length>0;){var n=ge.ensure();if(t++>1e3){var r,s;Yn()}n.process(N),W.clear()}}finally{N=[],Ze=!1,Ge=null}}function Yn(){try{Sn()}catch(e){He(e,Ge)}}let M=null;function Tt(e){var t=e.length;if(t!==0){for(var n=0;n0)){W.clear();for(const s of M){if((s.f&($|j))!==0)continue;const f=[s];let a=s.parent;for(;a!==null;)M.has(a)&&(M.delete(a),f.push(a)),a=a.parent;for(let l=f.length-1;l>=0;l--){const i=f[l];(i.f&($|j))===0&&be(i)}}M.clear()}}M=null}}function qt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&A)!==0?qt(s,t,n,r):(f&(st|G))!==0&&(f&R)===0&&Vt(s,t,r)&&(E(s,R),B(s))}}function Vt(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(Ee.call(t,s))return!0;if((s.f&A)!==0&&Vt(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function B(e){var t=Ge=e,n=t.b;if(n!=null&&n.is_pending&&(e.f&(De|Ie|Dt))!==0&&(e.f&oe)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(Ze&&t===w&&(r&G)!==0&&(r&It)===0&&(r&oe)!==0)return;if((r&(ve|H))!==0){if((r&g)===0)return;t.f^=g}}N.push(t)}function Ut(e,t){if(!((e.f&H)!==0&&(e.f&g)!==0)){(e.f&R)!==0?t.d.push(e):(e.f&Y)!==0&&t.m.push(e),E(e,g);for(var n=e.first;n!==null;)Ut(n,t),n=n.next}}function Hn(e,t,n,r){const s=Ce()?lt:Bn;var f=e.filter(u=>!u.settled);if(n.length===0&&f.length===0){r(t.map(s));return}var a=w,l=qn(),i=f.length===1?f[0].promise:f.length>1?Promise.all(f.map(u=>u.promise)):null;function o(u){l();try{r(u)}catch(v){(a.f&$)===0&&He(v,a)}et()}if(n.length===0){i.then(()=>o(t.map(s)));return}function c(){l(),Promise.all(n.map(u=>Un(u))).then(u=>o([...t.map(s),...u])).catch(u=>He(u,a))}i?i.then(c):c()}function qn(){var e=w,t=_,n=S,r=d;return function(f=!0){Te(e),Q(t),Ye(n),f&&(r==null||r.activate())}}function et(e=!0){Te(null),Q(null),Ye(null),e&&(d==null||d.deactivate())}function Vn(){var e=w.b,t=d,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function lt(e){var t=A|R,n=_!==null&&(_.f&A)!==0?_:null;return w!==null&&(w.f|=Pe),{ctx:S,deps:null,effects:null,equals:Ft,f:t,fn:e,reactions:null,rv:0,v:T,wv:0,parent:n??w,ac:null}}function Un(e,t,n){w===null&&gn();var s=void 0,f=ut(T),a=!_,l=new Map;return er(()=>{var v;var i=xt();s=i.promise;try{Promise.resolve(e()).then(i.resolve,i.reject).finally(et)}catch(y){i.reject(y),et()}var o=d;if(a){var c=Vn();(v=l.get(o))==null||v.reject(ne),l.delete(o),l.set(o,i)}const u=(y,h=void 0)=>{if(o.activate(),h)h!==ne&&(f.f|=Z,nt(f,h));else{(f.f&Z)!==0&&(f.f^=Z),nt(f,y);for(const[V,O]of l){if(l.delete(V),V===o)break;O.reject(ne)}}c&&c()};i.promise.then(u,y=>u(null,y||"unknown"))}),Qn(()=>{for(const i of l.values())i.reject(ne)}),new Promise(i=>{function o(c){function u(){c===s?i(f):o(s)}c.then(u,u)}o(s)})}function Br(e){const t=lt(e);return rn(t),t}function Bn(e){const t=lt(e);return t.equals=Mt,t}function Gn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!zt&&Xn()}return t}function Xn(){zt=!1;for(const e of tt)(e.f&g)!==0&&E(e,Y),Fe(e)&&be(e);tt.clear()}function Xe(e){te(e,e.v+1)}function Kt(e,t){var n=e.reactions;if(n!==null)for(var r=Ce(),s=n.length,f=0;f{if(le===f)return l();var i=_,o=le;Q(null),Ot(f);var c=l();return Q(i),Ot(o),c};return r&&n.set("length",X(e.length)),new Proxy(e,{defineProperty(l,i,o){(!("value"in o)||o.configurable===!1||o.enumerable===!1||o.writable===!1)&&Rn();var c=n.get(i);return c===void 0?a(()=>{var u=X(o.value);return n.set(i,u),u}):te(c,o.value,!0),!0},deleteProperty(l,i){var o=n.get(i);if(o===void 0){if(i in l){const c=a(()=>X(T));n.set(i,c),Xe(s)}}else te(o,T),Xe(s);return!0},get(l,i,o){var y;if(i===ae)return e;var c=n.get(i),u=i in l;if(c===void 0&&(!u||(y=Re(l,i))!=null&&y.writable)&&(c=a(()=>{var h=Ae(u?l[i]:T),V=X(h);return V}),n.set(i,c)),c!==void 0){var v=Se(c);return v===T?void 0:v}return Reflect.get(l,i,o)},getOwnPropertyDescriptor(l,i){var o=Reflect.getOwnPropertyDescriptor(l,i);if(o&&"value"in o){var c=n.get(i);c&&(o.value=Se(c))}else if(o===void 0){var u=n.get(i),v=u==null?void 0:u.v;if(u!==void 0&&v!==T)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return o},has(l,i){var v;if(i===ae)return!0;var o=n.get(i),c=o!==void 0&&o.v!==T||Reflect.has(l,i);if(o!==void 0||w!==null&&(!c||(v=Re(l,i))!=null&&v.writable)){o===void 0&&(o=a(()=>{var y=c?Ae(l[i]):T,h=X(y);return h}),n.set(i,o));var u=Se(o);if(u===T)return!1}return c},set(l,i,o,c){var ht;var u=n.get(i),v=i in l;if(r&&i==="length")for(var y=o;yX(T)),n.set(y+"",h))}if(u===void 0)(!v||(ht=Re(l,i))!=null&&ht.writable)&&(u=a(()=>X(void 0)),te(u,Ae(o)),n.set(i,u));else{v=u.v!==T;var V=a(()=>Ae(o));te(u,V)}var O=Reflect.getOwnPropertyDescriptor(l,i);if(O!=null&&O.set&&O.set.call(c,o),!v){if(r&&typeof i=="string"){var pt=n.get("length"),ze=Number(i);Number.isInteger(ze)&&ze>=pt.v&&te(pt,ze+1)}Xe(s)}return!0},ownKeys(l){Se(s);var i=Reflect.ownKeys(l).filter(u=>{var v=n.get(u);return v===void 0||v.v!==T});for(var[o,c]of n)c.v!==T&&!(o in l)&&i.push(o);return i},setPrototypeOf(){On()}})}function bt(e){try{if(e!==null&&typeof e=="object"&&ae in e)return e[ae]}catch{}return e}function zr(e,t){return Object.is(bt(e),bt(t))}var At,$n,Xt,$t;function Kr(){if(At===void 0){At=window,$n=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Xt=Re(t,"firstChild").get,$t=Re(t,"nextSibling").get,yt(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),yt(n)&&(n.__t=void 0)}}function qe(e=""){return document.createTextNode(e)}function Ve(e){return Xt.call(e)}function ee(e){return $t.call(e)}function Xr(e,t){if(!J)return Ve(e);var n=Ve(m);if(n===null)n=m.appendChild(qe());else if(t&&n.nodeType!==Ue){var r=qe();return n==null||n.before(r),me(r),r}return t&&ct(n),me(n),n}function $r(e,t=!1){if(!J){var n=Ve(e);return n instanceof Comment&&n.data===""?ee(n):n}if(t){if((m==null?void 0:m.nodeType)!==Ue){var r=qe();return m==null||m.before(r),me(r),r}ct(m)}return m}function Zr(e,t=1,n=!1){let r=J?m:e;for(var s;t--;)s=r,r=ee(r);if(!J)return r;if(n){if((r==null?void 0:r.nodeType)!==Ue){var f=qe();return r===null?s==null||s.after(f):r.before(f),me(f),f}ct(r)}return me(r),r}function Zn(e){e.textContent=""}function Wr(){return!1}function Jr(e,t,n){return document.createElementNS(In,e,void 0)}function ct(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Ue;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Qr(e){J&&Ve(e)!==null&&Zn(e)}let St=!1;function Wn(){St||(St=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function _t(e){var t=_,n=w;Q(null),Te(null);try{return e()}finally{Q(t),Te(n)}}function es(e,t,n,r=n){e.addEventListener(t,()=>_t(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),Wn()}function Zt(e){w===null&&(_===null&&An(),bn()),_e&&Tn()}function Jn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function q(e,t,n){var r=w;r!==null&&(r.f&j)!==0&&(e|=j);var s={ctx:S,deps:null,nodes:null,f:e|R|P,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{be(s)}catch(l){throw ce(s),l}else t!==null&&B(s);var f=s;if(n&&f.deps===null&&f.teardown===null&&f.nodes===null&&f.first===f.last&&(f.f&Pe)===0&&(f=f.first,(e&G)!==0&&(e&je)!==0&&f!==null&&(f.f|=je)),f!==null&&(f.parent=r,r!==null&&Jn(f,r),_!==null&&(_.f&A)!==0&&(e&ve)===0)){var a=_;(a.effects??(a.effects=[])).push(f)}return s}function Wt(){return _!==null&&!L}function Qn(e){const t=q(Ie,null,!1);return E(t,g),t.teardown=e,t}function ts(e){Zt();var t=w.f,n=!_&&(t&H)!==0&&(t&oe)===0;if(n){var r=S;(r.e??(r.e=[])).push(e)}else return Jt(e)}function Jt(e){return q(De|Pt,e,!1)}function ns(e){return Zt(),q(Ie|Pt,e,!0)}function rs(e){ge.ensure();const t=q(ve|Pe,e,!0);return(n={})=>new Promise(r=>{n.outro?rr(t,()=>{ce(t),r(void 0)}):(ce(t),r(void 0))})}function ss(e){return q(De,e,!1)}function er(e){return q(st|Pe,e,!0)}function fs(e,t=0){return q(Ie|t,e,!0)}function is(e,t=[],n=[],r=[]){Hn(r,t,n,s=>{q(Ie,()=>e(...s.map(Se)),!0)})}function as(e,t=0){var n=q(G|t,e,!0);return n}function ls(e){return q(H|Pe,e,!0)}function Qt(e){var t=e.teardown;if(t!==null){const n=_e,r=_;Rt(!0),Q(null);try{t.call(null)}finally{Rt(n),Q(r)}}}function vt(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&_t(()=>{s.abort(ne)});var r=n.next;(n.f&ve)!==0?n.parent=null:ce(n,t),n=r}}function tr(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&H)===0&&ce(t),t=n}}function ce(e,t=!0){var n=!1;(t||(e.f&It)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(nr(e.nodes.start,e.nodes.end),n=!0),vt(e,t&&!n),Ne(e,0),E(e,$);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();Qt(e);var s=e.parent;s!==null&&s.first!==null&&en(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function nr(e,t){for(;e!==null;){var n=e===t?null:ee(e);e.remove(),e=n}}function en(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function rr(e,t,n=!0){var r=[];tn(e,r,!0);var s=()=>{n&&ce(e),t&&t()},f=r.length;if(f>0){var a=()=>--f||s();for(var l of r)l.out(a)}else s()}function tn(e,t,n){if((e.f&j)===0){e.f^=j;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var s=e.first;s!==null;){var f=s.next,a=(s.f&je)!==0||(s.f&H)!==0&&(e.f&G)!==0;tn(s,t,a?n:!1),s=f}}}function os(e){nn(e,!0)}function nn(e,t){if((e.f&j)!==0){e.f^=j,(e.f&g)===0&&(E(e,R),B(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&je)!==0||(n.f&H)!==0;nn(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const a of f)(a.is_global||t)&&a.in()}}function us(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:ee(n);t.append(n),n=s}}let Le=!1,_e=!1;function Rt(e){_e=e}let _=null,L=!1;function Q(e){_=e}let w=null;function Te(e){w=e}let C=null;function rn(e){_!==null&&(C===null?C=[e]:C.push(e))}let k=null,x=0,I=null;function sr(e){I=e}let sn=1,se=0,le=se;function Ot(e){le=e}function fn(){return++sn}function Fe(e){var t=e.f;if((t&R)!==0)return!0;if(t&A&&(e.f&=~ue),(t&Y)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&P)!==0&&b===null&&E(e,g)}return!1}function an(e,t,n=!0){var r=e.reactions;if(r!==null&&!(C!==null&&Ee.call(C,e)))for(var s=0;s{e.ac.abort(ne)}),e.ac=null);try{e.f|=$e;var c=e.fn,u=c();e.f|=oe;var v=e.deps,y=d==null?void 0:d.is_fork;if(k!==null){var h;if(y||Ne(e,x),v!==null&&x>0)for(v.length=x+k.length,h=0;h{throw TypeError(e)};var _n=(e,t,n)=>t in e?cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t,n)=>_n(e,typeof t!="symbol"?t+"":t,n),Ke=(e,t,n)=>t.has(e)||wt("Cannot "+n);var p=(e,t,n)=>(Ke(e,t,"read from private field"),n?n.call(e):t.get(e)),F=(e,t,n)=>t.has(e)?wt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),z=(e,t,n,r)=>(Ke(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),K=(e,t,n)=>(Ke(e,t,"access private method"),n);var vn=Array.isArray,dn=Array.prototype.indexOf,Ee=Array.prototype.includes,ar=Array.from,lr=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,pn=Object.getOwnPropertyDescriptors,hn=Object.prototype,wn=Array.prototype,kt=Object.getPrototypeOf,yt=Object.isExtensible;const yn=()=>{};function or(e){return e()}function En(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}function ur(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const A=2,De=4,Ie=8,Dt=1<<24,G=16,H=32,ve=64,mn=128,P=512,g=1024,R=2048,Y=4096,j=8192,$=16384,oe=32768,je=65536,Et=1<<17,It=1<<18,Pe=1<<19,Pt=1<<20,cr=1<<25,ue=65536,$e=1<<21,st=1<<22,Z=1<<23,ae=Symbol("$state"),_r=Symbol("legacy props"),vr=Symbol(""),ne=new class extends Error{constructor(){super(...arguments);de(this,"name","StaleReactionError");de(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Nt;const pr=!!((Nt=globalThis.document)!=null&&Nt.contentType)&&globalThis.document.contentType.includes("xml"),Ue=3,Ct=8;function gn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function hr(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Tn(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function bn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function An(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Sn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function wr(){throw new Error("https://svelte.dev/e/hydration_failed")}function yr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Rn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function On(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Nn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Er(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const mr=1,gr=2,Tr=4,br=8,Ar=16,Sr=1,Rr=2,Or=4,Nr=8,kr=16,xr=1,Dr=2,kn="[",xn="[!",Ir="[?",Dn="]",ft={},T=Symbol(),In="http://www.w3.org/1999/xhtml";function it(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Pr(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Cr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let J=!1;function Fr(e){J=e}let m;function me(e){if(e===null)throw it(),ft;return m=e}function Mr(){return me(ee(m))}function Lr(e){if(J){if(ee(m)!==null)throw it(),ft;m=e}}function jr(e=1){if(J){for(var t=e,n=m;t--;)n=ee(n);m=n}}function Yr(e=!0){for(var t=0,n=m;;){if(n.nodeType===Ct){var r=n.data;if(r===Dn){if(t===0)return n;t-=1}else(r===kn||r===xn||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var s=ee(n);e&&n.remove(),n=s}}function Hr(e){if(!e||e.nodeType!==Ct)throw it(),ft;return e.data}function Ft(e){return e===this.v}function Pn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Mt(e){return!Pn(e,this.v)}let Be=!1;function qr(){Be=!0}let S=null;function Ye(e){S=e}function Vr(e,t=!1,n){S={p:S,i:!1,c:null,e:null,s:e,x:null,l:Be&&!t?{s:null,u:null,$:[]}:null}}function Ur(e){var t=S,n=t.e;if(n!==null){t.e=null;for(var r of n)Jt(r)}return t.i=!0,S=t.p,{}}function Ce(){return!Be||S!==null&&S.l===null}let re=[];function Lt(){var e=re;re=[],En(e)}function mt(e){if(re.length===0&&!Oe){var t=re;queueMicrotask(()=>{t===re&&Lt()})}re.push(e)}function Cn(){for(;re.length>0;)Lt()}function Fn(e){var t=w;if(t===null)return _.f|=Z,e;if((t.f&oe)===0&&(t.f&De)===0)throw e;He(e,t)}function He(e,t){for(;t!==null;){if((t.f&mn)!==0){if((t.f&oe)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Mn=-7169;function E(e,t){e.f=e.f&Mn|t}function at(e){(e.f&P)!==0||e.deps===null?E(e,g):E(e,Y)}function jt(e){if(e!==null)for(const t of e)(t.f&A)===0||(t.f&ue)===0||(t.f^=ue,jt(t.deps))}function Ln(e,t,n){(e.f&R)!==0?t.add(e):(e.f&Y)!==0&&n.add(e),jt(e.deps),E(e,g)}const Me=new Set;let d=null,gt=null,b=null,N=[],Ge=null,Ze=!1,Oe=!1;var pe,he,fe,we,ke,xe,ie,U,ye,D,We,Je,Qe,Yt;const dt=class dt{constructor(){F(this,D);de(this,"current",new Map);de(this,"previous",new Map);F(this,pe,new Set);F(this,he,new Set);F(this,fe,0);F(this,we,0);F(this,ke,null);F(this,xe,new Set);F(this,ie,new Set);F(this,U,new Map);de(this,"is_fork",!1);F(this,ye,!1)}skip_effect(t){p(this,U).has(t)||p(this,U).set(t,{d:[],m:[]})}unskip_effect(t){var n=p(this,U).get(t);if(n){p(this,U).delete(t);for(var r of n.d)E(r,R),B(r);for(r of n.m)E(r,Y),B(r)}}process(t){var s;N=[],this.apply();var n=[],r=[];for(const f of t)K(this,D,Je).call(this,f,n,r);if(K(this,D,We).call(this)){K(this,D,Qe).call(this,r),K(this,D,Qe).call(this,n);for(const[f,a]of p(this,U))Ut(f,a)}else{for(const f of p(this,pe))f();p(this,pe).clear(),p(this,fe)===0&&K(this,D,Yt).call(this),gt=this,d=null,Tt(r),Tt(n),gt=null,(s=p(this,ke))==null||s.resolve()}b=null}capture(t,n){n!==T&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&Z)===0&&(this.current.set(t,t.v),b==null||b.set(t,t.v))}activate(){d=this,this.apply()}deactivate(){d===this&&(d=null,b=null)}flush(){if(this.activate(),N.length>0){if(Ht(),d!==null&&d!==this)return}else p(this,fe)===0&&this.process([]);this.deactivate()}discard(){for(const t of p(this,he))t(this);p(this,he).clear()}increment(t){z(this,fe,p(this,fe)+1),t&&z(this,we,p(this,we)+1)}decrement(t){z(this,fe,p(this,fe)-1),t&&z(this,we,p(this,we)-1),!p(this,ye)&&(z(this,ye,!0),mt(()=>{z(this,ye,!1),K(this,D,We).call(this)?N.length>0&&this.flush():this.revive()}))}revive(){for(const t of p(this,xe))p(this,ie).delete(t),E(t,R),B(t);for(const t of p(this,ie))E(t,Y),B(t);this.flush()}oncommit(t){p(this,pe).add(t)}ondiscard(t){p(this,he).add(t)}settled(){return(p(this,ke)??z(this,ke,xt())).promise}static ensure(){if(d===null){const t=d=new dt;Me.add(d),Oe||mt(()=>{d===t&&t.flush()})}return d}apply(){}};pe=new WeakMap,he=new WeakMap,fe=new WeakMap,we=new WeakMap,ke=new WeakMap,xe=new WeakMap,ie=new WeakMap,U=new WeakMap,ye=new WeakMap,D=new WeakSet,We=function(){return this.is_fork||p(this,we)>0},Je=function(t,n,r){t.f^=g;for(var s=t.first;s!==null;){var f=s.f,a=(f&(H|ve))!==0,l=a&&(f&g)!==0,i=l||(f&j)!==0||p(this,U).has(s);if(!i&&s.fn!==null){a?s.f^=g:(f&De)!==0?n.push(s):Fe(s)&&((f&G)!==0&&p(this,ie).add(s),be(s));var o=s.first;if(o!==null){s=o;continue}}for(;s!==null;){var c=s.next;if(c!==null){s=c;break}s=s.parent}}},Qe=function(t){for(var n=0;n1){this.previous.clear();var t=b,n=!0;for(const f of Me){if(f===this){n=!1;continue}const a=[];for(const[i,o]of this.current){if(f.current.has(i))if(n&&o!==f.current.get(i))f.current.set(i,o);else continue;a.push(i)}if(a.length===0)continue;const l=[...f.current.keys()].filter(i=>!this.current.has(i));if(l.length>0){var r=N;N=[];const i=new Set,o=new Map;for(const c of a)qt(c,l,i,o);if(N.length>0){d=f,f.apply();for(const c of N)K(s=f,D,Je).call(s,c,[],[]);f.deactivate()}N=r}}d=null,b=t}Me.delete(this)};let ge=dt;function jn(e){var t=Oe;Oe=!0;try{for(var n;;){if(Cn(),N.length===0&&(d==null||d.flush(),N.length===0))return Ge=null,n;Ht()}}finally{Oe=t}}function Ht(){Ze=!0;var e=null;try{for(var t=0;N.length>0;){var n=ge.ensure();if(t++>1e3){var r,s;Yn()}n.process(N),W.clear()}}finally{N=[],Ze=!1,Ge=null}}function Yn(){try{Sn()}catch(e){He(e,Ge)}}let M=null;function Tt(e){var t=e.length;if(t!==0){for(var n=0;n0)){W.clear();for(const s of M){if((s.f&($|j))!==0)continue;const f=[s];let a=s.parent;for(;a!==null;)M.has(a)&&(M.delete(a),f.push(a)),a=a.parent;for(let l=f.length-1;l>=0;l--){const i=f[l];(i.f&($|j))===0&&be(i)}}M.clear()}}M=null}}function qt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&A)!==0?qt(s,t,n,r):(f&(st|G))!==0&&(f&R)===0&&Vt(s,t,r)&&(E(s,R),B(s))}}function Vt(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(Ee.call(t,s))return!0;if((s.f&A)!==0&&Vt(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function B(e){var t=Ge=e,n=t.b;if(n!=null&&n.is_pending&&(e.f&(De|Ie|Dt))!==0&&(e.f&oe)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(Ze&&t===w&&(r&G)!==0&&(r&It)===0&&(r&oe)!==0)return;if((r&(ve|H))!==0){if((r&g)===0)return;t.f^=g}}N.push(t)}function Ut(e,t){if(!((e.f&H)!==0&&(e.f&g)!==0)){(e.f&R)!==0?t.d.push(e):(e.f&Y)!==0&&t.m.push(e),E(e,g);for(var n=e.first;n!==null;)Ut(n,t),n=n.next}}function Hn(e,t,n,r){const s=Ce()?lt:Bn;var f=e.filter(u=>!u.settled);if(n.length===0&&f.length===0){r(t.map(s));return}var a=w,l=qn(),i=f.length===1?f[0].promise:f.length>1?Promise.all(f.map(u=>u.promise)):null;function o(u){l();try{r(u)}catch(v){(a.f&$)===0&&He(v,a)}et()}if(n.length===0){i.then(()=>o(t.map(s)));return}function c(){l(),Promise.all(n.map(u=>Un(u))).then(u=>o([...t.map(s),...u])).catch(u=>He(u,a))}i?i.then(c):c()}function qn(){var e=w,t=_,n=S,r=d;return function(f=!0){Te(e),Q(t),Ye(n),f&&(r==null||r.activate())}}function et(e=!0){Te(null),Q(null),Ye(null),e&&(d==null||d.deactivate())}function Vn(){var e=w.b,t=d,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function lt(e){var t=A|R,n=_!==null&&(_.f&A)!==0?_:null;return w!==null&&(w.f|=Pe),{ctx:S,deps:null,effects:null,equals:Ft,f:t,fn:e,reactions:null,rv:0,v:T,wv:0,parent:n??w,ac:null}}function Un(e,t,n){w===null&&gn();var s=void 0,f=ut(T),a=!_,l=new Map;return er(()=>{var v;var i=xt();s=i.promise;try{Promise.resolve(e()).then(i.resolve,i.reject).finally(et)}catch(y){i.reject(y),et()}var o=d;if(a){var c=Vn();(v=l.get(o))==null||v.reject(ne),l.delete(o),l.set(o,i)}const u=(y,h=void 0)=>{if(o.activate(),h)h!==ne&&(f.f|=Z,nt(f,h));else{(f.f&Z)!==0&&(f.f^=Z),nt(f,y);for(const[V,O]of l){if(l.delete(V),V===o)break;O.reject(ne)}}c&&c()};i.promise.then(u,y=>u(null,y||"unknown"))}),Qn(()=>{for(const i of l.values())i.reject(ne)}),new Promise(i=>{function o(c){function u(){c===s?i(f):o(s)}c.then(u,u)}o(s)})}function Br(e){const t=lt(e);return rn(t),t}function Bn(e){const t=lt(e);return t.equals=Mt,t}function Gn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!zt&&Xn()}return t}function Xn(){zt=!1;for(const e of tt)(e.f&g)!==0&&E(e,Y),Fe(e)&&be(e);tt.clear()}function Xe(e){te(e,e.v+1)}function Kt(e,t){var n=e.reactions;if(n!==null)for(var r=Ce(),s=n.length,f=0;f{if(le===f)return l();var i=_,o=le;Q(null),Ot(f);var c=l();return Q(i),Ot(o),c};return r&&n.set("length",X(e.length)),new Proxy(e,{defineProperty(l,i,o){(!("value"in o)||o.configurable===!1||o.enumerable===!1||o.writable===!1)&&Rn();var c=n.get(i);return c===void 0?a(()=>{var u=X(o.value);return n.set(i,u),u}):te(c,o.value,!0),!0},deleteProperty(l,i){var o=n.get(i);if(o===void 0){if(i in l){const c=a(()=>X(T));n.set(i,c),Xe(s)}}else te(o,T),Xe(s);return!0},get(l,i,o){var y;if(i===ae)return e;var c=n.get(i),u=i in l;if(c===void 0&&(!u||(y=Re(l,i))!=null&&y.writable)&&(c=a(()=>{var h=Ae(u?l[i]:T),V=X(h);return V}),n.set(i,c)),c!==void 0){var v=Se(c);return v===T?void 0:v}return Reflect.get(l,i,o)},getOwnPropertyDescriptor(l,i){var o=Reflect.getOwnPropertyDescriptor(l,i);if(o&&"value"in o){var c=n.get(i);c&&(o.value=Se(c))}else if(o===void 0){var u=n.get(i),v=u==null?void 0:u.v;if(u!==void 0&&v!==T)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return o},has(l,i){var v;if(i===ae)return!0;var o=n.get(i),c=o!==void 0&&o.v!==T||Reflect.has(l,i);if(o!==void 0||w!==null&&(!c||(v=Re(l,i))!=null&&v.writable)){o===void 0&&(o=a(()=>{var y=c?Ae(l[i]):T,h=X(y);return h}),n.set(i,o));var u=Se(o);if(u===T)return!1}return c},set(l,i,o,c){var ht;var u=n.get(i),v=i in l;if(r&&i==="length")for(var y=o;yX(T)),n.set(y+"",h))}if(u===void 0)(!v||(ht=Re(l,i))!=null&&ht.writable)&&(u=a(()=>X(void 0)),te(u,Ae(o)),n.set(i,u));else{v=u.v!==T;var V=a(()=>Ae(o));te(u,V)}var O=Reflect.getOwnPropertyDescriptor(l,i);if(O!=null&&O.set&&O.set.call(c,o),!v){if(r&&typeof i=="string"){var pt=n.get("length"),ze=Number(i);Number.isInteger(ze)&&ze>=pt.v&&te(pt,ze+1)}Xe(s)}return!0},ownKeys(l){Se(s);var i=Reflect.ownKeys(l).filter(u=>{var v=n.get(u);return v===void 0||v.v!==T});for(var[o,c]of n)c.v!==T&&!(o in l)&&i.push(o);return i},setPrototypeOf(){On()}})}function bt(e){try{if(e!==null&&typeof e=="object"&&ae in e)return e[ae]}catch{}return e}function zr(e,t){return Object.is(bt(e),bt(t))}var At,$n,Xt,$t;function Kr(){if(At===void 0){At=window,$n=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Xt=Re(t,"firstChild").get,$t=Re(t,"nextSibling").get,yt(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),yt(n)&&(n.__t=void 0)}}function qe(e=""){return document.createTextNode(e)}function Ve(e){return Xt.call(e)}function ee(e){return $t.call(e)}function Xr(e,t){if(!J)return Ve(e);var n=Ve(m);if(n===null)n=m.appendChild(qe());else if(t&&n.nodeType!==Ue){var r=qe();return n==null||n.before(r),me(r),r}return t&&ct(n),me(n),n}function $r(e,t=!1){if(!J){var n=Ve(e);return n instanceof Comment&&n.data===""?ee(n):n}if(t){if((m==null?void 0:m.nodeType)!==Ue){var r=qe();return m==null||m.before(r),me(r),r}ct(m)}return m}function Zr(e,t=1,n=!1){let r=J?m:e;for(var s;t--;)s=r,r=ee(r);if(!J)return r;if(n){if((r==null?void 0:r.nodeType)!==Ue){var f=qe();return r===null?s==null||s.after(f):r.before(f),me(f),f}ct(r)}return me(r),r}function Zn(e){e.textContent=""}function Wr(){return!1}function Jr(e,t,n){return document.createElementNS(In,e,void 0)}function ct(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Ue;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Qr(e){J&&Ve(e)!==null&&Zn(e)}let St=!1;function Wn(){St||(St=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function _t(e){var t=_,n=w;Q(null),Te(null);try{return e()}finally{Q(t),Te(n)}}function es(e,t,n,r=n){e.addEventListener(t,()=>_t(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),Wn()}function Zt(e){w===null&&(_===null&&An(),bn()),_e&&Tn()}function Jn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function q(e,t,n){var r=w;r!==null&&(r.f&j)!==0&&(e|=j);var s={ctx:S,deps:null,nodes:null,f:e|R|P,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{be(s)}catch(l){throw ce(s),l}else t!==null&&B(s);var f=s;if(n&&f.deps===null&&f.teardown===null&&f.nodes===null&&f.first===f.last&&(f.f&Pe)===0&&(f=f.first,(e&G)!==0&&(e&je)!==0&&f!==null&&(f.f|=je)),f!==null&&(f.parent=r,r!==null&&Jn(f,r),_!==null&&(_.f&A)!==0&&(e&ve)===0)){var a=_;(a.effects??(a.effects=[])).push(f)}return s}function Wt(){return _!==null&&!L}function Qn(e){const t=q(Ie,null,!1);return E(t,g),t.teardown=e,t}function ts(e){Zt();var t=w.f,n=!_&&(t&H)!==0&&(t&oe)===0;if(n){var r=S;(r.e??(r.e=[])).push(e)}else return Jt(e)}function Jt(e){return q(De|Pt,e,!1)}function ns(e){return Zt(),q(Ie|Pt,e,!0)}function rs(e){ge.ensure();const t=q(ve|Pe,e,!0);return(n={})=>new Promise(r=>{n.outro?rr(t,()=>{ce(t),r(void 0)}):(ce(t),r(void 0))})}function ss(e){return q(De,e,!1)}function er(e){return q(st|Pe,e,!0)}function fs(e,t=0){return q(Ie|t,e,!0)}function is(e,t=[],n=[],r=[]){Hn(r,t,n,s=>{q(Ie,()=>e(...s.map(Se)),!0)})}function as(e,t=0){var n=q(G|t,e,!0);return n}function ls(e){return q(H|Pe,e,!0)}function Qt(e){var t=e.teardown;if(t!==null){const n=_e,r=_;Rt(!0),Q(null);try{t.call(null)}finally{Rt(n),Q(r)}}}function vt(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&_t(()=>{s.abort(ne)});var r=n.next;(n.f&ve)!==0?n.parent=null:ce(n,t),n=r}}function tr(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&H)===0&&ce(t),t=n}}function ce(e,t=!0){var n=!1;(t||(e.f&It)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(nr(e.nodes.start,e.nodes.end),n=!0),vt(e,t&&!n),Ne(e,0),E(e,$);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();Qt(e);var s=e.parent;s!==null&&s.first!==null&&en(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function nr(e,t){for(;e!==null;){var n=e===t?null:ee(e);e.remove(),e=n}}function en(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function rr(e,t,n=!0){var r=[];tn(e,r,!0);var s=()=>{n&&ce(e),t&&t()},f=r.length;if(f>0){var a=()=>--f||s();for(var l of r)l.out(a)}else s()}function tn(e,t,n){if((e.f&j)===0){e.f^=j;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var s=e.first;s!==null;){var f=s.next,a=(s.f&je)!==0||(s.f&H)!==0&&(e.f&G)!==0;tn(s,t,a?n:!1),s=f}}}function os(e){nn(e,!0)}function nn(e,t){if((e.f&j)!==0){e.f^=j,(e.f&g)===0&&(E(e,R),B(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&je)!==0||(n.f&H)!==0;nn(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const a of f)(a.is_global||t)&&a.in()}}function us(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:ee(n);t.append(n),n=s}}let Le=!1,_e=!1;function Rt(e){_e=e}let _=null,L=!1;function Q(e){_=e}let w=null;function Te(e){w=e}let C=null;function rn(e){_!==null&&(C===null?C=[e]:C.push(e))}let k=null,x=0,I=null;function sr(e){I=e}let sn=1,se=0,le=se;function Ot(e){le=e}function fn(){return++sn}function Fe(e){var t=e.f;if((t&R)!==0)return!0;if(t&A&&(e.f&=~ue),(t&Y)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&P)!==0&&b===null&&E(e,g)}return!1}function an(e,t,n=!0){var r=e.reactions;if(r!==null&&!(C!==null&&Ee.call(C,e)))for(var s=0;s{e.ac.abort(ne)}),e.ac=null);try{e.f|=$e;var c=e.fn,u=c();e.f|=oe;var v=e.deps,y=d==null?void 0:d.is_fork;if(k!==null){var h;if(y||Ne(e,x),v!==null&&x>0)for(v.length=x+k.length,h=0;h{throw TypeError(t)};var Pe=(t,e,n)=>e.has(t)||Xt("Cannot "+n);var w=(t,e,n)=>(Pe(t,e,"read from private field"),n?n.call(t):e.get(t)),A=(t,e,n)=>e.has(t)?Xt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{s as T,g as I,h as P,I as pt,b8 as Oe}from"./C9Z4nxhR.js";import{w as jt}from"./DnKV7_Y9.js";import{o as Qt}from"./CkyfbJUz.js";class Nt{constructor(e,n){this.status=e,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Dt{constructor(e,n){this.status=e,this.location=n}}class Vt extends Error{constructor(e,n,r){super(r),this.status=e,this.text=n}}new URL("sveltekit-internal://");function $e(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function Ce(t){return t.split("%25").map(decodeURI).join("%25")}function je(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function Lt({href:t}){return t.split("#")[0]}function Ne(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)e=e*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function De(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&Y.delete(qt(t)),Ve(t,e));const Y=new Map;function qe(t,e){const n=qt(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&Y.set(n,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=De(a)),Promise.resolve(new Response(a,s))}return window.fetch(t,e)}function Be(t,e,n){if(Y.size>0){const r=qt(t,n),a=Y.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return e.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return e.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return Ut(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return Ut(String.fromCharCode(...l.slice(2).split("-").map(_=>parseInt(_,16))));const d=Ke.exec(l),[,u,v,f,h]=d;return e.push({name:f,matcher:h,optional:!!u,rest:!!v,chained:v?c===1&&o[0]==="":!1}),v?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return Ut(l)}).join("")}).join("")}/?$`),params:e}}function Fe(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function Ge(t){return t.slice(1).split("/").filter(Fe)}function We(t,e,n){const r={},a=t.slice(1),s=a.filter(i=>i!==void 0);let o=0;for(let i=0;id).join("/"),o=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=e[i+1],u=a[i+1];d&&!d.rest&&d.optional&&u&&l.chained&&(o=0),!d&&!u&&Object.keys(r).length===s.length&&(o=0);continue}if(l.optional&&l.chained){o++;continue}return}if(!o)return r}function Ut(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ye({nodes:t,server_loads:e,dictionary:n,matchers:r}){const a=new Set(e);return Object.entries(n).map(([i,[l,c,d]])=>{const{pattern:u,params:v}=Me(i),f={id:i,exec:h=>{const _=u.exec(h);if(_)return We(_,v,r)},errors:[1,...d||[]].map(h=>t[h]),layouts:[0,...c||[]].map(o),leaf:s(l)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(i){const l=i<0;return l&&(i=~i),[l,t[i]]}function o(i){return i===void 0?i:[a.has(i),t[i]]}}function ue(t,e=JSON.parse){try{return e(sessionStorage[t])}catch{}}function Zt(t,e,n=JSON.stringify){const r=n(e);try{sessionStorage[t]=r}catch{}}var se;const U=((se=globalThis.__sveltekit_1xpb8v1)==null?void 0:se.base)??"/dashboard";var ie;const ze=((ie=globalThis.__sveltekit_1xpb8v1)==null?void 0:ie.assets)??U??"",He="1772420685161",de="sveltekit:snapshot",he="sveltekit:scroll",pe="sveltekit:states",Je="sveltekit:pageurl",F="sveltekit:history",H="sveltekit:navigation",D={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Et=location.origin;function Bt(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function q(){return{x:pageXOffset,y:pageYOffset}}function M(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const te={...D,"":D.hover};function ge(t){let e=t.assignedSlot??t.parentNode;return(e==null?void 0:e.nodeType)===11&&(e=e.host),e}function me(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=ge(t)}}function It(t,e,n){let r;try{if(r=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const i=location.hash.split("#")[1]||"/";r.hash=`#${i}${r.hash}`}}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,s=!r||!!a||St(r,e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===Et&&t.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function gt(t){let e=null,n=null,r=null,a=null,s=null,o=null,i=t;for(;i&&i!==document.documentElement;)r===null&&(r=M(i,"preload-code")),a===null&&(a=M(i,"preload-data")),e===null&&(e=M(i,"keepfocus")),n===null&&(n=M(i,"noscroll")),s===null&&(s=M(i,"reload")),o===null&&(o=M(i,"replacestate")),i=ge(i);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:te[r??"off"],preload_data:te[a??"off"],keepfocus:l(e),noscroll:l(n),reload:l(s),replace_state:l(o)}}function ee(t){const e=jt(t);let n=!0;function r(){n=!0,e.update(o=>o)}function a(o){n=!1,e.set(o)}function s(o){let i;return e.subscribe(l=>{(i===void 0||n&&l!==i)&&o(i=l)})}return{notify:r,set:a,subscribe:s}}const _e={v:()=>{}};function Xe(){const{set:t,subscribe:e}=jt(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${ze}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==He;return o&&(t(!0),_e.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function St(t,e,n){return t.origin!==Et||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function Ln(t){}const we=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...we];const Qe=new Set([...we]);[...Qe];function Ze(t){return t.filter(e=>e!=null)}function Kt(t){return t instanceof Nt||t instanceof Vt?t.status:500}function tn(t){return t instanceof Vt?t.text:"Internal Error"}let R,J,At;const en=Qt.toString().includes("$$")||/function \w+\(\) \{\}/.test(Qt.toString());var et,nt,at,rt,ot,st,it,lt,le,ct,ce,ft,fe;en?(R={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},At={current:!1}):(R=new(le=class{constructor(){A(this,et,T({}));A(this,nt,T(null));A(this,at,T(null));A(this,rt,T({}));A(this,ot,T({id:null}));A(this,st,T({}));A(this,it,T(-1));A(this,lt,T(new URL("https://example.com")))}get data(){return I(w(this,et))}set data(e){P(w(this,et),e)}get form(){return I(w(this,nt))}set form(e){P(w(this,nt),e)}get error(){return I(w(this,at))}set error(e){P(w(this,at),e)}get params(){return I(w(this,rt))}set params(e){P(w(this,rt),e)}get route(){return I(w(this,ot))}set route(e){P(w(this,ot),e)}get state(){return I(w(this,st))}set state(e){P(w(this,st),e)}get status(){return I(w(this,it))}set status(e){P(w(this,it),e)}get url(){return I(w(this,lt))}set url(e){P(w(this,lt),e)}},et=new WeakMap,nt=new WeakMap,at=new WeakMap,rt=new WeakMap,ot=new WeakMap,st=new WeakMap,it=new WeakMap,lt=new WeakMap,le),J=new(ce=class{constructor(){A(this,ct,T(null))}get current(){return I(w(this,ct))}set current(e){P(w(this,ct),e)}},ct=new WeakMap,ce),At=new(fe=class{constructor(){A(this,ft,T(!1))}get current(){return I(w(this,ft))}set current(e){P(w(this,ft),e)}},ft=new WeakMap,fe),_e.v=()=>At.current=!0);function nn(t){Object.assign(R,t)}const an=new Set(["icon","shortcut icon","apple-touch-icon"]),j=ue(he)??{},X=ue(de)??{},C={url:ee({}),page:ee({}),navigating:jt(null),updated:Xe()};function Mt(t){j[t]=q()}function rn(t,e){let n=t+1;for(;j[n];)delete j[n],n+=1;for(n=e+1;X[n];)delete X[n],n+=1}function Q(t,e=!1){return e?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function ve(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(U||"/");t&&await t.update()}}function ne(){}let Ft,Pt,mt,O,Ot,E;const _t=[],wt=[];let y=null;function $t(){var t;(t=y==null?void 0:y.fork)==null||t.then(e=>e==null?void 0:e.discard()),y=null}const ht=new Map,ye=new Set,on=new Set,z=new Set;let m={branch:[],error:null,url:null},be=!1,vt=!1,ae=!0,Z=!1,W=!1,ke=!1,Gt=!1,Ee,k,L,V;const yt=new Set,re=new Map;async function In(t,e,n){var s,o,i,l,c;(s=globalThis.__sveltekit_1xpb8v1)!=null&&s.data&&globalThis.__sveltekit_1xpb8v1.data,document.URL!==location.href&&(location.href=location.href),E=t,await((i=(o=t.hooks).init)==null?void 0:i.call(o)),Ft=Ye(t),O=document.documentElement,Ot=e,Pt=t.nodes[0],mt=t.nodes[1],Pt(),mt(),k=(l=history.state)==null?void 0:l[F],L=(c=history.state)==null?void 0:c[H],k||(k=L=Date.now(),history.replaceState({...history.state,[F]:k,[H]:L},""));const r=j[k];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await vn(Ot,n)):(await G({type:"enter",url:Bt(E.hash?kn(new URL(location.href)):location.href),replace_state:!0}),a()),wn()}function sn(){_t.length=0,Gt=!1}function Se(t){wt.some(e=>e==null?void 0:e.snapshot)&&(X[t]=wt.map(e=>{var n;return(n=e==null?void 0:e.snapshot)==null?void 0:n.capture()}))}function Re(t){var e;(e=X[t])==null||e.forEach((n,r)=>{var a,s;(s=(a=wt[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function oe(){Mt(k),Zt(he,j),Se(L),Zt(de,X)}async function xe(t,e,n,r){let a;e.invalidateAll&&$t(),await G({type:"goto",url:Bt(t),keepfocus:e.keepFocus,noscroll:e.noScroll,replace_state:e.replaceState,state:e.state,redirect_count:n,nav_token:r,accept:()=>{e.invalidateAll&&(Gt=!0,a=[...re.keys()]),e.invalidate&&e.invalidate.forEach(_n)}}),e.invalidateAll&&pt().then(pt).then(()=>{re.forEach(({resource:s},o)=>{var i;a!=null&&a.includes(o)&&((i=s.refresh)==null||i.call(s))})})}async function ln(t){if(t.id!==(y==null?void 0:y.id)){$t();const e={};yt.add(e),y={id:t.id,token:e,promise:Ue({...t,preload:e}).then(n=>(yt.delete(e),n.type==="loaded"&&n.state.error&&$t(),n)),fork:null}}return y.promise}async function Tt(t){var n;const e=(n=await Rt(t,!1))==null?void 0:n.route;e&&await Promise.all([...e.layouts,e.leaf].filter(Boolean).map(r=>r[1]()))}async function Le(t,e,n){var a;m=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(R,t.props.page),Ee=new E.root({target:e,props:{...t.props,stores:C,components:wt},hydrate:n,sync:!1}),await Promise.resolve(),Re(L),n){const s={from:null,to:{params:m.params,route:{id:((a=m.route)==null?void 0:a.id)??null},url:new URL(location.href),scroll:j[k]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(o=>o(s))}vt=!0}function bt({url:t,params:e,branch:n,status:r,error:a,route:s,form:o}){let i="never";if(U&&(t.pathname===U||t.pathname===U+"/"))i="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(i=f.slash);t.pathname=$e(t.pathname,i),t.search=t.search;const l={type:"loaded",state:{url:t,params:e,branch:n,error:a,route:s},props:{constructors:Ze(n).map(f=>f.node.component),page:Jt(R)}};o!==void 0&&(l.props.form=o);let c={},d=!R,u=0;for(let f=0;fi(new URL(o))))return!0;return!1}function Yt(t,e){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?e??null:null}function un(t,e){if(!t)return new Set(e.searchParams.keys());const n=new Set([...t.searchParams.keys(),...e.searchParams.keys()]);for(const r of n){const a=t.searchParams.getAll(r),s=e.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&n.delete(r)}return n}function dn({error:t,url:e,route:n,params:r}){return{type:"loaded",state:{error:t,url:e,route:n,params:r,branch:[]},props:{page:Jt(R),constructors:[]}}}async function Ue({id:t,invalidating:e,url:n,params:r,route:a,preload:s}){if((y==null?void 0:y.id)===t)return yt.delete(y.token),y.promise;const{errors:o,layouts:i,leaf:l}=a,c=[...i,l];o.forEach(g=>g==null?void 0:g().catch(()=>{})),c.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));const d=m.url?t!==kt(m.url):!1,u=m.route?a.id!==m.route.id:!1,v=un(m.url,n);let f=!1;const h=c.map(async(g,p)=>{var $;if(!g)return;const b=m.branch[p];return g[1]===(b==null?void 0:b.loader)&&!fn(f,u,d,v,($=b.universal)==null?void 0:$.uses,r)?b:(f=!0,Wt({loader:g[1],url:n,params:r,route:a,parent:async()=>{var ut;const N={};for(let B=0;B{});const _=[];for(let g=0;gPromise.resolve({}),server_data_node:Yt(s)}),i={node:await mt(),loader:mt,universal:null,server:null,data:null};return bt({url:n,params:a,branch:[o,i],status:t,error:e,route:null})}catch(o){if(o instanceof Dt)return xe(new URL(o.location,location.href),{},0);throw o}}async function pn(t){const e=t.href;if(ht.has(e))return ht.get(e);let n;try{const r=(async()=>{let a=await E.hooks.reroute({url:new URL(t),fetch:async(s,o)=>cn(s,o,t).promise})??t;if(typeof a=="string"){const s=new URL(t);E.hash?s.hash=a:s.pathname=a,a=s}return a})();ht.set(e,r),n=await r}catch{ht.delete(e);return}return n}async function Rt(t,e){if(t&&!St(t,U,E.hash)){const n=await pn(t);if(!n)return;const r=gn(n);for(const a of Ft){const s=a.exec(r);if(s)return{id:kt(t),invalidating:e,route:a,params:je(s),url:t}}}}function gn(t){return Ce(E.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(U.length))||"/"}function kt(t){return(E.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Ae({url:t,type:e,intent:n,delta:r,event:a,scroll:s}){let o=!1;const i=Ht(m,n,t,e,s??null);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const l={...i.navigation,cancel:()=>{o=!0,i.reject(new Error("navigation cancelled"))}};return Z||ye.forEach(c=>c(l)),o?null:i}async function G({type:t,url:e,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:i=0,nav_token:l={},accept:c=ne,block:d=ne,event:u}){var B;const v=V;V=l;const f=await Rt(e,!1),h=t==="enter"?Ht(m,f,e,t):Ae({url:e,type:t,delta:n==null?void 0:n.delta,intent:f,scroll:n==null?void 0:n.scroll,event:u});if(!h){d(),V===l&&(V=v);return}const _=k,g=L;c(),Z=!0,vt&&h.navigation.type!=="enter"&&C.navigating.set(J.current=h.navigation);let p=f&&await Ue(f);if(!p){if(St(e,U,E.hash))return await Q(e,s);p=await Te(e,{id:null},await tt(new Vt(404,"Not Found",`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404,s)}if(e=(f==null?void 0:f.url)||e,V!==l)return h.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(i<20){await G({type:t,url:new URL(p.location,e),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o,redirect_count:i+1,nav_token:l}),h.fulfil(void 0);return}p=await zt({status:500,error:await tt(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}})}else p.props.page.status>=400&&await C.updated.check()&&(await ve(),await Q(e,s));if(sn(),Mt(_),Se(g),p.props.page.url.pathname!==e.pathname&&(e.pathname=p.props.page.url.pathname),o=n?n.state:o,!n){const S=s?0:1,dt={[F]:k+=S,[H]:L+=S,[pe]:o};(s?history.replaceState:history.pushState).call(history,dt,"",e),s||rn(k,L)}const b=f&&(y==null?void 0:y.id)===f.id?y.fork:null;y=null,p.props.page.state=o;let x;if(vt){const S=(await Promise.all(Array.from(on,K=>K(h.navigation)))).filter(K=>typeof K=="function");if(S.length>0){let K=function(){S.forEach(xt=>{z.delete(xt)})};S.push(K),S.forEach(xt=>{z.add(xt)})}m=p.state,p.props.page&&(p.props.page.url=e);const dt=b&&await b;dt?x=dt.commit():(Ee.$set(p.props),nn(p.props.page),x=(B=Oe)==null?void 0:B()),ke=!0}else await Le(p,Ot,!1);const{activeElement:$}=document;await x,await pt(),await pt();let N=null;if(ae){const S=n?n.scroll:a?q():null;S?scrollTo(S.x,S.y):(N=e.hash&&document.getElementById(Ie(e)))?N.scrollIntoView():scrollTo(0,0)}const ut=document.activeElement!==$&&document.activeElement!==document.body;!r&&!ut&&bn(e,!N),ae=!0,p.props.page&&Object.assign(R,p.props.page),Z=!1,t==="popstate"&&Re(L),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=q()),z.forEach(S=>S(h.navigation)),C.navigating.set(J.current=null)}async function Te(t,e,n,r,a){return t.origin===Et&&t.pathname===location.pathname&&!be?await zt({status:r,error:n,url:t,route:e}):await Q(t,a)}function mn(){let t,e={element:void 0,href:void 0},n;O.addEventListener("mousemove",i=>{const l=i.target;clearTimeout(t),t=setTimeout(()=>{s(l,D.hover)},20)});function r(i){i.defaultPrevented||s(i.composedPath()[0],D.tap)}O.addEventListener("mousedown",r),O.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(i=>{for(const l of i)l.isIntersecting&&(Tt(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function s(i,l){const c=me(i,O),d=c===e.element&&(c==null?void 0:c.href)===e.href&&l>=n;if(!c||d)return;const{url:u,external:v,download:f}=It(c,U,E.hash);if(v||f)return;const h=gt(c),_=u&&kt(m.url)===kt(u);if(!(h.reload||_))if(l<=h.preload_data){e={element:c,href:c.href},n=D.tap;const g=await Rt(u,!1);if(!g)return;ln(g)}else l<=h.preload_code&&(e={element:c,href:c.href},n=l,Tt(u))}function o(){a.disconnect();for(const i of O.querySelectorAll("a")){const{url:l,external:c,download:d}=It(i,U,E.hash);if(c||d)continue;const u=gt(i);u.reload||(u.preload_code===D.viewport&&a.observe(i),u.preload_code===D.eager&&Tt(l))}}z.add(o),o()}function tt(t,e){if(t instanceof Nt)return t.body;const n=Kt(t),r=tn(t);return E.hooks.handleError({error:t,event:e,status:n,message:r})??{message:r}}function Pn(t,e={}){return t=new URL(Bt(t)),t.origin!==Et?Promise.reject(new Error("goto: invalid URL")):xe(t,e,0)}function _n(t){if(typeof t=="function")_t.push(t);else{const{href:e}=new URL(t,location.href);_t.push(n=>n.href===e)}}function wn(){var e;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(oe(),!Z){const a=Ht(m,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};ye.forEach(o=>o(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&oe()}),(e=navigator.connection)!=null&&e.saveData||mn(),O.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=me(n.composedPath()[0],O);if(!r)return;const{url:a,external:s,target:o,download:i}=It(r,U,E.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const l=gt(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||i)return;const[d,u]=(E.hash?a.hash.replace(/^#/,""):a.href).split("#"),v=d===Lt(location);if(s||l.reload&&(!v||!u)){Ae({url:a,type:"link",event:n})?Z=!0:n.preventDefault();return}if(u!==void 0&&v){const[,f]=m.url.href.split("#");if(f===u){if(n.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=r.ownerDocument.getElementById(decodeURIComponent(u));h&&(h.scrollIntoView(),h.focus())}return}if(W=!0,Mt(k),t(a),!l.replace_state)return;W=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await G({type:"link",url:a,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??a.href===location.href,event:n})}),O.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(St(i,U,!1))return;const l=n.target,c=gt(l);if(c.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(l,a);i.search=new URLSearchParams(d).toString(),G({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Ct){if((r=n.state)!=null&&r[F]){const a=n.state[F];if(V={},a===k)return;const s=j[a],o=n.state[pe]??{},i=new URL(n.state[Je]??location.href),l=n.state[H],c=m.url?Lt(location)===Lt(m.url):!1;if(l===L&&(ke||c)){o!==R.state&&(R.state=o),t(i),j[k]=q(),s&&scrollTo(s.x,s.y),k=a;return}const u=a-k;await G({type:"popstate",url:i,popped:{state:o,scroll:s,delta:u},accept:()=>{k=a,L=l},block:()=>{history.go(-u)},nav_token:V,event:n})}else if(!W){const a=new URL(location.href);t(a),E.hash&&location.reload()}}}),addEventListener("hashchange",()=>{W&&(W=!1,history.replaceState({...history.state,[F]:++k,[H]:L},"",location.href))});for(const n of document.querySelectorAll("link"))an.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&C.navigating.set(J.current=null)});function t(n){m.url=R.url=n,C.page.set(Jt(R)),C.page.notify()}}async function vn(t,{status:e=200,error:n,node_ids:r,params:a,route:s,server_route:o,data:i,form:l}){be=!0;const c=new URL(location.href);let d;({params:a={},route:s={id:null}}=await Rt(c,!1)||{}),d=Ft.find(({id:f})=>f===s.id);let u,v=!0;try{const f=r.map(async(_,g)=>{const p=i[g];return p!=null&&p.uses&&(p.uses=yn(p.uses)),Wt({loader:E.nodes[_],url:c,params:a,route:s,parent:async()=>{const b={};for(let x=0;x{const i=history.state;Ct=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(i,"",t),e&&scrollTo(s,o),Ct=!1})}else{const s=document.body,o=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),o!==null?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let o=0;o{if(a.rangeCount===s.length){for(let o=0;o{s=u,o=v});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url,scroll:q()},to:n&&{params:(e==null?void 0:e.params)??null,route:{id:((d=e==null?void 0:e.route)==null?void 0:d.id)??null},url:n,scroll:a},willUnload:!e,type:r,complete:i},fulfil:s,reject:o}}function Jt(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function kn(t){const e=new URL(t);return e.hash=decodeURIComponent(t.hash),e}function Ie(t){let e;if(E.hash){const[,,n]=t.hash.split("#",3);e=n??""}else e=t.hash.slice(1);return decodeURIComponent(e)}export{In as a,U as b,Pn as g,Ln as l,R as p,C as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/C9fAJV5Y.js.br b/apps/dashboard/build/_app/immutable/chunks/C9fAJV5Y.js.br new file mode 100644 index 0000000..bd0acad Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C9fAJV5Y.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C9fAJV5Y.js.gz b/apps/dashboard/build/_app/immutable/chunks/C9fAJV5Y.js.gz new file mode 100644 index 0000000..af1e697 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C9fAJV5Y.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js b/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js new file mode 100644 index 0000000..a7335f7 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js @@ -0,0 +1 @@ +import{k as t,l as S,m as h,q,S as T}from"./C9Z4nxhR.js";function k(r,i){return r===i||(r==null?void 0:r[T])===i}function A(r={},i,a,c){return t(()=>{var f,s;return S(()=>{f=s,s=[],h(()=>{r!==a(...s)&&(i(r,...s),f&&k(a(...f),r)&&i(null,...f))})}),()=>{q(()=>{s&&k(a(...s),r)&&i(null,...s)})}}),r}export{A as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.br b/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.br new file mode 100644 index 0000000..9432dd8 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.br @@ -0,0 +1 @@ +7 ,o*̢踯hS+|hvyOߙ8;$z3 q lq*;m(V{K5TLyQ=NWe\)h Ndb (`/֬PM ɤXv$xNkdGsKo$Drqw`; \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.gz b/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.gz new file mode 100644 index 0000000..7d20542 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Cc4zGfaP.js b/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js similarity index 65% rename from apps/dashboard/build/_app/immutable/chunks/Cc4zGfaP.js rename to apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js index 33a9e04..1d1d6f4 100644 --- a/apps/dashboard/build/_app/immutable/chunks/Cc4zGfaP.js +++ b/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js @@ -1 +1 @@ -var D=Object.defineProperty;var g=a=>{throw TypeError(a)};var F=(a,e,s)=>e in a?D(a,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[e]=s;var M=(a,e,s)=>F(a,typeof e!="symbol"?e+"":e,s),w=(a,e,s)=>e.has(a)||g("Cannot "+s);var t=(a,e,s)=>(w(a,e,"read from private field"),s?s.call(a):e.get(a)),l=(a,e,s)=>e.has(a)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,s),y=(a,e,s,i)=>(w(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);import{T as x,a0 as C,a1 as k,a2 as S,a3 as A,a4 as B,M as T,a5 as j,a6 as q,a7 as z}from"./DEYVqDYQ.js";var r,n,h,u,p,_,v;class H{constructor(e,s=!0){M(this,"anchor");l(this,r,new Map);l(this,n,new Map);l(this,h,new Map);l(this,u,new Set);l(this,p,!0);l(this,_,()=>{var e=x;if(t(this,r).has(e)){var s=t(this,r).get(e),i=t(this,n).get(s);if(i)C(i),t(this,u).delete(s);else{var c=t(this,h).get(s);c&&(t(this,n).set(s,c.effect),t(this,h).delete(s),c.fragment.lastChild.remove(),this.anchor.before(c.fragment),i=c.effect)}for(const[f,o]of t(this,r)){if(t(this,r).delete(f),f===e)break;const d=t(this,h).get(o);d&&(k(d.effect),t(this,h).delete(o))}for(const[f,o]of t(this,n)){if(f===s||t(this,u).has(f))continue;const d=()=>{if(Array.from(t(this,r).values()).includes(f)){var b=document.createDocumentFragment();q(o,b),b.append(A()),t(this,h).set(f,{effect:o,fragment:b})}else k(o);t(this,u).delete(f),t(this,n).delete(f)};t(this,p)||!i?(t(this,u).add(f),S(o,d,!1)):d()}}});l(this,v,e=>{t(this,r).delete(e);const s=Array.from(t(this,r).values());for(const[i,c]of t(this,h))s.includes(i)||(k(c.effect),t(this,h).delete(i))});this.anchor=e,y(this,p,s)}ensure(e,s){var i=x,c=z();if(s&&!t(this,n).has(e)&&!t(this,h).has(e))if(c){var f=document.createDocumentFragment(),o=A();f.append(o),t(this,h).set(e,{effect:B(()=>s(o)),fragment:f})}else t(this,n).set(e,B(()=>s(this.anchor)));if(t(this,r).set(i,e),c){for(const[d,m]of t(this,n))d===e?i.unskip_effect(m):i.skip_effect(m);for(const[d,m]of t(this,h))d===e?i.unskip_effect(m.effect):i.skip_effect(m.effect);i.oncommit(t(this,_)),i.ondiscard(t(this,v))}else T&&(this.anchor=j),t(this,_).call(this)}}r=new WeakMap,n=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,v=new WeakMap;export{H as B}; +var D=Object.defineProperty;var g=a=>{throw TypeError(a)};var F=(a,e,s)=>e in a?D(a,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[e]=s;var w=(a,e,s)=>F(a,typeof e!="symbol"?e+"":e,s),y=(a,e,s)=>e.has(a)||g("Cannot "+s);var t=(a,e,s)=>(y(a,e,"read from private field"),s?s.call(a):e.get(a)),l=(a,e,s)=>e.has(a)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,s),M=(a,e,s,i)=>(y(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);import{K as x,a7 as C,a8 as k,a9 as J,aa as A,ab as B,J as K,ac as S,ad as j,ae as q}from"./C9Z4nxhR.js";var r,n,h,u,p,_,v;class G{constructor(e,s=!0){w(this,"anchor");l(this,r,new Map);l(this,n,new Map);l(this,h,new Map);l(this,u,new Set);l(this,p,!0);l(this,_,()=>{var e=x;if(t(this,r).has(e)){var s=t(this,r).get(e),i=t(this,n).get(s);if(i)C(i),t(this,u).delete(s);else{var c=t(this,h).get(s);c&&(t(this,n).set(s,c.effect),t(this,h).delete(s),c.fragment.lastChild.remove(),this.anchor.before(c.fragment),i=c.effect)}for(const[f,o]of t(this,r)){if(t(this,r).delete(f),f===e)break;const d=t(this,h).get(o);d&&(k(d.effect),t(this,h).delete(o))}for(const[f,o]of t(this,n)){if(f===s||t(this,u).has(f))continue;const d=()=>{if(Array.from(t(this,r).values()).includes(f)){var b=document.createDocumentFragment();j(o,b),b.append(A()),t(this,h).set(f,{effect:o,fragment:b})}else k(o);t(this,u).delete(f),t(this,n).delete(f)};t(this,p)||!i?(t(this,u).add(f),J(o,d,!1)):d()}}});l(this,v,e=>{t(this,r).delete(e);const s=Array.from(t(this,r).values());for(const[i,c]of t(this,h))s.includes(i)||(k(c.effect),t(this,h).delete(i))});this.anchor=e,M(this,p,s)}ensure(e,s){var i=x,c=q();if(s&&!t(this,n).has(e)&&!t(this,h).has(e))if(c){var f=document.createDocumentFragment(),o=A();f.append(o),t(this,h).set(e,{effect:B(()=>s(o)),fragment:f})}else t(this,n).set(e,B(()=>s(this.anchor)));if(t(this,r).set(i,e),c){for(const[d,m]of t(this,n))d===e?i.unskip_effect(m):i.skip_effect(m);for(const[d,m]of t(this,h))d===e?i.unskip_effect(m.effect):i.skip_effect(m.effect);i.oncommit(t(this,_)),i.ondiscard(t(this,v))}else K&&(this.anchor=S),t(this,_).call(this)}}r=new WeakMap,n=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,v=new WeakMap;export{G as B}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.br b/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.br new file mode 100644 index 0000000..77f7765 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.gz b/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.gz new file mode 100644 index 0000000..58fd1c4 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js b/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js new file mode 100644 index 0000000..631fc9b --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js @@ -0,0 +1 @@ +const e={fact:"#00A8FF",concept:"#9D00FF",event:"#FFB800",person:"#00FFD1",place:"#00D4FF",note:"#8B95A5",pattern:"#FF3CAC",decision:"#FF4757"},F={MemoryCreated:"#00FFD1",MemoryUpdated:"#00A8FF",MemoryDeleted:"#FF4757",MemoryPromoted:"#00FF88",MemoryDemoted:"#FF6B35",SearchPerformed:"#818CF8",DreamStarted:"#9D00FF",DreamProgress:"#B44AFF",DreamCompleted:"#C084FC",ConsolidationStarted:"#FFB800",ConsolidationCompleted:"#FF9500",RetentionDecayed:"#FF4757",ConnectionDiscovered:"#00D4FF",ActivationSpread:"#14E8C6",ImportanceScored:"#FF3CAC",Heartbeat:"#8B95A5"};export{F as E,e as N}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js.br b/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js.br new file mode 100644 index 0000000..1fc079b Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js.gz b/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js.gz new file mode 100644 index 0000000..6bc8ce3 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Cc4zGfaP.js.br b/apps/dashboard/build/_app/immutable/chunks/Cc4zGfaP.js.br deleted file mode 100644 index dc57822..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Cc4zGfaP.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Cc4zGfaP.js.gz b/apps/dashboard/build/_app/immutable/chunks/Cc4zGfaP.js.gz deleted file mode 100644 index 7eff4dc..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Cc4zGfaP.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CiJhRXcr.js b/apps/dashboard/build/_app/immutable/chunks/CiJhRXcr.js deleted file mode 100644 index 7242115..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/CiJhRXcr.js +++ /dev/null @@ -1 +0,0 @@ -import{a3 as F,b as fe,an as ne,M as b,_ as L,ao as ie,V as le,g as K,W as ue,Y as se,Z as P,$ as q,a5 as z,ap as oe,aq as te,ar as Q,T as ve,as as T,a4 as V,at as de,a7 as ce,z as pe,O as _e,au as y,av as he,aw as ge,J as Ee,ax as j,ay as me,a0 as re,a2 as ae,az as B,F as Te,aA as Ae,aB as Ce,aC as we,a1 as Se,aD as Ie}from"./DEYVqDYQ.js";function be(e,r){return r}function Ne(e,r,l){for(var t=[],g=r.length,s,u=r.length,c=0;c{if(s){if(s.pending.delete(E),s.done.add(E),s.pending.size===0){var o=e.outrogroups;Y(y(s.done)),o.delete(s),o.size===0&&(e.outrogroups=null)}}else u-=1},!1)}if(u===0){var i=t.length===0&&l!==null;if(i){var v=l,a=v.parentNode;we(a),a.append(v),e.items.clear()}Y(r,!i)}else s={pending:new Set(r),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(s)}function Y(e,r=!0){for(var l=0;l{var f=l();return _e(f)?f:f==null?[]:y(f)}),o,d=!0;function C(){n.fallback=a,xe(n,o,u,r,t),a!==null&&(o.length===0?(a.f&T)===0?re(a):(a.f^=T,H(a,null,u)):ae(a,()=>{a=null}))}var I=fe(()=>{o=K(E);var f=o.length;let N=!1;if(b){var x=ue(u)===se;x!==(f===0)&&(u=P(),L(u),q(!1),N=!0)}for(var _=new Set,w=ve,M=ce(),p=0;ps(u)):(a=V(()=>s(ee??(ee=F()))),a.f|=T)),f>_.size&&de(),b&&f>0&&L(P()),!d)if(M){for(const[O,k]of c)_.has(O)||w.skip_effect(k.e);w.oncommit(C),w.ondiscard(()=>{})}else C();N&&q(!0),K(E)}),n={effect:I,items:c,outrogroups:null,fallback:a};d=!1,b&&(u=z)}function D(e){for(;e!==null&&(e.f&Ae)===0;)e=e.next;return e}function xe(e,r,l,t,g){var h,O,k,J,U,W,X,Z,$;var s=(t&Ce)!==0,u=r.length,c=e.items,i=D(e.effect.first),v,a=null,E,o=[],d=[],C,I,n,f;if(s)for(f=0;f0){var R=(t&ne)!==0&&u===0?l:null;if(s){for(f=0;f{var m,G;if(E!==void 0)for(n of E)(G=(m=n.nodes)==null?void 0:m.a)==null||G.apply()})}function Me(e,r,l,t,g,s,u,c){var i=(u&he)!==0?(u&ge)===0?Ee(l,!1,!1):j(l):null,v=(u&me)!==0?j(g):null;return{v:i,i:v,e:V(()=>(s(r,i??l,v??g,c),()=>{e.delete(t)}))}}function H(e,r,l){if(e.nodes)for(var t=e.nodes.start,g=e.nodes.end,s=r&&(r.f&T)===0?r.nodes.start:l;t!==null;){var u=Ie(t);if(s.before(t),t===g)return;t=u}}function A(e,r,l){r===null?e.effect.first=l:r.next=l,l===null?e.effect.last=r:l.prev=r}function He(e,r,l){var t=e==null?"":""+e;return t===""?null:t}function Oe(e,r){return e==null?null:String(e)}export{Oe as a,De as e,be as i,He as t}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CiJhRXcr.js.br b/apps/dashboard/build/_app/immutable/chunks/CiJhRXcr.js.br deleted file mode 100644 index 89ee311..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CiJhRXcr.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CiJhRXcr.js.gz b/apps/dashboard/build/_app/immutable/chunks/CiJhRXcr.js.gz deleted file mode 100644 index 498d68a..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CiJhRXcr.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js b/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js new file mode 100644 index 0000000..a873d0d --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js @@ -0,0 +1 @@ +import{ah as a,af as t,y as u,m as o}from"./C9Z4nxhR.js";function c(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function l(e){t===null&&c(),u&&t.l!==null?f(t).m.push(e):a(()=>{const n=o(e);if(typeof n=="function")return n})}function s(e){t===null&&c(),l(()=>()=>o(e))}function f(e){var n=e.l;return n.u??(n.u={a:[],b:[],m:[]})}export{s as a,l as o}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.br b/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.br new file mode 100644 index 0000000..d45b208 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.gz b/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.gz new file mode 100644 index 0000000..f1fbfcc Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/zt9hmg4X.js b/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js similarity index 76% rename from apps/dashboard/build/_app/immutable/chunks/zt9hmg4X.js rename to apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js index f486fd7..532ec36 100644 --- a/apps/dashboard/build/_app/immutable/chunks/zt9hmg4X.js +++ b/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js @@ -1 +1 @@ -import{t as l}from"./CiJhRXcr.js";import{M as e}from"./DEYVqDYQ.js";function u(s,c,r,f,p,i){var a=s.__className;if(e||a!==r||a===void 0){var t=l(r);(!e||t!==s.getAttribute("class"))&&(t==null?s.removeAttribute("class"):s.className=t),s.__className=r}return i}export{u as s}; +import{t as l}from"./kH-DTQyy.js";import{J as e}from"./C9Z4nxhR.js";function u(s,c,r,f,p,i){var a=s.__className;if(e||a!==r||a===void 0){var t=l(r);(!e||t!==s.getAttribute("class"))&&(t==null?s.removeAttribute("class"):s.className=t),s.__className=r}return i}export{u as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.br b/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.br new file mode 100644 index 0000000..3f77d57 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.gz b/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.gz new file mode 100644 index 0000000..6ae10db Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CpubbTHs.js b/apps/dashboard/build/_app/immutable/chunks/CpubbTHs.js deleted file mode 100644 index ff6f194..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/CpubbTHs.js +++ /dev/null @@ -1 +0,0 @@ -import{b as T,M as o,V as b,E as h,W as p,X as A,Y as E,Z as R,_ as g,$ as l}from"./DEYVqDYQ.js";import{B as v}from"./Cc4zGfaP.js";function S(t,_,u=!1){o&&b();var n=new v(t),c=u?h:0;function i(a,r){if(o){const e=p(t);var s;if(e===A?s=0:e===E?s=!1:s=parseInt(e.substring(1)),a!==s){var f=R();g(f),n.anchor=f,l(!1),n.ensure(a,r),l(!0);return}}n.ensure(a,r)}T(()=>{var a=!1;_((r,s=0)=>{a=!0,i(s,r)}),a||i(!1,null)},c)}export{S as i}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CpubbTHs.js.br b/apps/dashboard/build/_app/immutable/chunks/CpubbTHs.js.br deleted file mode 100644 index 36b0d68..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CpubbTHs.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CpubbTHs.js.gz b/apps/dashboard/build/_app/immutable/chunks/CpubbTHs.js.gz deleted file mode 100644 index aec390d..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CpubbTHs.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js b/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js new file mode 100644 index 0000000..a2e2d55 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js @@ -0,0 +1 @@ +import{b as p,E as t}from"./C9Z4nxhR.js";import{B as c}from"./CY4crMrT.js";function E(r,s,...a){var e=new c(r);p(()=>{const n=s()??null;e.ensure(n,n&&(o=>n(o,...a)))},t)}export{E as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.br b/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.br new file mode 100644 index 0000000..c92f939 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.gz b/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.gz new file mode 100644 index 0000000..6918546 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D5-kFxsM.js b/apps/dashboard/build/_app/immutable/chunks/D5-kFxsM.js deleted file mode 100644 index 200d364..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/D5-kFxsM.js +++ /dev/null @@ -1 +0,0 @@ -import{aE as h,a3 as d,ao as l,aF as p,n as _,aG as E,aH as g,M as u,a5 as s,aI as M,V as y,aJ as N,_ as x,aK as A}from"./DEYVqDYQ.js";var f;const i=((f=globalThis==null?void 0:globalThis.window)==null?void 0:f.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function b(t){return(i==null?void 0:i.createHTML(t))??t}function L(t){var r=h("template");return r.innerHTML=b(t.replaceAll("","")),r.content}function a(t,r){var e=_;e.nodes===null&&(e.nodes={start:t,end:r,a:null,t:null})}function H(t,r){var e=(r&E)!==0,c=(r&g)!==0,n,m=!t.startsWith("");return()=>{if(u)return a(s,null),s;n===void 0&&(n=L(m?t:""+t),e||(n=l(n)));var o=c||p?document.importNode(n,!0):n.cloneNode(!0);if(e){var v=l(o),T=o.lastChild;a(v,T)}else a(o,o);return o}}function O(t=""){if(!u){var r=d(t+"");return a(r,r),r}var e=s;return e.nodeType!==N?(e.before(e=d()),x(e)):A(e),a(e,e),e}function P(){if(u)return a(s,null),s;var t=document.createDocumentFragment(),r=document.createComment(""),e=d();return t.append(r,e),a(r,e),t}function R(t,r){if(u){var e=_;((e.f&M)===0||e.nodes.end===null)&&(e.nodes.end=s),y();return}t!==null&&t.before(r)}export{R as a,a as b,P as c,H as f,O as t}; diff --git a/apps/dashboard/build/_app/immutable/chunks/D5-kFxsM.js.br b/apps/dashboard/build/_app/immutable/chunks/D5-kFxsM.js.br deleted file mode 100644 index 2db2ccb..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/D5-kFxsM.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D5-kFxsM.js.gz b/apps/dashboard/build/_app/immutable/chunks/D5-kFxsM.js.gz deleted file mode 100644 index 0eb425c..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/D5-kFxsM.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DEYVqDYQ.js.br b/apps/dashboard/build/_app/immutable/chunks/DEYVqDYQ.js.br deleted file mode 100644 index 9fc9cc8..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DEYVqDYQ.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DNwVrE-V.js.br b/apps/dashboard/build/_app/immutable/chunks/DNwVrE-V.js.br deleted file mode 100644 index 11669a1..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DNwVrE-V.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DNwVrE-V.js.gz b/apps/dashboard/build/_app/immutable/chunks/DNwVrE-V.js.gz deleted file mode 100644 index d36a5cf..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DNwVrE-V.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js b/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js new file mode 100644 index 0000000..d057f57 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js @@ -0,0 +1,2 @@ +var ke=Object.defineProperty;var ce=t=>{throw TypeError(t)};var Ie=(t,e,r)=>e in t?ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var $=(t,e,r)=>Ie(t,typeof e!="symbol"?e+"":e,r),re=(t,e,r)=>e.has(t)||ce("Cannot "+r);var s=(t,e,r)=>(re(t,e,"read from private field"),r?r.call(t):e.get(t)),l=(t,e,r)=>e.has(t)?ce("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),a=(t,e,r,n)=>(re(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),p=(t,e,r)=>(re(t,e,"access private method"),r);import{aL as Me,g as Ee,l as Ce,m as Pe,aM as ue,q as U,ax as Te,ac as k,J as I,w as q,aN as _e,b as Ve,a0 as qe,a3 as xe,aO as pe,ab as F,aa as we,aP as se,a9 as ie,ad as Be,aQ as ge,aR as He,aS as ve,aT as Le,aU as We,aV as X,aW as Z,aX as ye,aY as $e,aZ as Re,af as Se,ar as je,a8 as ae,a5 as K,G as ze,a4 as Je,a_ as j,E as Ue,a$ as Ge,b0 as Qe,b1 as Xe,Y as Ze,b2 as ne,ao as Ke,ap as De,a2 as et,aD as tt,b3 as fe,a6 as z,b4 as rt,aC as st,b5 as it,au as at,p as nt,aq as ft,b6 as ht,a as ot}from"./C9Z4nxhR.js";import{b as lt}from"./DPfxVJHQ.js";function dt(t){let e=0,r=Te(0),n;return()=>{Me()&&(Ee(r),Ce(()=>(e===0&&(n=Pe(()=>t(()=>ue(r)))),e+=1,()=>{U(()=>{e-=1,e===0&&(n==null||n(),n=void 0,ue(r))})})))}}var ct=Ue|Ge;function ut(t,e,r,n){new _t(t,e,r,n)}var m,W,w,C,g,R,E,T,S,P,A,x,B,H,D,ee,h,Ne,Ae,Oe,he,G,Q,oe;class _t{constructor(e,r,n,c){l(this,h);$(this,"parent");$(this,"is_pending",!1);$(this,"transform_error");l(this,m);l(this,W,I?k:null);l(this,w);l(this,C);l(this,g);l(this,R,null);l(this,E,null);l(this,T,null);l(this,S,null);l(this,P,0);l(this,A,0);l(this,x,!1);l(this,B,new Set);l(this,H,new Set);l(this,D,null);l(this,ee,dt(()=>(a(this,D,Te(s(this,P))),()=>{a(this,D,null)})));var i;a(this,m,e),a(this,w,r),a(this,C,f=>{var u=q;u.b=this,u.f|=_e,n(f)}),this.parent=q.b,this.transform_error=c??((i=this.parent)==null?void 0:i.transform_error)??(f=>f),a(this,g,Ve(()=>{if(I){const f=s(this,W);qe();const u=f.data===xe;if(f.data.startsWith(pe)){const d=JSON.parse(f.data.slice(pe.length));p(this,h,Ae).call(this,d)}else u?p(this,h,Oe).call(this):p(this,h,Ne).call(this)}else p(this,h,he).call(this)},ct)),I&&a(this,m,k)}defer_effect(e){We(e,s(this,B),s(this,H))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!s(this,w).pending}update_pending_count(e){p(this,h,oe).call(this,e),a(this,P,s(this,P)+e),!(!s(this,D)||s(this,x))&&(a(this,x,!0),U(()=>{a(this,x,!1),s(this,D)&&je(s(this,D),s(this,P))}))}get_effect_pending(){return s(this,ee).call(this),Ee(s(this,D))}error(e){var r=s(this,w).onerror;let n=s(this,w).failed;if(!r&&!n)throw e;s(this,R)&&(ae(s(this,R)),a(this,R,null)),s(this,E)&&(ae(s(this,E)),a(this,E,null)),s(this,T)&&(ae(s(this,T)),a(this,T,null)),I&&(K(s(this,W)),ze(),K(Je()));var c=!1,i=!1;const f=()=>{if(c){Xe();return}c=!0,i&&Qe(),s(this,T)!==null&&ie(s(this,T),()=>{a(this,T,null)}),p(this,h,Q).call(this,()=>{se.ensure(),p(this,h,he).call(this)})},u=o=>{try{i=!0,r==null||r(o,f),i=!1}catch(d){j(d,s(this,g)&&s(this,g).parent)}n&&a(this,T,p(this,h,Q).call(this,()=>{se.ensure();try{return F(()=>{var d=q;d.b=this,d.f|=_e,n(s(this,m),()=>o,()=>f)})}catch(d){return j(d,s(this,g).parent),null}}))};U(()=>{var o;try{o=this.transform_error(e)}catch(d){j(d,s(this,g)&&s(this,g).parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(u,d=>j(d,s(this,g)&&s(this,g).parent)):u(o)})}}m=new WeakMap,W=new WeakMap,w=new WeakMap,C=new WeakMap,g=new WeakMap,R=new WeakMap,E=new WeakMap,T=new WeakMap,S=new WeakMap,P=new WeakMap,A=new WeakMap,x=new WeakMap,B=new WeakMap,H=new WeakMap,D=new WeakMap,ee=new WeakMap,h=new WeakSet,Ne=function(){try{a(this,R,F(()=>s(this,C).call(this,s(this,m))))}catch(e){this.error(e)}},Ae=function(e){const r=s(this,w).failed;r&&a(this,T,F(()=>{r(s(this,m),()=>e,()=>()=>{})}))},Oe=function(){const e=s(this,w).pending;e&&(this.is_pending=!0,a(this,E,F(()=>e(s(this,m)))),U(()=>{var r=a(this,S,document.createDocumentFragment()),n=we();r.append(n),a(this,R,p(this,h,Q).call(this,()=>(se.ensure(),F(()=>s(this,C).call(this,n))))),s(this,A)===0&&(s(this,m).before(r),a(this,S,null),ie(s(this,E),()=>{a(this,E,null)}),p(this,h,G).call(this))}))},he=function(){try{if(this.is_pending=this.has_pending_snippet(),a(this,A,0),a(this,P,0),a(this,R,F(()=>{s(this,C).call(this,s(this,m))})),s(this,A)>0){var e=a(this,S,document.createDocumentFragment());Be(s(this,R),e);const r=s(this,w).pending;a(this,E,F(()=>r(s(this,m))))}else p(this,h,G).call(this)}catch(r){this.error(r)}},G=function(){this.is_pending=!1;for(const e of s(this,B))ge(e,He),ve(e);for(const e of s(this,H))ge(e,Le),ve(e);s(this,B).clear(),s(this,H).clear()},Q=function(e){var r=q,n=Re,c=Se;X(s(this,g)),Z(s(this,g)),ye(s(this,g).ctx);try{return e()}catch(i){return $e(i),null}finally{X(r),Z(n),ye(c)}},oe=function(e){var r;if(!this.has_pending_snippet()){this.parent&&p(r=this.parent,h,oe).call(r,e);return}a(this,A,s(this,A)+e),s(this,A)===0&&(p(this,h,G).call(this),s(this,E)&&ie(s(this,E),()=>{a(this,E,null)}),s(this,S)&&(s(this,m).before(s(this,S)),a(this,S,null)))};const pt=["touchstart","touchmove"];function gt(t){return pt.includes(t)}const M=Symbol("events"),Ye=new Set,le=new Set;function Et(t,e,r){(e[M]??(e[M]={}))[t]=r}function Tt(t){for(var e=0;e{throw Y});throw N}}finally{t[M]=e,delete t.currentTarget,Z(V),X(L)}}}function wt(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=r,t.nodeValue=r+"")}function vt(t,e){return Fe(t,e)}function Rt(t,e){ne(),e.intro=e.intro??!1;const r=e.target,n=I,c=k;try{for(var i=Ke(r);i&&(i.nodeType!==De||i.data!==et);)i=tt(i);if(!i)throw fe;z(!0),K(i);const f=Fe(t,{...e,anchor:i});return z(!1),f}catch(f){if(f instanceof Error&&f.message.split(` +`).some(u=>u.startsWith("https://svelte.dev/e/")))throw f;return f!==fe&&console.warn("Failed to hydrate: ",f),e.recover===!1&&rt(),ne(),st(r),z(!1),vt(t,e)}finally{z(n),K(c)}}const J=new Map;function Fe(t,{target:e,anchor:r,props:n={},events:c,context:i,intro:f=!0,transformError:u}){ne();var o=void 0,d=it(()=>{var V=r??e.appendChild(we());ut(V,{pending:()=>{}},v=>{nt({});var _=Se;if(i&&(_.c=i),c&&(n.$$events=c),I&<(v,null),o=t(v,n)||{},I&&(q.nodes.end=k,k===null||k.nodeType!==De||k.data!==ft))throw ht(),fe;ot()},u);var L=new Set,N=v=>{for(var _=0;_{var O;for(var v of L)for(const b of[e,document]){var _=J.get(b),y=_.get(v);--y==0?(b.removeEventListener(v,me),_.delete(v),_.size===0&&J.delete(b)):_.set(v,y)}le.delete(N),V!==r&&((O=V.parentNode)==null||O.removeChild(V))}});return de.set(o,d),o}let de=new WeakMap;function St(t,e){const r=de.get(t);return r?(de.delete(t),r(e)):Promise.resolve()}export{Et as a,Tt as d,Rt as h,vt as m,wt as s,St as u}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.br b/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.br new file mode 100644 index 0000000..b9527e5 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.gz b/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.gz new file mode 100644 index 0000000..972b700 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js b/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js new file mode 100644 index 0000000..a27f404 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js @@ -0,0 +1 @@ +import{aE as h,aa as d,ao as l,aF as p,w as _,aG as E,aH as g,J as u,ac as s,aI as y,a0 as M,aJ as N,a5 as x,aK as A}from"./C9Z4nxhR.js";var f;const i=((f=globalThis==null?void 0:globalThis.window)==null?void 0:f.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function b(t){return(i==null?void 0:i.createHTML(t))??t}function w(t){var r=h("template");return r.innerHTML=b(t.replaceAll("","")),r.content}function a(t,r){var e=_;e.nodes===null&&(e.nodes={start:t,end:r,a:null,t:null})}function H(t,r){var e=(r&E)!==0,c=(r&g)!==0,n,m=!t.startsWith("");return()=>{if(u)return a(s,null),s;n===void 0&&(n=w(m?t:""+t),e||(n=l(n)));var o=c||p?document.importNode(n,!0):n.cloneNode(!0);if(e){var v=l(o),T=o.lastChild;a(v,T)}else a(o,o);return o}}function O(t=""){if(!u){var r=d(t+"");return a(r,r),r}var e=s;return e.nodeType!==N?(e.before(e=d()),x(e)):A(e),a(e,e),e}function P(){if(u)return a(s,null),s;var t=document.createDocumentFragment(),r=document.createComment(""),e=d();return t.append(r,e),a(r,e),t}function R(t,r){if(u){var e=_;((e.f&y)===0||e.nodes.end===null)&&(e.nodes.end=s),M();return}t!==null&&t.before(r)}export{R as a,a as b,P as c,H as f,O as t}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.br b/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.br new file mode 100644 index 0000000..647c6e3 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.gz b/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.gz new file mode 100644 index 0000000..3ee52cd Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DUZi1B8N.js.br b/apps/dashboard/build/_app/immutable/chunks/DUZi1B8N.js.br deleted file mode 100644 index d34ed52..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DUZi1B8N.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DUZi1B8N.js.gz b/apps/dashboard/build/_app/immutable/chunks/DUZi1B8N.js.gz deleted file mode 100644 index 13661a3..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DUZi1B8N.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DUZi1B8N.js b/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js similarity index 60% rename from apps/dashboard/build/_app/immutable/chunks/DUZi1B8N.js rename to apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js index 93e1129..103d488 100644 --- a/apps/dashboard/build/_app/immutable/chunks/DUZi1B8N.js +++ b/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js @@ -1 +1 @@ -import{s as c,g as l}from"./Dr_bhyBn.js";import{H as o,I as a,J as b,g as p,h as d,K as g}from"./DEYVqDYQ.js";let s=!1,i=Symbol();function y(e,n,r){const u=r[n]??(r[n]={store:null,source:b(void 0),unsubscribe:a});if(u.store!==e&&!(i in r))if(u.unsubscribe(),u.store=e??null,e==null)u.source.v=void 0,u.unsubscribe=a;else{var t=!0;u.unsubscribe=c(e,f=>{t?u.source.v=f:d(u.source,f)}),t=!1}return e&&i in r?l(e):p(u.source)}function m(){const e={};function n(){o(()=>{for(var r in e)e[r].unsubscribe();g(e,i,{enumerable:!1,value:!0})})}return[e,n]}function I(e){var n=s;try{return s=!1,[e(),s]}finally{s=n}}export{y as a,I as c,m as s}; +import{s as c,g as l}from"./DnKV7_Y9.js";import{V as o,W as a,X as b,g as p,h as d,Y as g}from"./C9Z4nxhR.js";let s=!1,i=Symbol();function y(e,n,r){const u=r[n]??(r[n]={store:null,source:b(void 0),unsubscribe:a});if(u.store!==e&&!(i in r))if(u.unsubscribe(),u.store=e??null,e==null)u.source.v=void 0,u.unsubscribe=a;else{var t=!0;u.unsubscribe=c(e,f=>{t?u.source.v=f:d(u.source,f)}),t=!1}return e&&i in r?l(e):p(u.source)}function m(){const e={};function n(){o(()=>{for(var r in e)e[r].unsubscribe();g(e,i,{enumerable:!1,value:!0})})}return[e,n]}function N(e){var n=s;try{return s=!1,[e(),s]}finally{s=n}}export{y as a,N as c,m as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.br b/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.br new file mode 100644 index 0000000..268d8ef --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.br @@ -0,0 +1,2 @@ +z`Vmwr}%&n9Es3+st׋։ E!M7Uۡe3Րt+xN㯗qw]$H~٬<̨zq(+no09G#ZvSSO WbIcjbIgoBpt lx]!L8P}4!Z.?ZsI@] \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.gz b/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.gz new file mode 100644 index 0000000..7555032 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Dli8az1I.js b/apps/dashboard/build/_app/immutable/chunks/Dli8az1I.js deleted file mode 100644 index d047833..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/Dli8az1I.js +++ /dev/null @@ -1 +0,0 @@ -import{k as L,l as D,P as T,g as P,c as b,h as B,m as Y,n as h,D as x,o as M,q as N,v as U,w as q,x as w,y as z,z as $,A as y,S as C,L as G}from"./DEYVqDYQ.js";import{c as Z}from"./DUZi1B8N.js";function H(r,a,t,s){var o;var f=!U||(t&q)!==0,v=(t&M)!==0,E=(t&y)!==0,n=s,S=!0,g=()=>(S&&(S=!1,n=E?N(s):s),n),u;if(v){var O=C in r||G in r;u=((o=L(r,a))==null?void 0:o.set)??(O&&a in r?e=>r[a]=e:void 0)}var _,I=!1;v?[_,I]=Z(()=>r[a]):_=r[a],_===void 0&&s!==void 0&&(_=g(),u&&(f&&D(),u(_)));var i;if(f?i=()=>{var e=r[a];return e===void 0?g():(S=!0,e)}:i=()=>{var e=r[a];return e!==void 0&&(n=void 0),e===void 0?n:e},f&&(t&T)===0)return i;if(u){var R=r.$$legacy;return(function(e,l){return arguments.length>0?((!f||!l||R||I)&&u(l?i():e),e):i()})}var c=!1,d=((t&w)!==0?z:$)(()=>(c=!1,i()));v&&P(d);var m=h;return(function(e,l){if(arguments.length>0){const A=l?P(d):f&&v?b(e):e;return B(d,A),c=!0,n!==void 0&&(n=A),e}return Y&&c||(m.f&x)!==0?d.v:P(d)})}export{H as p}; diff --git a/apps/dashboard/build/_app/immutable/chunks/Dli8az1I.js.br b/apps/dashboard/build/_app/immutable/chunks/Dli8az1I.js.br deleted file mode 100644 index 068d3d0..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Dli8az1I.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Dli8az1I.js.gz b/apps/dashboard/build/_app/immutable/chunks/Dli8az1I.js.gz deleted file mode 100644 index 88daf0c..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Dli8az1I.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DmEsXEQB.js.br b/apps/dashboard/build/_app/immutable/chunks/DmEsXEQB.js.br deleted file mode 100644 index ddf12f2..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DmEsXEQB.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DmEsXEQB.js.gz b/apps/dashboard/build/_app/immutable/chunks/DmEsXEQB.js.gz deleted file mode 100644 index eb7a331..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DmEsXEQB.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js b/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js new file mode 100644 index 0000000..b9ec889 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js @@ -0,0 +1 @@ +import{W as a,m as w,am as q,ai as x}from"./C9Z4nxhR.js";function _(e,t,n){if(e==null)return t(void 0),n&&n(void 0),a;const r=w(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const f=[];function z(e,t){return{subscribe:A(e,t).subscribe}}function A(e,t=a){let n=null;const r=new Set;function i(u){if(q(e,u)&&(e=u,n)){const o=!f.length;for(const s of r)s[1](),f.push(s,e);if(o){for(let s=0;s{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:b,subscribe:l}}function B(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const b=t.length<2;return z(n,(l,u)=>{let o=!1;const s=[];let d=0,p=a;const y=()=>{if(d)return;p();const c=t(r?s[0]:s,l,u);b?l(c):p=typeof c=="function"?c:a},h=i.map((c,g)=>_(c,m=>{s[g]=m,d&=~(1<{d|=1<t=n)(),t}export{B as d,E as g,_ as s,A as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.br b/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.br new file mode 100644 index 0000000..818be5e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.gz b/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.gz new file mode 100644 index 0000000..6c1fdbe Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DngRZTwo.js b/apps/dashboard/build/_app/immutable/chunks/DngRZTwo.js deleted file mode 100644 index 9cb6625..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/DngRZTwo.js +++ /dev/null @@ -1 +0,0 @@ -import{b as p,E as t}from"./DEYVqDYQ.js";import{B as c}from"./Cc4zGfaP.js";function E(r,s,...a){var e=new c(r);p(()=>{const n=s()??null;e.ensure(n,n&&(o=>n(o,...a)))},t)}export{E as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DngRZTwo.js.br b/apps/dashboard/build/_app/immutable/chunks/DngRZTwo.js.br deleted file mode 100644 index 9f14046..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DngRZTwo.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DngRZTwo.js.gz b/apps/dashboard/build/_app/immutable/chunks/DngRZTwo.js.gz deleted file mode 100644 index 6bcd642..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DngRZTwo.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js b/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js new file mode 100644 index 0000000..3c92625 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js @@ -0,0 +1 @@ +import{n as L,o as D,P as T,g as P,c as B,h as b,v as Y,w as h,D as x,x as M,m as N,y as U,z as w,A as z,B as C,C as $,F as q,S as y,L as F}from"./C9Z4nxhR.js";import{c as G}from"./DWr9YED7.js";function H(r,a,t,s){var o;var f=!U||(t&w)!==0,v=(t&M)!==0,E=(t&q)!==0,n=s,c=!0,g=()=>(c&&(c=!1,n=E?N(s):s),n),u;if(v){var O=y in r||F in r;u=((o=L(r,a))==null?void 0:o.set)??(O&&a in r?e=>r[a]=e:void 0)}var _,I=!1;v?[_,I]=G(()=>r[a]):_=r[a],_===void 0&&s!==void 0&&(_=g(),u&&(f&&D(),u(_)));var i;if(f?i=()=>{var e=r[a];return e===void 0?g():(c=!0,e)}:i=()=>{var e=r[a];return e!==void 0&&(n=void 0),e===void 0?n:e},f&&(t&T)===0)return i;if(u){var R=r.$$legacy;return(function(e,S){return arguments.length>0?((!f||!S||R||I)&&u(S?i():e),e):i()})}var l=!1,d=((t&z)!==0?C:$)(()=>(l=!1,i()));v&&P(d);var m=h;return(function(e,S){if(arguments.length>0){const A=S?P(d):f&&v?B(e):e;return b(d,A),l=!0,n!==void 0&&(n=A),e}return Y&&l||(m.f&x)!==0?d.v:P(d)})}export{H as p}; diff --git a/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.br b/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.br new file mode 100644 index 0000000..40fa331 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.br @@ -0,0 +1,2 @@ + ¶rYk$IteSޱPq?*J[,Tyo?p +/4cuRD"I2g3IyqvqFD!(rAg\RO 0#G !eT Ctftw{۬PbTV#m : vxZZ${D4,8C1P.N ]~Z*KH)IZlj}ر:܅rI,Wz9jt`,5=ZNno7jRu`=ǁ1fZ680%)NK #Uo ~ZIZ@ǎYFcR2 _epvLexkX3dF(2)͗lN qr㖂89iPJ$=|jPK+y%\a^9ihfu|ssZFp \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.gz b/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.gz new file mode 100644 index 0000000..e29dd4d Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Dr_bhyBn.js b/apps/dashboard/build/_app/immutable/chunks/Dr_bhyBn.js deleted file mode 100644 index 44528b7..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/Dr_bhyBn.js +++ /dev/null @@ -1 +0,0 @@ -import{I as b,q,am as w,ab as x}from"./DEYVqDYQ.js";function _(e,t,n){if(e==null)return t(void 0),n&&n(void 0),b;const r=q(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const f=[];function z(e,t){return{subscribe:A(e,t).subscribe}}function A(e,t=b){let n=null;const r=new Set;function i(u){if(w(e,u)&&(e=u,n)){const o=!f.length;for(const s of r)s[1](),f.push(s,e);if(o){for(let s=0;s{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:l}}function B(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const a=t.length<2;return z(n,(l,u)=>{let o=!1;const s=[];let d=0,p=b;const y=()=>{if(d)return;p();const c=t(r?s[0]:s,l,u);a?l(c):p=typeof c=="function"?c:b},h=i.map((c,g)=>_(c,m=>{s[g]=m,d&=~(1<{d|=1<t=n)(),t}export{B as d,E as g,_ as s,A as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/Dr_bhyBn.js.br b/apps/dashboard/build/_app/immutable/chunks/Dr_bhyBn.js.br deleted file mode 100644 index 33a0c00..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Dr_bhyBn.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Dr_bhyBn.js.gz b/apps/dashboard/build/_app/immutable/chunks/Dr_bhyBn.js.gz deleted file mode 100644 index 99f8f2e..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Dr_bhyBn.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Dwpy08gq.js b/apps/dashboard/build/_app/immutable/chunks/Dwpy08gq.js deleted file mode 100644 index a71ddf5..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/Dwpy08gq.js +++ /dev/null @@ -1 +0,0 @@ -const e={fact:"#3b82f6",concept:"#8b5cf6",event:"#f59e0b",person:"#10b981",place:"#06b6d4",note:"#6b7280",pattern:"#ec4899",decision:"#ef4444"},o={MemoryCreated:"#10b981",MemoryUpdated:"#3b82f6",MemoryDeleted:"#ef4444",MemoryPromoted:"#22c55e",MemoryDemoted:"#f97316",SearchPerformed:"#6366f1",DreamStarted:"#8b5cf6",DreamProgress:"#7c3aed",DreamCompleted:"#a855f7",ConsolidationStarted:"#f59e0b",ConsolidationCompleted:"#f97316",RetentionDecayed:"#ef4444",ConnectionDiscovered:"#06b6d4",ActivationSpread:"#14b8a6",ImportanceScored:"#ec4899",Heartbeat:"#6b7280"};export{o as E,e as N}; diff --git a/apps/dashboard/build/_app/immutable/chunks/Dwpy08gq.js.br b/apps/dashboard/build/_app/immutable/chunks/Dwpy08gq.js.br deleted file mode 100644 index b256ccc..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Dwpy08gq.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Dwpy08gq.js.gz b/apps/dashboard/build/_app/immutable/chunks/Dwpy08gq.js.gz deleted file mode 100644 index 2d41373..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Dwpy08gq.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js b/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js new file mode 100644 index 0000000..52b89bd --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js @@ -0,0 +1 @@ +import{H as m,I as _,m as b,l as i,J as y,K as v,M as h}from"./C9Z4nxhR.js";function E(e,l,u=l){var f=new WeakSet;m(e,"input",async r=>{var a=r?e.defaultValue:e.value;if(a=t(e)?o(a):a,u(a),v!==null&&f.add(v),await _(),a!==(a=l())){var d=e.selectionStart,s=e.selectionEnd,n=e.value.length;if(e.value=a??"",s!==null){var c=e.value.length;d===s&&s===n&&c>n?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=d,e.selectionEnd=Math.min(s,c))}}}),(y&&e.defaultValue!==e.value||b(l)==null&&e.value)&&(u(t(e)?o(e.value):e.value),v!==null&&f.add(v)),i(()=>{var r=l();if(e===document.activeElement){var a=h??v;if(f.has(a))return}t(e)&&r===o(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function t(e){var l=e.type;return l==="number"||l==="range"}function o(e){return e===""?null:+e}export{E as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.br b/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.br new file mode 100644 index 0000000..4ab9609 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.gz b/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.gz new file mode 100644 index 0000000..90c838c Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/ZM2C7QQX.js b/apps/dashboard/build/_app/immutable/chunks/ZM2C7QQX.js deleted file mode 100644 index a6d822c..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/ZM2C7QQX.js +++ /dev/null @@ -1,2 +0,0 @@ -var ke=Object.defineProperty;var ce=t=>{throw TypeError(t)};var Ie=(t,e,r)=>e in t?ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var $=(t,e,r)=>Ie(t,typeof e!="symbol"?e+"":e,r),re=(t,e,r)=>e.has(t)||ce("Cannot "+r);var s=(t,e,r)=>(re(t,e,"read from private field"),r?r.call(t):e.get(t)),l=(t,e,r)=>e.has(t)?ce("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),a=(t,e,r,n)=>(re(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),p=(t,e,r)=>(re(t,e,"access private method"),r);import{aL as Me,g as Ee,C as Ce,q as Ve,aM as ue,F as X,ax as Te,a5 as k,M as I,n as q,aN as _e,b as Pe,V as qe,Y as xe,aO as pe,a4 as Y,a3 as we,aP as se,a2 as ie,a6 as Be,aQ as ge,aR as He,aS as ve,aT as Le,aU as We,aV as J,aW as K,aX as ye,aY as $e,aZ as Re,a8 as Se,ar as je,a1 as ae,_ as Q,G as ze,Z as Ue,a_ as j,E as Xe,a$ as Ze,b0 as Ge,b1 as Je,K as Ke,b2 as ne,ao as Qe,ap as De,X as et,aD as tt,b3 as fe,$ as z,b4 as rt,aC as st,b5 as it,au as at,p as nt,aq as ft,b6 as ht,a as ot}from"./DEYVqDYQ.js";import{b as lt}from"./D5-kFxsM.js";function dt(t){let e=0,r=Te(0),n;return()=>{Me()&&(Ee(r),Ce(()=>(e===0&&(n=Ve(()=>t(()=>ue(r)))),e+=1,()=>{X(()=>{e-=1,e===0&&(n==null||n(),n=void 0,ue(r))})})))}}var ct=Xe|Ze;function ut(t,e,r,n){new _t(t,e,r,n)}var m,W,w,C,g,R,E,T,S,V,A,x,B,H,D,ee,h,Ne,Ae,Oe,he,Z,G,oe;class _t{constructor(e,r,n,c){l(this,h);$(this,"parent");$(this,"is_pending",!1);$(this,"transform_error");l(this,m);l(this,W,I?k:null);l(this,w);l(this,C);l(this,g);l(this,R,null);l(this,E,null);l(this,T,null);l(this,S,null);l(this,V,0);l(this,A,0);l(this,x,!1);l(this,B,new Set);l(this,H,new Set);l(this,D,null);l(this,ee,dt(()=>(a(this,D,Te(s(this,V))),()=>{a(this,D,null)})));var i;a(this,m,e),a(this,w,r),a(this,C,f=>{var u=q;u.b=this,u.f|=_e,n(f)}),this.parent=q.b,this.transform_error=c??((i=this.parent)==null?void 0:i.transform_error)??(f=>f),a(this,g,Pe(()=>{if(I){const f=s(this,W);qe();const u=f.data===xe;if(f.data.startsWith(pe)){const d=JSON.parse(f.data.slice(pe.length));p(this,h,Ae).call(this,d)}else u?p(this,h,Oe).call(this):p(this,h,Ne).call(this)}else p(this,h,he).call(this)},ct)),I&&a(this,m,k)}defer_effect(e){We(e,s(this,B),s(this,H))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!s(this,w).pending}update_pending_count(e){p(this,h,oe).call(this,e),a(this,V,s(this,V)+e),!(!s(this,D)||s(this,x))&&(a(this,x,!0),X(()=>{a(this,x,!1),s(this,D)&&je(s(this,D),s(this,V))}))}get_effect_pending(){return s(this,ee).call(this),Ee(s(this,D))}error(e){var r=s(this,w).onerror;let n=s(this,w).failed;if(!r&&!n)throw e;s(this,R)&&(ae(s(this,R)),a(this,R,null)),s(this,E)&&(ae(s(this,E)),a(this,E,null)),s(this,T)&&(ae(s(this,T)),a(this,T,null)),I&&(Q(s(this,W)),ze(),Q(Ue()));var c=!1,i=!1;const f=()=>{if(c){Je();return}c=!0,i&&Ge(),s(this,T)!==null&&ie(s(this,T),()=>{a(this,T,null)}),p(this,h,G).call(this,()=>{se.ensure(),p(this,h,he).call(this)})},u=o=>{try{i=!0,r==null||r(o,f),i=!1}catch(d){j(d,s(this,g)&&s(this,g).parent)}n&&a(this,T,p(this,h,G).call(this,()=>{se.ensure();try{return Y(()=>{var d=q;d.b=this,d.f|=_e,n(s(this,m),()=>o,()=>f)})}catch(d){return j(d,s(this,g).parent),null}}))};X(()=>{var o;try{o=this.transform_error(e)}catch(d){j(d,s(this,g)&&s(this,g).parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(u,d=>j(d,s(this,g)&&s(this,g).parent)):u(o)})}}m=new WeakMap,W=new WeakMap,w=new WeakMap,C=new WeakMap,g=new WeakMap,R=new WeakMap,E=new WeakMap,T=new WeakMap,S=new WeakMap,V=new WeakMap,A=new WeakMap,x=new WeakMap,B=new WeakMap,H=new WeakMap,D=new WeakMap,ee=new WeakMap,h=new WeakSet,Ne=function(){try{a(this,R,Y(()=>s(this,C).call(this,s(this,m))))}catch(e){this.error(e)}},Ae=function(e){const r=s(this,w).failed;r&&a(this,T,Y(()=>{r(s(this,m),()=>e,()=>()=>{})}))},Oe=function(){const e=s(this,w).pending;e&&(this.is_pending=!0,a(this,E,Y(()=>e(s(this,m)))),X(()=>{var r=a(this,S,document.createDocumentFragment()),n=we();r.append(n),a(this,R,p(this,h,G).call(this,()=>(se.ensure(),Y(()=>s(this,C).call(this,n))))),s(this,A)===0&&(s(this,m).before(r),a(this,S,null),ie(s(this,E),()=>{a(this,E,null)}),p(this,h,Z).call(this))}))},he=function(){try{if(this.is_pending=this.has_pending_snippet(),a(this,A,0),a(this,V,0),a(this,R,Y(()=>{s(this,C).call(this,s(this,m))})),s(this,A)>0){var e=a(this,S,document.createDocumentFragment());Be(s(this,R),e);const r=s(this,w).pending;a(this,E,Y(()=>r(s(this,m))))}else p(this,h,Z).call(this)}catch(r){this.error(r)}},Z=function(){this.is_pending=!1;for(const e of s(this,B))ge(e,He),ve(e);for(const e of s(this,H))ge(e,Le),ve(e);s(this,B).clear(),s(this,H).clear()},G=function(e){var r=q,n=Re,c=Se;J(s(this,g)),K(s(this,g)),ye(s(this,g).ctx);try{return e()}catch(i){return $e(i),null}finally{J(r),K(n),ye(c)}},oe=function(e){var r;if(!this.has_pending_snippet()){this.parent&&p(r=this.parent,h,oe).call(r,e);return}a(this,A,s(this,A)+e),s(this,A)===0&&(p(this,h,Z).call(this),s(this,E)&&ie(s(this,E),()=>{a(this,E,null)}),s(this,S)&&(s(this,m).before(s(this,S)),a(this,S,null)))};const pt=["touchstart","touchmove"];function gt(t){return pt.includes(t)}const M=Symbol("events"),Fe=new Set,le=new Set;function Et(t,e,r){(e[M]??(e[M]={}))[t]=r}function Tt(t){for(var e=0;e{throw F});throw N}}finally{t[M]=e,delete t.currentTarget,K(P),J(L)}}}function wt(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=r,t.nodeValue=r+"")}function vt(t,e){return Ye(t,e)}function Rt(t,e){ne(),e.intro=e.intro??!1;const r=e.target,n=I,c=k;try{for(var i=Qe(r);i&&(i.nodeType!==De||i.data!==et);)i=tt(i);if(!i)throw fe;z(!0),Q(i);const f=Ye(t,{...e,anchor:i});return z(!1),f}catch(f){if(f instanceof Error&&f.message.split(` -`).some(u=>u.startsWith("https://svelte.dev/e/")))throw f;return f!==fe&&console.warn("Failed to hydrate: ",f),e.recover===!1&&rt(),ne(),st(r),z(!1),vt(t,e)}finally{z(n),Q(c)}}const U=new Map;function Ye(t,{target:e,anchor:r,props:n={},events:c,context:i,intro:f=!0,transformError:u}){ne();var o=void 0,d=it(()=>{var P=r??e.appendChild(we());ut(P,{pending:()=>{}},v=>{nt({});var _=Se;if(i&&(_.c=i),c&&(n.$$events=c),I&<(v,null),o=t(v,n)||{},I&&(q.nodes.end=k,k===null||k.nodeType!==De||k.data!==ft))throw ht(),fe;ot()},u);var L=new Set,N=v=>{for(var _=0;_{var O;for(var v of L)for(const b of[e,document]){var _=U.get(b),y=_.get(v);--y==0?(b.removeEventListener(v,me),_.delete(v),_.size===0&&U.delete(b)):_.set(v,y)}le.delete(N),P!==r&&((O=P.parentNode)==null||O.removeChild(P))}});return de.set(o,d),o}let de=new WeakMap;function St(t,e){const r=de.get(t);return r?(de.delete(t),r(e)):Promise.resolve()}export{Et as a,Tt as d,Rt as h,vt as m,wt as s,St as u}; diff --git a/apps/dashboard/build/_app/immutable/chunks/ZM2C7QQX.js.br b/apps/dashboard/build/_app/immutable/chunks/ZM2C7QQX.js.br deleted file mode 100644 index 83419a6..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/ZM2C7QQX.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/ZM2C7QQX.js.gz b/apps/dashboard/build/_app/immutable/chunks/ZM2C7QQX.js.gz deleted file mode 100644 index 8cf6a7f..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/ZM2C7QQX.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js b/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js new file mode 100644 index 0000000..e888155 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js @@ -0,0 +1 @@ +import{J as i,q as d,N as n,O as v,Q as u,R as h,T as g,U as A}from"./C9Z4nxhR.js";const N=Symbol("is custom element"),T=Symbol("is html"),l=h?"link":"LINK";function S(r){if(i){var s=!1,e=()=>{if(!s){if(s=!0,r.hasAttribute("value")){var a=r.value;t(r,"value",null),r.value=a}if(r.hasAttribute("checked")){var o=r.checked;t(r,"checked",null),r.checked=o}}};r.__on_r=e,d(e),n()}}function t(r,s,e,a){var o=p(r);i&&(o[s]=r.getAttribute(s),s==="src"||s==="srcset"||s==="href"&&r.nodeName===l)||o[s]!==(o[s]=e)&&(s==="loading"&&(r[v]=e),e==null?r.removeAttribute(s):typeof e!="string"&&L(r).includes(s)?r[s]=e:r.setAttribute(s,e))}function p(r){return r.__attributes??(r.__attributes={[N]:r.nodeName.includes("-"),[T]:r.namespaceURI===u})}var c=new Map;function L(r){var s=r.getAttribute("is")||r.nodeName,e=c.get(s);if(e)return e;c.set(s,e=[]);for(var a,o=r,f=Element.prototype;f!==o;){a=A(o);for(var _ in a)a[_].set&&e.push(_);o=g(o)}return e}export{S as r,t as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.br b/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.br new file mode 100644 index 0000000..d37a483 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.br @@ -0,0 +1,2 @@ +@VU\6u639TiܥX*;U7͡bV+y@k>S(Ԝ w[V?O`K5|MMrZ>/_Wl"?"_+*mk:ȼ +C5sm?BC9òx&y I vt\gνu}!x*j斨L5M!eSO1*HJo$VߛJ H)i',W8\YEt7rDLp<>-, Ekx@쪹I +7Qh>i'T$iJӜ8,\Z?B-쐌;Mu@PhH}n#*COROdJbϹ,"Dɢ6/zdZ(B5@M#[ O/s噬S,^޲/^XV"JFHIf%m2[~9 \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.gz b/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.gz new file mode 100644 index 0000000..30a5772 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js b/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js new file mode 100644 index 0000000..03ef2ab --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js @@ -0,0 +1 @@ +import{af as g,ag as d,ah as c,m,ai as i,aj as b,g as p,ak as h,B as k,al as v}from"./C9Z4nxhR.js";function x(t=!1){const a=g,e=a.l.u;if(!e)return;let o=()=>h(a.s);if(t){let n=0,s={};const _=k(()=>{let l=!1;const r=a.s;for(const f in r)r[f]!==s[f]&&(s[f]=r[f],l=!0);return l&&n++,n});o=()=>p(_)}e.b.length&&d(()=>{u(a,o),i(e.b)}),c(()=>{const n=m(()=>e.m.map(b));return()=>{for(const s of n)typeof s=="function"&&s()}}),e.a.length&&c(()=>{u(a,o),i(e.a)})}function u(t,a){if(t.l.s)for(const e of t.l.s)p(e);a()}v();export{x as i}; diff --git a/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.br b/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.br new file mode 100644 index 0000000..09e4908 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.br @@ -0,0 +1,2 @@ +@X:tw.I?cY$_49ǟ{};ьU42T=%\O]$U2$(&f;`퇇 zD- ^vpkwB.H8P^N \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.gz b/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.gz new file mode 100644 index 0000000..9e03ee6 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/dR5TMuCX.js b/apps/dashboard/build/_app/immutable/chunks/dR5TMuCX.js deleted file mode 100644 index 680a4ef..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/dR5TMuCX.js +++ /dev/null @@ -1 +0,0 @@ -import{a8 as d,a9 as g,aa as l,q as b,ab as i,ac as m,g as p,ad as v,y,ae as h}from"./DEYVqDYQ.js";function x(t=!1){const a=d,e=a.l.u;if(!e)return;let f=()=>v(a.s);if(t){let n=0,s={};const _=y(()=>{let c=!1;const r=a.s;for(const o in r)r[o]!==s[o]&&(s[o]=r[o],c=!0);return c&&n++,n});f=()=>p(_)}e.b.length&&g(()=>{u(a,f),i(e.b)}),l(()=>{const n=b(()=>e.m.map(m));return()=>{for(const s of n)typeof s=="function"&&s()}}),e.a.length&&l(()=>{u(a,f),i(e.a)})}function u(t,a){if(t.l.s)for(const e of t.l.s)p(e);a()}h();export{x as i}; diff --git a/apps/dashboard/build/_app/immutable/chunks/dR5TMuCX.js.br b/apps/dashboard/build/_app/immutable/chunks/dR5TMuCX.js.br deleted file mode 100644 index c5980cb..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/dR5TMuCX.js.br +++ /dev/null @@ -1,3 +0,0 @@ -@v6֔ -bhmZ{61Av3nڬ{^*ADPF^p4)E%M '+uw]ᴉE}ŕԑKQ$}eJM`VAѧsTn^J2XYG[见s%N|G;Y,LO5YscΟIďxhY{2v|g=֎&>ɈBfRg\NX%~((m:|Mz -qƩҕ:SPnKr2Qe27fPAO`Z9kkgs \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/dR5TMuCX.js.gz b/apps/dashboard/build/_app/immutable/chunks/dR5TMuCX.js.gz deleted file mode 100644 index 821ef61..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/dR5TMuCX.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js b/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js new file mode 100644 index 0000000..4447ab5 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js @@ -0,0 +1 @@ +import{aa as F,b as fe,an as ne,J as D,a5 as q,ao as ie,a0 as le,g as Q,a1 as ue,a3 as se,a4 as W,a6 as L,ac as z,ap as oe,aq as te,ar as $,K as ve,as as C,ab as y,at as de,ae as ce,C as pe,Z as _e,au as X,av as he,aw as ge,X as Ee,ax as j,ay as me,a7 as re,a9 as ae,az as B,q as Ce,aA as Te,aB as Ae,aC as we,a8 as Se,aD as Ie}from"./C9Z4nxhR.js";function De(e,r){return r}function Ne(e,r,l){for(var t=[],g=r.length,s,u=r.length,c=0;c{if(s){if(s.pending.delete(E),s.done.add(E),s.pending.size===0){var o=e.outrogroups;V(X(s.done)),o.delete(s),o.size===0&&(e.outrogroups=null)}}else u-=1},!1)}if(u===0){var i=t.length===0&&l!==null;if(i){var v=l,a=v.parentNode;we(a),a.append(v),e.items.clear()}V(r,!i)}else s={pending:new Set(r),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(s)}function V(e,r=!0){for(var l=0;l{var f=l();return _e(f)?f:f==null?[]:X(f)}),o,d=!0;function A(){n.fallback=a,xe(n,o,u,r,t),a!==null&&(o.length===0?(a.f&C)===0?re(a):(a.f^=C,M(a,null,u)):ae(a,()=>{a=null}))}var I=fe(()=>{o=Q(E);var f=o.length;let N=!1;if(D){var x=ue(u)===se;x!==(f===0)&&(u=W(),q(u),L(!1),N=!0)}for(var _=new Set,w=ve,b=ce(),p=0;ps(u)):(a=y(()=>s(ee??(ee=F()))),a.f|=C)),f>_.size&&de(),D&&f>0&&q(W()),!d)if(b){for(const[k,O]of c)_.has(k)||w.skip_effect(O.e);w.oncommit(A),w.ondiscard(()=>{})}else A();N&&L(!0),Q(E)}),n={effect:I,items:c,outrogroups:null,fallback:a};d=!1,D&&(u=z)}function H(e){for(;e!==null&&(e.f&Te)===0;)e=e.next;return e}function xe(e,r,l,t,g){var h,k,O,Y,J,K,U,Z,G;var s=(t&Ae)!==0,u=r.length,c=e.items,i=H(e.effect.first),v,a=null,E,o=[],d=[],A,I,n,f;if(s)for(f=0;f0){var R=(t&ne)!==0&&u===0?l:null;if(s){for(f=0;f{var m,P;if(E!==void 0)for(n of E)(P=(m=n.nodes)==null?void 0:m.a)==null||P.apply()})}function be(e,r,l,t,g,s,u,c){var i=(u&he)!==0?(u&ge)===0?Ee(l,!1,!1):j(l):null,v=(u&me)!==0?j(g):null;return{v:i,i:v,e:y(()=>(s(r,i??l,v??g,c),()=>{e.delete(t)}))}}function M(e,r,l){if(e.nodes)for(var t=e.nodes.start,g=e.nodes.end,s=r&&(r.f&C)===0?r.nodes.start:l;t!==null;){var u=Ie(t);if(s.before(t),t===g)return;t=u}}function T(e,r,l){r===null?e.effect.first=l:r.next=l,l===null?e.effect.last=r:l.prev=r}function Me(e,r,l){var t=e==null?"":""+e;return t===""?null:t}function ke(e,r){return e==null?null:String(e)}export{ke as a,He as e,De as i,Me as t}; diff --git a/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.br b/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.br new file mode 100644 index 0000000..09fc4f1 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.gz b/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.gz new file mode 100644 index 0000000..7de25f7 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/zt9hmg4X.js.br b/apps/dashboard/build/_app/immutable/chunks/zt9hmg4X.js.br deleted file mode 100644 index 1a0bb70..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/zt9hmg4X.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/zt9hmg4X.js.gz b/apps/dashboard/build/_app/immutable/chunks/zt9hmg4X.js.gz deleted file mode 100644 index eceeb65..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/zt9hmg4X.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.D66lMUMV.js b/apps/dashboard/build/_app/immutable/entry/app.D66lMUMV.js new file mode 100644 index 0000000..5aea3da --- /dev/null +++ b/apps/dashboard/build/_app/immutable/entry/app.D66lMUMV.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.dCbzyxTz.js","../chunks/Bzak7iHL.js","../chunks/CkyfbJUz.js","../chunks/C9Z4nxhR.js","../chunks/DP9qWekZ.js","../chunks/DPfxVJHQ.js","../chunks/C2oj68pw.js","../chunks/CY4crMrT.js","../chunks/kH-DTQyy.js","../chunks/D00YwZ1M.js","../chunks/ZesQ8l8p.js","../chunks/Co2v30Gm.js","../chunks/P9ZHwQBL.js","../chunks/CR6HhlME.js","../chunks/DWr9YED7.js","../chunks/DnKV7_Y9.js","../chunks/C9fAJV5Y.js","../chunks/BmeMLq0p.js","../assets/0.3Bakyq8T.css","../nodes/1.DaR0oFWP.js","../chunks/_Va07L2l.js","../nodes/2.Bv9w28KX.js","../nodes/3.B4vgfaGj.js","../nodes/4.CeoFmj14.js","../chunks/BkopTN9z.js","../chunks/BcuCGYSa.js","../nodes/5.CgbdGsQS.js","../chunks/CZ45jJaw.js","../chunks/Do8TgQ-j.js","../assets/5.BBx09UGv.css","../nodes/6.jU9oGgW9.js","../chunks/-jeO_JOJ.js","../nodes/7.BI22Pt_j.js","../nodes/8.Cq7jwWnG.js","../nodes/9.19crbYuZ.js","../nodes/10.CsJcFbdU.js","../nodes/11.C5VMEnLV.js"])))=>i.map(i=>d[i]); +var M=r=>{throw TypeError(r)};var Q=(r,t,e)=>t.has(r)||M("Cannot "+e);var m=(r,t,e)=>(Q(r,t,"read from private field"),e?e.call(r):t.get(r)),H=(r,t,e)=>t.has(r)?M("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),J=(r,t,e,n)=>(Q(r,t,"write to private field"),n?n.call(r,e):t.set(r,e),e);import{J as Z,a0 as ut,b as lt,E as mt,a1 as _t,a4 as dt,a5 as ft,a6 as $,a2 as ht,ac as vt,h as q,L as gt,g as v,b7 as Et,Y as yt,X as pt,p as Pt,ag as Rt,ah as bt,I as Ot,f as L,d as At,a as Tt,s as W,e as Lt,r as wt,t as It,u as V}from"../chunks/C9Z4nxhR.js";import{h as kt,m as Dt,u as xt,s as Vt}from"../chunks/DP9qWekZ.js";import"../chunks/Bzak7iHL.js";import{o as St}from"../chunks/CkyfbJUz.js";import{i as B}from"../chunks/C2oj68pw.js";import{a as y,c as k,f as et,t as jt}from"../chunks/DPfxVJHQ.js";import{B as Ct}from"../chunks/CY4crMrT.js";import{b as S}from"../chunks/CR6HhlME.js";import{p as Y}from"../chunks/Do8TgQ-j.js";function j(r,t,e){var n;Z&&(n=vt,ut());var o=new Ct(r);lt(()=>{var l=t()??null;if(Z){var s=_t(n),a=s===ht,i=l!==null;if(a!==i){var P=dt();ft(P),o.anchor=P,$(!1),o.ensure(l,l&&(c=>e(c,l))),$(!0);return}}o.ensure(l,l&&(c=>e(c,l)))},mt)}function Bt(r){return class extends Yt{constructor(t){super({component:r,...t})}}}var p,d;class Yt{constructor(t){H(this,p);H(this,d);var l;var e=new Map,n=(s,a)=>{var i=pt(a,!1,!1);return e.set(s,i),i};const o=new Proxy({...t.props||{},$$events:{}},{get(s,a){return v(e.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===gt?!0:(v(e.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,i){return q(e.get(a)??n(a,i),i),Reflect.set(s,a,i)}});J(this,d,(t.hydrate?kt:Dt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&Et(),J(this,p,o.$$events);for(const s of Object.keys(m(this,d)))s==="$set"||s==="$destroy"||s==="$on"||yt(this,s,{get(){return m(this,d)[s]},set(a){m(this,d)[s]=a},enumerable:!0});m(this,d).$set=s=>{Object.assign(o,s)},m(this,d).$destroy=()=>{xt(m(this,d))}}$set(t){m(this,d).$set(t)}$on(t,e){m(this,p)[t]=m(this,p)[t]||[];const n=(...o)=>e.call(this,...o);return m(this,p)[t].push(n),()=>{m(this,p)[t]=m(this,p)[t].filter(o=>o!==n)}}$destroy(){m(this,d).$destroy()}}p=new WeakMap,d=new WeakMap;const qt="modulepreload",Ft=function(r,t){return new URL(r,t).href},tt={},_=function(t,e,n){let o=Promise.resolve();if(e&&e.length>0){let s=function(c){return Promise.all(c.map(g=>Promise.resolve(g).then(R=>({status:"fulfilled",value:R}),R=>({status:"rejected",reason:R}))))};const a=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),P=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=s(e.map(c=>{if(c=Ft(c,n),c in tt)return;tt[c]=!0;const g=c.endsWith(".css"),R=g?'[rel="stylesheet"]':"";if(!!n)for(let b=a.length-1;b>=0;b--){const u=a[b];if(u.href===c&&(!g||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${R}`))return;const E=document.createElement("link");if(E.rel=g?"stylesheet":qt,g||(E.as="script"),E.crossOrigin="",E.href=c,P&&E.setAttribute("nonce",P),document.head.appendChild(E),g)return new Promise((b,u)=>{E.addEventListener("load",b),E.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${c}`)))})}))}function l(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&l(a.reason);return t().catch(l)})},ae={};var Nt=et('
'),Ut=et(" ",1);function Gt(r,t){Pt(t,!0);let e=Y(t,"components",23,()=>[]),n=Y(t,"data_0",3,null),o=Y(t,"data_1",3,null),l=Y(t,"data_2",3,null);Rt(()=>t.stores.page.set(t.page)),bt(()=>{t.stores,t.page,t.constructors,e(),t.form,n(),o(),l(),t.stores.page.notify()});let s=W(!1),a=W(!1),i=W(null);St(()=>{const u=t.stores.page.subscribe(()=>{v(s)&&(q(a,!0),Ot().then(()=>{q(i,document.title||"untitled page",!0)}))});return q(s,!0),u});const P=V(()=>t.constructors[2]);var c=Ut(),g=L(c);{var R=u=>{const O=V(()=>t.constructors[0]);var A=k(),D=L(A);j(D,()=>v(O),(T,w)=>{S(w(T,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(f,Jt)=>{var z=k(),at=L(z);{var st=I=>{const F=V(()=>t.constructors[1]);var x=k(),N=L(x);j(N,()=>v(F),(U,G)=>{S(G(U,{get data(){return o()},get form(){return t.form},get params(){return t.page.params},children:(h,Wt)=>{var K=k(),ot=L(K);j(ot,()=>v(P),(it,ct)=>{S(ct(it,{get data(){return l()},get form(){return t.form},get params(){return t.page.params}}),C=>e()[2]=C,()=>{var C;return(C=e())==null?void 0:C[2]})}),y(h,K)},$$slots:{default:!0}}),h=>e()[1]=h,()=>{var h;return(h=e())==null?void 0:h[1]})}),y(I,x)},nt=I=>{const F=V(()=>t.constructors[1]);var x=k(),N=L(x);j(N,()=>v(F),(U,G)=>{S(G(U,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),h=>e()[1]=h,()=>{var h;return(h=e())==null?void 0:h[1]})}),y(I,x)};B(at,I=>{t.constructors[2]?I(st):I(nt,!1)})}y(f,z)},$$slots:{default:!0}}),f=>e()[0]=f,()=>{var f;return(f=e())==null?void 0:f[0]})}),y(u,A)},X=u=>{const O=V(()=>t.constructors[0]);var A=k(),D=L(A);j(D,()=>v(O),(T,w)=>{S(w(T,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),f=>e()[0]=f,()=>{var f;return(f=e())==null?void 0:f[0]})}),y(u,A)};B(g,u=>{t.constructors[1]?u(R):u(X,!1)})}var E=At(g,2);{var b=u=>{var O=Nt(),A=Lt(O);{var D=T=>{var w=jt();It(()=>Vt(w,v(i))),y(T,w)};B(A,T=>{v(a)&&T(D)})}wt(O),y(u,O)};B(E,u=>{v(s)&&u(b)})}y(r,c),Tt()}const se=Bt(Gt),ne=[()=>_(()=>import("../nodes/0.dCbzyxTz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url),()=>_(()=>import("../nodes/1.DaR0oFWP.js"),__vite__mapDeps([19,1,20,3,4,5,16,15,2]),import.meta.url),()=>_(()=>import("../nodes/2.Bv9w28KX.js"),__vite__mapDeps([21,1,3,5,9,7]),import.meta.url),()=>_(()=>import("../nodes/3.B4vgfaGj.js"),__vite__mapDeps([22,1,20,3,2,16,15]),import.meta.url),()=>_(()=>import("../nodes/4.CeoFmj14.js"),__vite__mapDeps([23,1,3,4,5,6,7,8,10,11,24,12,25]),import.meta.url),()=>_(()=>import("../nodes/5.CgbdGsQS.js"),__vite__mapDeps([26,1,20,3,4,5,6,7,8,24,14,15,17,27,10,11,28,29]),import.meta.url),()=>_(()=>import("../nodes/6.jU9oGgW9.js"),__vite__mapDeps([30,1,2,3,4,5,6,7,8,10,11,24,12,31,14,15,13,28,27,25,17]),import.meta.url),()=>_(()=>import("../nodes/7.BI22Pt_j.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,8,11,25]),import.meta.url),()=>_(()=>import("../nodes/8.Cq7jwWnG.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,10,11,24,12,31,25,27]),import.meta.url),()=>_(()=>import("../nodes/9.19crbYuZ.js"),__vite__mapDeps([34,1,2,3,4,5,6,7,8,11,24,14,15,25,17]),import.meta.url),()=>_(()=>import("../nodes/10.CsJcFbdU.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,8,24,25]),import.meta.url),()=>_(()=>import("../nodes/11.C5VMEnLV.js"),__vite__mapDeps([36,1,2,3,4,5,6,7,8,24,31,25,27]),import.meta.url)],oe=[],ie={"/":[3],"/(app)/explore":[4,[2]],"/(app)/feed":[5,[2]],"/(app)/graph":[6,[2]],"/(app)/intentions":[7,[2]],"/(app)/memories":[8,[2]],"/(app)/settings":[9,[2]],"/(app)/stats":[10,[2]],"/(app)/timeline":[11,[2]]},rt={handleError:(({error:r})=>{console.error(r)}),reroute:(()=>{}),transport:{}},Ht=Object.fromEntries(Object.entries(rt.transport).map(([r,t])=>[r,t.decode])),ce=Object.fromEntries(Object.entries(rt.transport).map(([r,t])=>[r,t.encode])),ue=!1,le=(r,t)=>Ht[r](t);export{le as decode,Ht as decoders,ie as dictionary,ce as encoders,ue as hash,rt as hooks,ae as matchers,ne as nodes,se as root,oe as server_loads}; diff --git a/apps/dashboard/build/_app/immutable/entry/app.D66lMUMV.js.br b/apps/dashboard/build/_app/immutable/entry/app.D66lMUMV.js.br new file mode 100644 index 0000000..66dbd0d Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/app.D66lMUMV.js.br differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.D66lMUMV.js.gz b/apps/dashboard/build/_app/immutable/entry/app.D66lMUMV.js.gz new file mode 100644 index 0000000..ba256c0 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/app.D66lMUMV.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.R5Nt9GQF.js b/apps/dashboard/build/_app/immutable/entry/app.R5Nt9GQF.js deleted file mode 100644 index 1eb22c4..0000000 --- a/apps/dashboard/build/_app/immutable/entry/app.R5Nt9GQF.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.DZQ2ZPtV.js","../chunks/Bzak7iHL.js","../chunks/BycUxjt3.js","../chunks/DEYVqDYQ.js","../chunks/ZM2C7QQX.js","../chunks/D5-kFxsM.js","../chunks/CpubbTHs.js","../chunks/Cc4zGfaP.js","../chunks/CiJhRXcr.js","../chunks/DngRZTwo.js","../chunks/Bew31VOg.js","../chunks/zt9hmg4X.js","../chunks/BbhZG17W.js","../chunks/DUZi1B8N.js","../chunks/Dr_bhyBn.js","../chunks/B-yQpXHS.js","../chunks/DmEsXEQB.js","../assets/0.CH63xIC0.css","../nodes/1.DRopMp8H.js","../chunks/dR5TMuCX.js","../nodes/2.CsdNgH7Y.js","../nodes/3.DD49Kzda.js","../nodes/4.DjYrYj6K.js","../chunks/B9t3YtL9.js","../chunks/BcuCGYSa.js","../nodes/5.CzxPa_Z5.js","../chunks/Dwpy08gq.js","../nodes/6.eFd2PZKr.js","../chunks/DNwVrE-V.js","../chunks/Dli8az1I.js","../nodes/7.B8i7WFBk.js","../nodes/8.yF23YJzi.js","../nodes/9.DHKRJT48.js","../nodes/10.d6KMeS24.js","../nodes/11.BQP2Ra5z.js"])))=>i.map(i=>d[i]); -var Z=r=>{throw TypeError(r)};var z=(r,t,e)=>t.has(r)||Z("Cannot "+e);var m=(r,t,e)=>(z(r,t,"read from private field"),e?e.call(r):t.get(r)),G=(r,t,e)=>t.has(r)?Z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),H=(r,t,e,n)=>(z(r,t,"write to private field"),n?n.call(r,e):t.set(r,e),e);import{M as Q,V as ut,b as lt,E as mt,W as _t,Z as dt,_ as ft,$,X as ht,a5 as vt,h as F,L as gt,g as v,b7 as Et,K as yt,J as pt,p as Pt,a9 as Rt,aa as bt,al as Ot,f as L,e as At,a as Tt,s as J,d as Lt,r as wt,t as kt,u as x}from"../chunks/DEYVqDYQ.js";import{h as Dt,m as It,u as Vt,s as xt}from"../chunks/ZM2C7QQX.js";import"../chunks/Bzak7iHL.js";import{o as St}from"../chunks/BycUxjt3.js";import{i as B}from"../chunks/CpubbTHs.js";import{a as y,c as D,f as et,t as jt}from"../chunks/D5-kFxsM.js";import{B as Ct}from"../chunks/Cc4zGfaP.js";import{b as S}from"../chunks/BbhZG17W.js";import{p as q}from"../chunks/Dli8az1I.js";function j(r,t,e){var n;Q&&(n=vt,ut());var o=new Ct(r);lt(()=>{var l=t()??null;if(Q){var s=_t(n),a=s===ht,i=l!==null;if(a!==i){var P=dt();ft(P),o.anchor=P,$(!1),o.ensure(l,l&&(c=>e(c,l))),$(!0);return}}o.ensure(l,l&&(c=>e(c,l)))},mt)}function Bt(r){return class extends qt{constructor(t){super({component:r,...t})}}}var p,d;class qt{constructor(t){G(this,p);G(this,d);var l;var e=new Map,n=(s,a)=>{var i=pt(a,!1,!1);return e.set(s,i),i};const o=new Proxy({...t.props||{},$$events:{}},{get(s,a){return v(e.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===gt?!0:(v(e.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,i){return F(e.get(a)??n(a,i),i),Reflect.set(s,a,i)}});H(this,d,(t.hydrate?Dt:It)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&Et(),H(this,p,o.$$events);for(const s of Object.keys(m(this,d)))s==="$set"||s==="$destroy"||s==="$on"||yt(this,s,{get(){return m(this,d)[s]},set(a){m(this,d)[s]=a},enumerable:!0});m(this,d).$set=s=>{Object.assign(o,s)},m(this,d).$destroy=()=>{Vt(m(this,d))}}$set(t){m(this,d).$set(t)}$on(t,e){m(this,p)[t]=m(this,p)[t]||[];const n=(...o)=>e.call(this,...o);return m(this,p)[t].push(n),()=>{m(this,p)[t]=m(this,p)[t].filter(o=>o!==n)}}$destroy(){m(this,d).$destroy()}}p=new WeakMap,d=new WeakMap;const Ft="modulepreload",Nt=function(r,t){return new URL(r,t).href},tt={},_=function(t,e,n){let o=Promise.resolve();if(e&&e.length>0){let s=function(c){return Promise.all(c.map(g=>Promise.resolve(g).then(R=>({status:"fulfilled",value:R}),R=>({status:"rejected",reason:R}))))};const a=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),P=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=s(e.map(c=>{if(c=Nt(c,n),c in tt)return;tt[c]=!0;const g=c.endsWith(".css"),R=g?'[rel="stylesheet"]':"";if(!!n)for(let b=a.length-1;b>=0;b--){const u=a[b];if(u.href===c&&(!g||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${R}`))return;const E=document.createElement("link");if(E.rel=g?"stylesheet":Ft,g||(E.as="script"),E.crossOrigin="",E.href=c,P&&E.setAttribute("nonce",P),document.head.appendChild(E),g)return new Promise((b,u)=>{E.addEventListener("load",b),E.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${c}`)))})}))}function l(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&l(a.reason);return t().catch(l)})},ae={};var Ut=et('
'),Wt=et(" ",1);function Yt(r,t){Pt(t,!0);let e=q(t,"components",23,()=>[]),n=q(t,"data_0",3,null),o=q(t,"data_1",3,null),l=q(t,"data_2",3,null);Rt(()=>t.stores.page.set(t.page)),bt(()=>{t.stores,t.page,t.constructors,e(),t.form,n(),o(),l(),t.stores.page.notify()});let s=J(!1),a=J(!1),i=J(null);St(()=>{const u=t.stores.page.subscribe(()=>{v(s)&&(F(a,!0),Ot().then(()=>{F(i,document.title||"untitled page",!0)}))});return F(s,!0),u});const P=x(()=>t.constructors[2]);var c=Wt(),g=L(c);{var R=u=>{const O=x(()=>t.constructors[0]);var A=D(),I=L(A);j(I,()=>v(O),(T,w)=>{S(w(T,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(f,Ht)=>{var M=D(),at=L(M);{var st=k=>{const N=x(()=>t.constructors[1]);var V=D(),U=L(V);j(U,()=>v(N),(W,Y)=>{S(Y(W,{get data(){return o()},get form(){return t.form},get params(){return t.page.params},children:(h,Jt)=>{var X=D(),ot=L(X);j(ot,()=>v(P),(it,ct)=>{S(ct(it,{get data(){return l()},get form(){return t.form},get params(){return t.page.params}}),C=>e()[2]=C,()=>{var C;return(C=e())==null?void 0:C[2]})}),y(h,X)},$$slots:{default:!0}}),h=>e()[1]=h,()=>{var h;return(h=e())==null?void 0:h[1]})}),y(k,V)},nt=k=>{const N=x(()=>t.constructors[1]);var V=D(),U=L(V);j(U,()=>v(N),(W,Y)=>{S(Y(W,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),h=>e()[1]=h,()=>{var h;return(h=e())==null?void 0:h[1]})}),y(k,V)};B(at,k=>{t.constructors[2]?k(st):k(nt,!1)})}y(f,M)},$$slots:{default:!0}}),f=>e()[0]=f,()=>{var f;return(f=e())==null?void 0:f[0]})}),y(u,A)},K=u=>{const O=x(()=>t.constructors[0]);var A=D(),I=L(A);j(I,()=>v(O),(T,w)=>{S(w(T,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),f=>e()[0]=f,()=>{var f;return(f=e())==null?void 0:f[0]})}),y(u,A)};B(g,u=>{t.constructors[1]?u(R):u(K,!1)})}var E=At(g,2);{var b=u=>{var O=Ut(),A=Lt(O);{var I=T=>{var w=jt();kt(()=>xt(w,v(i))),y(T,w)};B(A,T=>{v(a)&&T(I)})}wt(O),y(u,O)};B(E,u=>{v(s)&&u(b)})}y(r,c),Tt()}const se=Bt(Yt),ne=[()=>_(()=>import("../nodes/0.DZQ2ZPtV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),()=>_(()=>import("../nodes/1.DRopMp8H.js"),__vite__mapDeps([18,1,19,3,4,5,15,14,2]),import.meta.url),()=>_(()=>import("../nodes/2.CsdNgH7Y.js"),__vite__mapDeps([20,1,3,5,9,7]),import.meta.url),()=>_(()=>import("../nodes/3.DD49Kzda.js"),__vite__mapDeps([21,1,19,3,2,15,14]),import.meta.url),()=>_(()=>import("../nodes/4.DjYrYj6K.js"),__vite__mapDeps([22,1,3,4,5,6,7,8,10,11,23,24]),import.meta.url),()=>_(()=>import("../nodes/5.CzxPa_Z5.js"),__vite__mapDeps([25,1,19,3,4,5,6,7,8,23,13,14,16,26]),import.meta.url),()=>_(()=>import("../nodes/6.eFd2PZKr.js"),__vite__mapDeps([27,1,2,3,4,5,6,7,8,10,11,23,28,13,14,12,29,26,24,16]),import.meta.url),()=>_(()=>import("../nodes/7.B8i7WFBk.js"),__vite__mapDeps([30,1,2,3,4,5,6,7,8,11,24]),import.meta.url),()=>_(()=>import("../nodes/8.yF23YJzi.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,8,10,11,23,28,24,26]),import.meta.url),()=>_(()=>import("../nodes/9.DHKRJT48.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,8,11,23,13,14,24,16]),import.meta.url),()=>_(()=>import("../nodes/10.d6KMeS24.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,23,24]),import.meta.url),()=>_(()=>import("../nodes/11.BQP2Ra5z.js"),__vite__mapDeps([34,1,2,3,4,5,6,7,8,23,28,24,26]),import.meta.url)],oe=[],ie={"/":[3],"/(app)/explore":[4,[2]],"/(app)/feed":[5,[2]],"/(app)/graph":[6,[2]],"/(app)/intentions":[7,[2]],"/(app)/memories":[8,[2]],"/(app)/settings":[9,[2]],"/(app)/stats":[10,[2]],"/(app)/timeline":[11,[2]]},rt={handleError:(({error:r})=>{console.error(r)}),reroute:(()=>{}),transport:{}},Gt=Object.fromEntries(Object.entries(rt.transport).map(([r,t])=>[r,t.decode])),ce=Object.fromEntries(Object.entries(rt.transport).map(([r,t])=>[r,t.encode])),ue=!1,le=(r,t)=>Gt[r](t);export{le as decode,Gt as decoders,ie as dictionary,ce as encoders,ue as hash,rt as hooks,ae as matchers,ne as nodes,se as root,oe as server_loads}; diff --git a/apps/dashboard/build/_app/immutable/entry/app.R5Nt9GQF.js.br b/apps/dashboard/build/_app/immutable/entry/app.R5Nt9GQF.js.br deleted file mode 100644 index 482ad70..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/app.R5Nt9GQF.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.R5Nt9GQF.js.gz b/apps/dashboard/build/_app/immutable/entry/app.R5Nt9GQF.js.gz deleted file mode 100644 index 8b0c348..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/app.R5Nt9GQF.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/start.DD7PRmnO.js b/apps/dashboard/build/_app/immutable/entry/start.DD7PRmnO.js deleted file mode 100644 index 8e91e31..0000000 --- a/apps/dashboard/build/_app/immutable/entry/start.DD7PRmnO.js +++ /dev/null @@ -1 +0,0 @@ -import{l as o,a as r}from"../chunks/B-yQpXHS.js";export{o as load_css,r as start}; diff --git a/apps/dashboard/build/_app/immutable/entry/start.DD7PRmnO.js.br b/apps/dashboard/build/_app/immutable/entry/start.DD7PRmnO.js.br deleted file mode 100644 index 276f619..0000000 --- a/apps/dashboard/build/_app/immutable/entry/start.DD7PRmnO.js.br +++ /dev/null @@ -1,2 +0,0 @@ - )import{l as o,a as r}from"../chunks/B-yQpXHS.js";export{o as load_css,r as start}; - \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/entry/start.DD7PRmnO.js.gz b/apps/dashboard/build/_app/immutable/entry/start.DD7PRmnO.js.gz deleted file mode 100644 index 37614ab..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/start.DD7PRmnO.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/start.DK-jGlmm.js b/apps/dashboard/build/_app/immutable/entry/start.DK-jGlmm.js new file mode 100644 index 0000000..c20b2a7 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/entry/start.DK-jGlmm.js @@ -0,0 +1 @@ +import{l as o,a as r}from"../chunks/C9fAJV5Y.js";export{o as load_css,r as start}; diff --git a/apps/dashboard/build/_app/immutable/entry/start.DK-jGlmm.js.br b/apps/dashboard/build/_app/immutable/entry/start.DK-jGlmm.js.br new file mode 100644 index 0000000..04a5603 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/entry/start.DK-jGlmm.js.br @@ -0,0 +1,2 @@ + )import{l as o,a as r}from"../chunks/C9fAJV5Y.js";export{o as load_css,r as start}; + \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/entry/start.DK-jGlmm.js.gz b/apps/dashboard/build/_app/immutable/entry/start.DK-jGlmm.js.gz new file mode 100644 index 0000000..d246e0c Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/start.DK-jGlmm.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.DZQ2ZPtV.js b/apps/dashboard/build/_app/immutable/nodes/0.DZQ2ZPtV.js deleted file mode 100644 index bba6cf0..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/0.DZQ2ZPtV.js +++ /dev/null @@ -1,3 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as Ee}from"../chunks/BycUxjt3.js";import{p as Me,f as Ke,t as K,a as Le,h as d,g as s,d as a,e as i,r as t,s as oe,u as z,G as Te}from"../chunks/DEYVqDYQ.js";import{d as qe,a as h,s as u}from"../chunks/ZM2C7QQX.js";import{i as ie}from"../chunks/CpubbTHs.js";import{e as H,i as V}from"../chunks/CiJhRXcr.js";import{a as _,f as y}from"../chunks/D5-kFxsM.js";import{s as Fe}from"../chunks/DngRZTwo.js";import{s as le,r as Se,b as Ae}from"../chunks/Bew31VOg.js";import{s as W}from"../chunks/zt9hmg4X.js";import{b as Ne}from"../chunks/BbhZG17W.js";import{s as De,a as L}from"../chunks/DUZi1B8N.js";import{s as Ge,g as de,b as O}from"../chunks/B-yQpXHS.js";import{w as ce,a as je,i as Re,m as ze}from"../chunks/DmEsXEQB.js";const He=()=>{const m=Ge;return{page:{subscribe:m.page.subscribe},navigating:{subscribe:m.navigating.subscribe},updated:m.updated}},Ve={subscribe(m){return He().page.subscribe(m)}};var We=y(' '),Oe=y(' '),Qe=y(''),Be=y('
No matches
'),Je=y('
esc
'),Ue=y('
',1);function dt(m,T){Me(T,!0);const Q=()=>L(Ve,"$page",k),B=()=>L(Re,"$isConnected",k),pe=()=>L(ze,"$memoryCount",k),ve=()=>L(je,"$avgRetention",k),[k,ue]=De();let c=oe(!1),x=oe(""),p;Ee(()=>{ce.connect();function r(e){if((e.metaKey||e.ctrlKey)&&e.key==="k"){e.preventDefault(),d(c,!s(c)),d(x,""),s(c)&&requestAnimationFrame(()=>p==null?void 0:p.focus());return}if(e.key==="Escape"&&s(c)){d(c,!1);return}if(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)return;if(e.key==="/"){e.preventDefault();const l=document.querySelector('input[type="text"]');l==null||l.focus();return}const n={g:"/graph",m:"/memories",t:"/timeline",f:"/feed",e:"/explore",i:"/intentions",s:"/stats"}[e.key.toLowerCase()];n&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),de(`${O}${n}`))}return window.addEventListener("keydown",r),()=>{ce.disconnect(),window.removeEventListener("keydown",r)}});const $=[{href:"/graph",label:"Graph",icon:"◎",shortcut:"G"},{href:"/memories",label:"Memories",icon:"◈",shortcut:"M"},{href:"/timeline",label:"Timeline",icon:"◷",shortcut:"T"},{href:"/feed",label:"Feed",icon:"◉",shortcut:"F"},{href:"/explore",label:"Explore",icon:"◬",shortcut:"E"},{href:"/intentions",label:"Intentions",icon:"◇",shortcut:"I"},{href:"/stats",label:"Stats",icon:"◫",shortcut:"S"},{href:"/settings",label:"Settings",icon:"⚙",shortcut:","}],fe=$.slice(0,5);function J(r,e){const v=e.startsWith(O)?e.slice(O.length)||"/":e;return r==="/graph"?v==="/"||v==="/graph":v.startsWith(r)}let C=z(()=>s(x)?$.filter(r=>r.label.toLowerCase().includes(s(x).toLowerCase())):$);function U(r){d(c,!1),d(x,""),de(r)}var X=Ue(),q=Ke(X),F=a(q),S=i(a(F),2);H(S,21,()=>$,V,(r,e)=>{const v=z(()=>J(s(e).href,Q().url.pathname));var n=We(),l=a(n),b=a(l,!0);t(l);var f=i(l,2),w=a(f,!0);t(f);var E=i(f,2),o=a(E,!0);t(E),t(n),K(()=>{le(n,"href",s(e).href),W(n,1,`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all duration-200 text-sm - ${s(v)?"bg-synapse/15 text-synapse-glow border border-synapse/30 shadow-[0_0_12px_rgba(99,102,241,0.15)]":"text-dim hover:text-text hover:bg-surface border border-transparent"}`),u(b,s(e).icon),u(w,s(e).label),u(o,s(e).shortcut)}),_(r,n)}),t(S);var A=i(S,2),xe=a(A);t(A);var Y=i(A,2),N=a(Y),Z=a(N),P=i(Z,2),me=a(P,!0);t(P),t(N);var I=i(N,2),D=a(I),be=a(D);t(D);var ee=i(D,2),ge=a(ee);t(ee),t(I),t(Y),t(F);var G=i(F,2),te=a(G),he=a(te);Fe(he,()=>T.children),t(te),t(G);var ae=i(G,2),se=a(ae),re=a(se);H(re,17,()=>fe,V,(r,e)=>{const v=z(()=>J(s(e).href,Q().url.pathname));var n=Oe(),l=a(n),b=a(l,!0);t(l);var f=i(l,2),w=a(f,!0);t(f),t(n),K(()=>{le(n,"href",s(e).href),W(n,1,`flex flex-col items-center gap-0.5 px-3 py-2 rounded-lg transition-all min-w-[3.5rem] - ${s(v)?"text-synapse-glow":"text-muted"}`),u(b,s(e).icon),u(w,s(e).label)}),_(r,n)});var _e=i(re,2);t(se),t(ae),t(q);var ye=i(q,2);{var we=r=>{var e=Je(),v=a(e),n=a(v),l=i(a(n),2);Se(l),Ne(l,o=>p=o,()=>p),Te(2),t(n);var b=i(n,2),f=a(b);H(f,17,()=>s(C),V,(o,g)=>{var M=Qe(),j=a(M),ke=a(j,!0);t(j);var R=i(j,2),$e=a(R,!0);t(R);var ne=i(R,2),Ce=a(ne,!0);t(ne),t(M),K(()=>{u(ke,s(g).icon),u($e,s(g).label),u(Ce,s(g).shortcut)}),h("click",M,()=>U(s(g).href)),_(o,M)});var w=i(f,2);{var E=o=>{var g=Be();_(o,g)};ie(w,o=>{s(C).length===0&&o(E)})}t(b),t(v),t(e),h("keydown",e,o=>{o.key==="Escape"&&d(c,!1)}),h("click",e,o=>{o.target===o.currentTarget&&d(c,!1)}),h("keydown",l,o=>{o.key==="Enter"&&s(C).length>0&&U(s(C)[0].href)}),Ae(l,()=>s(x),o=>d(x,o)),_(r,e)};ie(ye,r=>{s(c)&&r(we)})}K(r=>{W(Z,1,`w-2 h-2 rounded-full ${B()?"bg-recall animate-pulse-glow":"bg-decay"}`),u(me,B()?"Connected":"Offline"),u(be,`${pe()??""} memories`),u(ge,`${r??""}% retention`)},[()=>(ve()*100).toFixed(0)]),h("click",xe,()=>{d(c,!0),d(x,""),requestAnimationFrame(()=>p==null?void 0:p.focus())}),h("click",_e,()=>{d(c,!0),d(x,""),requestAnimationFrame(()=>p==null?void 0:p.focus())}),_(m,X),Le(),ue()}qe(["click","keydown"]);export{dt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/0.DZQ2ZPtV.js.br b/apps/dashboard/build/_app/immutable/nodes/0.DZQ2ZPtV.js.br deleted file mode 100644 index 37ab153..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/0.DZQ2ZPtV.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.DZQ2ZPtV.js.gz b/apps/dashboard/build/_app/immutable/nodes/0.DZQ2ZPtV.js.gz deleted file mode 100644 index 4eccb21..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/0.DZQ2ZPtV.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.dCbzyxTz.js b/apps/dashboard/build/_app/immutable/nodes/0.dCbzyxTz.js new file mode 100644 index 0000000..7d53e4c --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/0.dCbzyxTz.js @@ -0,0 +1,3 @@ +import"../chunks/Bzak7iHL.js";import{o as Ee}from"../chunks/CkyfbJUz.js";import{p as Me,d as o,f as Ke,t as K,a as Le,h as d,g as t,e as s,r as a,s as z,u as R,G as Te}from"../chunks/C9Z4nxhR.js";import{d as qe,a as h,s as v}from"../chunks/DP9qWekZ.js";import{i as ie}from"../chunks/C2oj68pw.js";import{e as H,i as V}from"../chunks/kH-DTQyy.js";import{a as g,f as _}from"../chunks/DPfxVJHQ.js";import{s as Fe}from"../chunks/D00YwZ1M.js";import{s as le,r as Se}from"../chunks/ZesQ8l8p.js";import{s as W}from"../chunks/Co2v30Gm.js";import{b as Ae}from"../chunks/P9ZHwQBL.js";import{b as Ne}from"../chunks/CR6HhlME.js";import{s as De,a as L}from"../chunks/DWr9YED7.js";import{s as Ge,g as de,b as O}from"../chunks/C9fAJV5Y.js";import{w as ce,a as Ie,i as je,m as ze}from"../chunks/BmeMLq0p.js";const Re=()=>{const f=Ge;return{page:{subscribe:f.page.subscribe},navigating:{subscribe:f.navigating.subscribe},updated:f.updated}},He={subscribe(f){return Re().page.subscribe(f)}};var Ve=_(' '),We=_(' '),Oe=_(''),Qe=_('
No matches
'),Be=_('
esc
'),Je=_('
',1);function ct(f,T){Me(T,!0);const Q=()=>L(He,"$page",k),B=()=>L(je,"$isConnected",k),pe=()=>L(ze,"$memoryCount",k),ve=()=>L(Ie,"$avgRetention",k),[k,me]=De();let c=z(!1),u=z(""),y=z(void 0);Ee(()=>{ce.connect();function r(e){if((e.metaKey||e.ctrlKey)&&e.key==="k"){e.preventDefault(),d(c,!t(c)),d(u,""),t(c)&&requestAnimationFrame(()=>{var n;return(n=t(y))==null?void 0:n.focus()});return}if(e.key==="Escape"&&t(c)){d(c,!1);return}if(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)return;if(e.key==="/"){e.preventDefault();const n=document.querySelector('input[type="text"]');n==null||n.focus();return}const i={g:"/graph",m:"/memories",t:"/timeline",f:"/feed",e:"/explore",i:"/intentions",s:"/stats"}[e.key.toLowerCase()];i&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),de(`${O}${i}`))}return window.addEventListener("keydown",r),()=>{ce.disconnect(),window.removeEventListener("keydown",r)}});const $=[{href:"/graph",label:"Graph",icon:"◎",shortcut:"G"},{href:"/memories",label:"Memories",icon:"◈",shortcut:"M"},{href:"/timeline",label:"Timeline",icon:"◷",shortcut:"T"},{href:"/feed",label:"Feed",icon:"◉",shortcut:"F"},{href:"/explore",label:"Explore",icon:"◬",shortcut:"E"},{href:"/intentions",label:"Intentions",icon:"◇",shortcut:"I"},{href:"/stats",label:"Stats",icon:"◫",shortcut:"S"},{href:"/settings",label:"Settings",icon:"⚙",shortcut:","}],ue=$.slice(0,5);function J(r,e){const p=e.startsWith(O)?e.slice(O.length)||"/":e;return r==="/graph"?p==="/"||p==="/graph":p.startsWith(r)}let C=R(()=>t(u)?$.filter(r=>r.label.toLowerCase().includes(t(u).toLowerCase())):$);function U(r){d(c,!1),d(u,""),de(r)}var X=Je(),q=o(Ke(X),6),F=s(q),S=o(s(F),2);H(S,21,()=>$,V,(r,e)=>{const p=R(()=>J(t(e).href,Q().url.pathname));var i=Ve(),n=s(i),x=s(n,!0);a(n);var m=o(n,2),w=s(m,!0);a(m);var E=o(m,2),l=s(E,!0);a(E),a(i),K(()=>{le(i,"href",t(e).href),W(i,1,`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all duration-200 text-sm + ${t(p)?"bg-synapse/15 text-synapse-glow border border-synapse/30 shadow-[0_0_12px_rgba(99,102,241,0.15)] nav-active-border":"text-dim hover:text-text hover:bg-white/[0.03] border border-transparent"}`),v(x,t(e).icon),v(w,t(e).label),v(l,t(e).shortcut)}),g(r,i)}),a(S);var A=o(S,2),fe=s(A);a(A);var Y=o(A,2),N=s(Y),Z=s(N),P=o(Z,2),xe=s(P,!0);a(P),a(N);var ee=o(N,2),D=s(ee),be=s(D);a(D);var te=o(D,2),he=s(te);a(te),a(ee),a(Y),a(F);var G=o(F,2),ae=s(G),ge=s(ae);Fe(ge,()=>T.children),a(ae),a(G);var se=o(G,2),re=s(se),ne=s(re);H(ne,17,()=>ue,V,(r,e)=>{const p=R(()=>J(t(e).href,Q().url.pathname));var i=We(),n=s(i),x=s(n,!0);a(n);var m=o(n,2),w=s(m,!0);a(m),a(i),K(()=>{le(i,"href",t(e).href),W(i,1,`flex flex-col items-center gap-0.5 px-3 py-2 rounded-lg transition-all min-w-[3.5rem] + ${t(p)?"text-synapse-glow":"text-muted"}`),v(x,t(e).icon),v(w,t(e).label)}),g(r,i)});var _e=o(ne,2);a(re),a(se),a(q);var ye=o(q,2);{var we=r=>{var e=Be(),p=s(e),i=s(p),n=o(s(i),2);Se(n),Ne(n,l=>d(y,l),()=>t(y)),Te(2),a(i);var x=o(i,2),m=s(x);H(m,17,()=>t(C),V,(l,b)=>{var M=Oe(),I=s(M),ke=s(I,!0);a(I);var j=o(I,2),$e=s(j,!0);a(j);var oe=o(j,2),Ce=s(oe,!0);a(oe),a(M),K(()=>{v(ke,t(b).icon),v($e,t(b).label),v(Ce,t(b).shortcut)}),h("click",M,()=>U(t(b).href)),g(l,M)});var w=o(m,2);{var E=l=>{var b=Qe();g(l,b)};ie(w,l=>{t(C).length===0&&l(E)})}a(x),a(p),a(e),h("keydown",e,l=>{l.key==="Escape"&&d(c,!1)}),h("click",e,l=>{l.target===l.currentTarget&&d(c,!1)}),h("keydown",n,l=>{l.key==="Enter"&&t(C).length>0&&U(t(C)[0].href)}),Ae(n,()=>t(u),l=>d(u,l)),g(r,e)};ie(ye,r=>{t(c)&&r(we)})}K(r=>{W(Z,1,`w-2 h-2 rounded-full ${B()?"bg-recall animate-pulse-glow":"bg-decay"}`),v(xe,B()?"Connected":"Offline"),v(be,`${pe()??""} memories`),v(he,`${r??""}% retention`)},[()=>(ve()*100).toFixed(0)]),h("click",fe,()=>{d(c,!0),d(u,""),requestAnimationFrame(()=>{var r;return(r=t(y))==null?void 0:r.focus()})}),h("click",_e,()=>{d(c,!0),d(u,""),requestAnimationFrame(()=>{var r;return(r=t(y))==null?void 0:r.focus()})}),g(f,X),Le(),me()}qe(["click","keydown"]);export{ct as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/0.dCbzyxTz.js.br b/apps/dashboard/build/_app/immutable/nodes/0.dCbzyxTz.js.br new file mode 100644 index 0000000..ca1045d Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/0.dCbzyxTz.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.dCbzyxTz.js.gz b/apps/dashboard/build/_app/immutable/nodes/0.dCbzyxTz.js.gz new file mode 100644 index 0000000..07d843e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/0.dCbzyxTz.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/1.DRopMp8H.js b/apps/dashboard/build/_app/immutable/nodes/1.DRopMp8H.js deleted file mode 100644 index 8c10d73..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/1.DRopMp8H.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{i as h}from"../chunks/dR5TMuCX.js";import{p as g,f as d,t as l,a as v,d as s,r as o,e as _}from"../chunks/DEYVqDYQ.js";import{s as p}from"../chunks/ZM2C7QQX.js";import{a as x,f as $}from"../chunks/D5-kFxsM.js";import{s as k,p as m}from"../chunks/B-yQpXHS.js";const b={get error(){return m.error},get status(){return m.status}};k.updated.check;const i=b;var E=$("

",1);function B(f,n){g(n,!1),h();var t=E(),r=d(t),c=s(r,!0);o(r);var a=_(r,2),u=s(a,!0);o(a),l(()=>{var e;p(c,i.status),p(u,(e=i.error)==null?void 0:e.message)}),x(f,t),v()}export{B as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/1.DRopMp8H.js.br b/apps/dashboard/build/_app/immutable/nodes/1.DRopMp8H.js.br deleted file mode 100644 index 2f98f21..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/1.DRopMp8H.js.br +++ /dev/null @@ -1,3 +0,0 @@ -f`qcUvTyUD > UÑz'Z,kQr1&%z}[[O$בf隭͕Nv!U:7mȗR覤{gEہn2pX @a -"Qb\fB֐A޳=->߷6PVҎO<,v -˿ZܿU(791QkZc:ݫ `q"随c.5z#-"IY! 16t0!u@C'G/R񬙉D}ÈtY:aIᴋ2g}fx`\۰h& \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/nodes/1.DRopMp8H.js.gz b/apps/dashboard/build/_app/immutable/nodes/1.DRopMp8H.js.gz deleted file mode 100644 index 41f8523..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/1.DRopMp8H.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/1.DaR0oFWP.js b/apps/dashboard/build/_app/immutable/nodes/1.DaR0oFWP.js new file mode 100644 index 0000000..0d438e2 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/1.DaR0oFWP.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{i as h}from"../chunks/_Va07L2l.js";import{p as g,f as d,t as l,a as v,d as _,e as s,r as o}from"../chunks/C9Z4nxhR.js";import{s as p}from"../chunks/DP9qWekZ.js";import{a as x,f as $}from"../chunks/DPfxVJHQ.js";import{s as k,p as m}from"../chunks/C9fAJV5Y.js";const b={get error(){return m.error},get status(){return m.status}};k.updated.check;const i=b;var E=$("

",1);function B(f,n){g(n,!1),h();var t=E(),r=d(t),c=s(r,!0);o(r);var a=_(r,2),u=s(a,!0);o(a),l(()=>{var e;p(c,i.status),p(u,(e=i.error)==null?void 0:e.message)}),x(f,t),v()}export{B as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/1.DaR0oFWP.js.br b/apps/dashboard/build/_app/immutable/nodes/1.DaR0oFWP.js.br new file mode 100644 index 0000000..b40a061 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/1.DaR0oFWP.js.br @@ -0,0 +1 @@ +f`.ot2%E[rW@~ w<јo]8Ԛlsnm= _G^V?,kn_hw="^zd>H S 6 @D'qHD~C/7$+fc^?X80ԃ|-JSoUVʍ0vCDɪ.aV/T̞{eEq ߀OѬѐ9!bK!鐕B.C$B !+?7H  |* }_|Hn#WJglrP)FJ%7,qnX \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/nodes/1.DaR0oFWP.js.gz b/apps/dashboard/build/_app/immutable/nodes/1.DaR0oFWP.js.gz new file mode 100644 index 0000000..270144a Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/1.DaR0oFWP.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js b/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js new file mode 100644 index 0000000..2ac1492 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{o as Ft}from"../chunks/CkyfbJUz.js";import{p as $t,a as Ct,d as s,e,j as W,h as y,g as t,r as a,s as E,f as dt,G as P,t as B,u as G}from"../chunks/C9Z4nxhR.js";import{d as Rt,s as i,a as At}from"../chunks/DP9qWekZ.js";import{i as X}from"../chunks/C2oj68pw.js";import{e as O,i as U}from"../chunks/kH-DTQyy.js";import{a as p,f as u}from"../chunks/DPfxVJHQ.js";import{s as A}from"../chunks/BkopTN9z.js";import{a as w}from"../chunks/BcuCGYSa.js";var Dt=u('
'),Mt=u('
'),kt=u('
'),Bt=u('
'),St=u('
'),Tt=u('

'),jt=u('

Retention Distribution

Memory Types

',1),Et=u('
Total Memories
Avg Retention
Due for Review
Embedding Coverage
',1),Pt=u('

System Stats

');function Lt(ot,vt){$t(vt,!0);let n=E(null),m=E(null),l=E(null),Y=E(!0);Ft(async()=>{try{await(async d=>{var r=W(d,3);y(n,r[0],!0),y(m,r[1],!0),y(l,r[2],!0)})(await Promise.all([w.stats(),w.health(),w.retentionDistribution()]))}catch{}finally{y(Y,!1)}});function q(d){return{healthy:"#10b981",degraded:"#f59e0b",critical:"#ef4444",empty:"#6b7280"}[d]||"#6b7280"}async function nt(){try{await w.consolidate(),await(async d=>{var r=W(d,3);y(n,r[0],!0),y(m,r[1],!0),y(l,r[2],!0)})(await Promise.all([w.stats(),w.health(),w.retentionDistribution()]))}catch{}}var z=Pt(),lt=s(e(z),2);{var ct=d=>{var r=Mt();O(r,20,()=>Array(8),U,(F,H)=>{var $=Dt();p(F,$)}),a(r),p(d,r)},xt=d=>{var r=Et(),F=dt(r),H=e(F),$=s(H,2),pt=e($,!0);a($);var Z=s($,2),ut=e(Z);a(Z),a(F);var I=s(F,2),J=e(I),tt=e(J),mt=e(tt,!0);a(tt),P(2),a(J);var K=s(J,2),L=e(K),gt=e(L);a(L),P(2),a(K);var N=s(K,2),at=e(N),_t=e(at,!0);a(at),P(2),a(N);var et=s(N,2),st=e(et),ft=e(st);a(st),P(2),a(et),a(I);var rt=s(I,2);{var bt=D=>{var S=jt(),M=dt(S),T=s(e(M),2);O(T,21,()=>t(l).distribution,U,(g,c,v)=>{const C=G(()=>Math.max(...t(l).distribution.map(V=>V.count),1)),R=G(()=>t(c).count/t(C)*100),_=G(()=>v<3?"#ef4444":v<5?"#f59e0b":v<7?"#10b981":"#6366f1");var x=kt(),o=e(x),f=e(o,!0);a(o);var b=s(o,2),h=s(b,2),Q=e(h,!0);a(h),a(x),B(()=>{i(f,t(c).count),A(b,`height: ${t(R)??""}%; background: ${t(_)??""}; opacity: 0.7; min-height: 2px`),i(Q,t(c).range)}),p(g,x)}),a(T),a(M);var k=s(M,2),j=s(e(k),2);O(j,21,()=>Object.entries(t(l).byType),U,(g,c)=>{var v=G(()=>W(t(c),2));let C=()=>t(v)[0],R=()=>t(v)[1];var _=Bt(),x=e(_),o=s(x,2),f=e(o,!0);a(o);var b=s(o,2),h=e(b,!0);a(b),a(_),B(()=>{A(x,`background: ${({fact:"#00A8FF",concept:"#9D00FF",event:"#FFB800",person:"#00FFD1",note:"#8B95A5",pattern:"#FF3CAC",decision:"#FF4757"}[C()]||"#8B95A5")??""}`),i(f,C()),i(h,R())}),p(g,_)}),a(j),a(k);var yt=s(k,2);{var wt=g=>{var c=Tt(),v=e(c),C=e(v);a(v);var R=s(v,2);O(R,21,()=>t(l).endangered.slice(0,20),U,(_,x)=>{var o=St(),f=e(o),b=e(f);a(f);var h=s(f,2),Q=e(h,!0);a(h),a(o),B(V=>{i(b,`${V??""}%`),i(Q,t(x).content)},[()=>(t(x).retentionStrength*100).toFixed(0)]),p(_,o)}),a(R),a(c),B(()=>i(C,`Endangered Memories (${t(l).endangered.length??""})`)),p(g,c)};X(yt,g=>{t(l).endangered.length>0&&g(wt)})}p(D,S)};X(rt,D=>{t(l)&&D(bt)})}var it=s(rt,2),ht=e(it);a(it),B((D,S,M,T,k,j)=>{A(F,`border-color: ${D??""}30`),A(H,`background: ${S??""}`),A($,`color: ${M??""}`),i(pt,T),i(ut,`v${t(m).version??""}`),i(mt,t(n).totalMemories),A(L,`color: ${t(n).averageRetention>.7?"#10b981":t(n).averageRetention>.4?"#f59e0b":"#ef4444"}`),i(gt,`${k??""}%`),i(_t,t(n).dueForReview),i(ft,`${j??""}%`)},[()=>q(t(m).status),()=>q(t(m).status),()=>q(t(m).status),()=>t(m).status.toUpperCase(),()=>(t(n).averageRetention*100).toFixed(1),()=>t(n).embeddingCoverage.toFixed(0)]),At("click",ht,nt),p(d,r)};X(lt,d=>{t(Y)?d(ct):t(n)&&t(m)&&d(xt,1)})}a(z),p(ot,z),Ct()}Rt(["click"]);export{Lt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.br b/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.br new file mode 100644 index 0000000..dceb4a1 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.gz b/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.gz new file mode 100644 index 0000000..ba54cb3 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.d6KMeS24.js b/apps/dashboard/build/_app/immutable/nodes/10.d6KMeS24.js deleted file mode 100644 index 156b150..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/10.d6KMeS24.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as $t}from"../chunks/BycUxjt3.js";import{p as Rt,a as Ct,j as X,h as y,e as r,d as a,g as t,r as e,s as G,f as ot,G as O,t as T,u as U}from"../chunks/DEYVqDYQ.js";import{d as Mt,s as i,a as kt}from"../chunks/ZM2C7QQX.js";import{i as Y}from"../chunks/CpubbTHs.js";import{e as q,i as z}from"../chunks/CiJhRXcr.js";import{a as g,f as b}from"../chunks/D5-kFxsM.js";import{s as k}from"../chunks/B9t3YtL9.js";import{a as w}from"../chunks/BcuCGYSa.js";var Dt=b('
'),Ft=b('
'),St=b('
'),Tt=b('
'),jt=b('
'),At=b('

'),Et=b('

Retention Distribution

Memory Types

',1),Pt=b('
Total Memories
Avg Retention
Due for Review
Embedding Coverage
',1),Gt=b('

System Stats

');function Lt(vt,nt){Rt(nt,!0);let n=G(null),l=G(null),c=G(null),Z=G(!0);$t(async()=>{try{await(async d=>{var s=X(d,3);y(n,s[0],!0),y(l,s[1],!0),y(c,s[2],!0)})(await Promise.all([w.stats(),w.health(),w.retentionDistribution()]))}catch{}finally{y(Z,!1)}});function j(d){return{healthy:"#10b981",degraded:"#f59e0b",critical:"#ef4444",empty:"#6b7280"}[d]||"#6b7280"}async function lt(){try{await w.consolidate(),await(async d=>{var s=X(d,3);y(n,s[0],!0),y(l,s[1],!0),y(c,s[2],!0)})(await Promise.all([w.stats(),w.health(),w.retentionDistribution()]))}catch{}}var B=Gt(),ct=r(a(B),2);{var ut=d=>{var s=Ft();q(s,20,()=>Array(8),z,($,H)=>{var R=Dt();g($,R)}),e(s),g(d,s)},xt=d=>{var s=Pt(),$=ot(s),H=a($),R=r(H,2),gt=a(R,!0);e(R);var tt=r(R,2),bt=a(tt);e(tt),e($);var I=r($,2),J=a(I),et=a(J),pt=a(et,!0);e(et),O(2),e(J);var K=r(J,2),L=a(K),mt=a(L);e(L),O(2),e(K);var N=r(K,2),at=a(N),ft=a(at,!0);e(at),O(2),e(N);var rt=r(N,2),st=a(rt),_t=a(st);e(st),O(2),e(rt),e(I);var it=r(I,2);{var ht=D=>{var A=Et(),F=ot(A),E=r(a(F),2);q(E,21,()=>t(c).distribution,z,(p,u,v)=>{const C=U(()=>Math.max(...t(c).distribution.map(W=>W.count),1)),M=U(()=>t(u).count/t(C)*100),m=U(()=>v<3?"#ef4444":v<5?"#f59e0b":v<7?"#10b981":"#6366f1");var x=St(),o=a(x),f=a(o,!0);e(o);var _=r(o,2),h=r(_,2),V=a(h,!0);e(h),e(x),T(()=>{i(f,t(u).count),k(_,`height: ${t(M)??""}%; background: ${t(m)??""}; opacity: 0.7; min-height: 2px`),i(V,t(u).range)}),g(p,x)}),e(E),e(F);var S=r(F,2),P=r(a(S),2);q(P,21,()=>Object.entries(t(c).byType),z,(p,u)=>{var v=U(()=>X(t(u),2));let C=()=>t(v)[0],M=()=>t(v)[1];var m=Tt(),x=a(m),o=r(x,2),f=a(o,!0);e(o);var _=r(o,2),h=a(_,!0);e(_),e(m),T(()=>{k(x,`background: ${({fact:"#3b82f6",concept:"#8b5cf6",event:"#f59e0b",person:"#10b981",note:"#6b7280",pattern:"#ec4899",decision:"#ef4444"}[C()]||"#6b7280")??""}`),i(f,C()),i(h,M())}),g(p,m)}),e(P),e(S);var Q=r(S,2);{var wt=p=>{var u=At(),v=a(u),C=a(v);e(v);var M=r(v,2);q(M,21,()=>t(c).endangered.slice(0,20),z,(m,x)=>{var o=jt(),f=a(o),_=a(f);e(f);var h=r(f,2),V=a(h,!0);e(h),e(o),T(W=>{i(_,`${W??""}%`),i(V,t(x).content)},[()=>(t(x).retentionStrength*100).toFixed(0)]),g(m,o)}),e(M),e(u),T(()=>i(C,`Endangered Memories (${t(c).endangered.length??""})`)),g(p,u)};Y(Q,p=>{t(c).endangered.length>0&&p(wt)})}g(D,A)};Y(it,D=>{t(c)&&D(ht)})}var dt=r(it,2),yt=a(dt);e(dt),T((D,A,F,E,S,P,Q)=>{k($,`border-color: ${D??""}40; background: ${A??""}10`),k(H,`background: ${F??""}`),k(R,`color: ${E??""}`),i(gt,S),i(bt,`v${t(l).version??""}`),i(pt,t(n).totalMemories),k(L,`color: ${t(n).averageRetention>.7?"#10b981":t(n).averageRetention>.4?"#f59e0b":"#ef4444"}`),i(mt,`${P??""}%`),i(ft,t(n).dueForReview),i(_t,`${Q??""}%`)},[()=>j(t(l).status),()=>j(t(l).status),()=>j(t(l).status),()=>j(t(l).status),()=>t(l).status.toUpperCase(),()=>(t(n).averageRetention*100).toFixed(1),()=>t(n).embeddingCoverage.toFixed(0)]),kt("click",yt,lt),g(d,s)};Y(ct,d=>{t(Z)?d(ut):t(n)&&t(l)&&d(xt,1)})}e(B),g(vt,B),Ct()}Mt(["click"]);export{Lt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/10.d6KMeS24.js.br b/apps/dashboard/build/_app/immutable/nodes/10.d6KMeS24.js.br deleted file mode 100644 index 2b273b5..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/10.d6KMeS24.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.d6KMeS24.js.gz b/apps/dashboard/build/_app/immutable/nodes/10.d6KMeS24.js.gz deleted file mode 100644 index e47cc6f..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/10.d6KMeS24.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.BQP2Ra5z.js b/apps/dashboard/build/_app/immutable/nodes/11.BQP2Ra5z.js deleted file mode 100644 index c1b4740..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/11.BQP2Ra5z.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as pe}from"../chunks/BycUxjt3.js";import{p as ce,s as b,c as me,g as e,a as ue,e as r,d as a,h as c,r as t,t as g}from"../chunks/DEYVqDYQ.js";import{d as _e,a as K,s as m}from"../chunks/ZM2C7QQX.js";import{i as P}from"../chunks/CpubbTHs.js";import{e as h,i as R}from"../chunks/CiJhRXcr.js";import{a as l,f as v}from"../chunks/D5-kFxsM.js";import{s as Q}from"../chunks/B9t3YtL9.js";import{b as fe}from"../chunks/DNwVrE-V.js";import{a as xe}from"../chunks/BcuCGYSa.js";import{N as U}from"../chunks/Dwpy08gq.js";var be=v('
'),ge=v('
'),he=v('

No memories in the selected time range.

'),ye=v('
'),we=v(' '),ke=v('
'),Te=v('
'),je=v('
'),Ne=v('
'),Oe=v('

Timeline

');function Ye(V,W){ce(W,!0);let u=b(me([])),y=b(!0),w=b(14),k=b(null);pe(()=>Y());async function Y(){c(y,!0);try{const s=await xe.timeline(e(w),500);c(u,s.timeline,!0)}catch{c(u,[],!0)}finally{c(y,!1)}}var T=Oe(),j=a(T),_=r(a(j),2),N=a(_);N.value=N.__value=7;var O=r(N);O.value=O.__value=14;var S=r(O);S.value=S.__value=30;var q=r(S);q.value=q.__value=90,t(_),t(j);var X=r(j,2);{var Z=s=>{var d=ge();h(d,20,()=>Array(7),R,(f,x)=>{var i=be();l(f,i)}),t(d),l(s,d)},ee=s=>{var d=he();l(s,d)},te=s=>{var d=Ne(),f=r(a(d),2);h(f,21,()=>e(u),x=>x.date,(x,i)=>{var D=je(),E=r(a(D),2),$=a(E),A=a($),C=a(A),ae=a(C,!0);t(C);var z=r(C,2),se=a(z);t(z),t(A);var B=r(A,2),G=a(B);h(G,17,()=>e(i).memories.slice(0,10),R,(n,o)=>{var p=ye();g(()=>Q(p,`background: ${(U[e(o).nodeType]||"#6b7280")??""}; opacity: ${.3+e(o).retentionStrength*.7}`)),l(n,p)});var re=r(G,2);{var ie=n=>{var o=we(),p=a(o);t(o),g(()=>m(p,`+${e(i).memories.length-10}`)),l(n,o)};P(re,n=>{e(i).memories.length>10&&n(ie)})}t(B),t($);var oe=r($,2);{var le=n=>{var o=Te();h(o,21,()=>e(i).memories,R,(p,F)=>{var L=ke(),H=a(L),M=r(H,2),I=a(M),ve=a(I,!0);t(I),t(M);var J=r(M,2),de=a(J);t(J),t(L),g(ne=>{Q(H,`background: ${(U[e(F).nodeType]||"#6b7280")??""}`),m(ve,e(F).content),m(de,`${ne??""}%`)},[()=>(e(F).retentionStrength*100).toFixed(0)]),l(p,L)}),t(o),l(n,o)};P(oe,n=>{e(k)===e(i).date&&n(le)})}t(E),t(D),g(()=>{m(ae,e(i).date),m(se,`${e(i).count??""} memories`)}),K("click",E,()=>c(k,e(k)===e(i).date?null:e(i).date,!0)),l(x,D)}),t(f),t(d),l(s,d)};P(X,s=>{e(y)?s(Z):e(u).length===0?s(ee,1):s(te,!1)})}t(T),K("change",_,Y),fe(_,()=>e(w),s=>c(w,s)),l(V,T),ue()}_e(["change","click"]);export{Ye as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/11.BQP2Ra5z.js.br b/apps/dashboard/build/_app/immutable/nodes/11.BQP2Ra5z.js.br deleted file mode 100644 index 7d486ad..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/11.BQP2Ra5z.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.BQP2Ra5z.js.gz b/apps/dashboard/build/_app/immutable/nodes/11.BQP2Ra5z.js.gz deleted file mode 100644 index d35de46..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/11.BQP2Ra5z.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js b/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js new file mode 100644 index 0000000..5fb29ba --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{o as pe}from"../chunks/CkyfbJUz.js";import{p as ce,s as b,c as me,g as e,a as _e,d as i,e as a,h as c,r as t,t as g}from"../chunks/C9Z4nxhR.js";import{d as ue,a as K,s as m}from"../chunks/DP9qWekZ.js";import{i as M}from"../chunks/C2oj68pw.js";import{e as h,i as P}from"../chunks/kH-DTQyy.js";import{a as l,f as v}from"../chunks/DPfxVJHQ.js";import{s as Q}from"../chunks/BkopTN9z.js";import{b as xe}from"../chunks/-jeO_JOJ.js";import{a as fe}from"../chunks/BcuCGYSa.js";import{N as U}from"../chunks/CZ45jJaw.js";var be=v('
'),ge=v('
'),he=v('

No memories in the selected time range.

'),ye=v('
'),we=v(' '),ke=v('
'),Te=v('
'),je=v('
'),Ae=v('
'),Ne=v('

Timeline

');function Re(V,W){ce(W,!0);let _=b(me([])),y=b(!0),w=b(14),k=b(null);pe(()=>R());async function R(){c(y,!0);try{const s=await fe.timeline(e(w),500);c(_,s.timeline,!0)}catch{c(_,[],!0)}finally{c(y,!1)}}var T=Ne(),j=a(T),u=i(a(j),2),A=a(u);A.value=A.__value=7;var N=i(A);N.value=N.__value=14;var O=i(N);O.value=O.__value=30;var Y=i(O);Y.value=Y.__value=90,t(u),t(j);var X=i(j,2);{var Z=s=>{var d=ge();h(d,20,()=>Array(7),P,(x,f)=>{var r=be();l(x,r)}),t(d),l(s,d)},ee=s=>{var d=he();l(s,d)},te=s=>{var d=Ae(),x=i(a(d),2);h(x,21,()=>e(_),f=>f.date,(f,r)=>{var S=je(),B=i(a(S),2),D=a(B),E=a(D),$=a(E),ae=a($,!0);t($);var q=i($,2),se=a(q);t(q),t(E);var z=i(E,2),G=a(z);h(G,17,()=>e(r).memories.slice(0,10),P,(n,o)=>{var p=ye();g(()=>Q(p,`background: ${(U[e(o).nodeType]||"#8B95A5")??""}; opacity: ${.3+e(o).retentionStrength*.7}`)),l(n,p)});var ie=i(G,2);{var re=n=>{var o=we(),p=a(o);t(o),g(()=>m(p,`+${e(r).memories.length-10}`)),l(n,o)};M(ie,n=>{e(r).memories.length>10&&n(re)})}t(z),t(D);var oe=i(D,2);{var le=n=>{var o=Te();h(o,21,()=>e(r).memories,P,(p,C)=>{var F=ke(),H=a(F),L=i(H,2),I=a(L),ve=a(I,!0);t(I),t(L);var J=i(L,2),de=a(J);t(J),t(F),g(ne=>{Q(H,`background: ${(U[e(C).nodeType]||"#8B95A5")??""}`),m(ve,e(C).content),m(de,`${ne??""}%`)},[()=>(e(C).retentionStrength*100).toFixed(0)]),l(p,F)}),t(o),l(n,o)};M(oe,n=>{e(k)===e(r).date&&n(le)})}t(B),t(S),g(()=>{m(ae,e(r).date),m(se,`${e(r).count??""} memories`)}),K("click",B,()=>c(k,e(k)===e(r).date?null:e(r).date,!0)),l(f,S)}),t(x),t(d),l(s,d)};M(X,s=>{e(y)?s(Z):e(_).length===0?s(ee,1):s(te,!1)})}t(T),K("change",u,R),xe(u,()=>e(w),s=>c(w,s)),l(V,T),_e()}ue(["change","click"]);export{Re as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.br b/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.br new file mode 100644 index 0000000..59f4ea4 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.gz b/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.gz new file mode 100644 index 0000000..67aa5a4 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js b/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js new file mode 100644 index 0000000..5c688d6 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{f as m}from"../chunks/C9Z4nxhR.js";import{c as n,a as p}from"../chunks/DPfxVJHQ.js";import{s as i}from"../chunks/D00YwZ1M.js";function d(r,t){var o=n(),a=m(o);i(a,()=>t.children),p(r,o)}export{d as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.br b/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.br new file mode 100644 index 0000000..f91da89 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.gz b/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.gz new file mode 100644 index 0000000..912d0d0 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.CsdNgH7Y.js b/apps/dashboard/build/_app/immutable/nodes/2.CsdNgH7Y.js deleted file mode 100644 index fe50a8a..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/2.CsdNgH7Y.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{f as m}from"../chunks/DEYVqDYQ.js";import{c as n,a as p}from"../chunks/D5-kFxsM.js";import{s as i}from"../chunks/DngRZTwo.js";function d(r,t){var o=n(),a=m(o);i(a,()=>t.children),p(r,o)}export{d as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/2.CsdNgH7Y.js.br b/apps/dashboard/build/_app/immutable/nodes/2.CsdNgH7Y.js.br deleted file mode 100644 index 2b0e59b..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/2.CsdNgH7Y.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.CsdNgH7Y.js.gz b/apps/dashboard/build/_app/immutable/nodes/2.CsdNgH7Y.js.gz deleted file mode 100644 index 5100b59..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/2.CsdNgH7Y.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.B4vgfaGj.js b/apps/dashboard/build/_app/immutable/nodes/3.B4vgfaGj.js new file mode 100644 index 0000000..112fdc2 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/3.B4vgfaGj.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{i as p}from"../chunks/_Va07L2l.js";import{o as r}from"../chunks/CkyfbJUz.js";import{p as t,a}from"../chunks/C9Z4nxhR.js";import{g as m}from"../chunks/C9fAJV5Y.js";function g(i,o){t(o,!1),r(()=>m("/graph",{replaceState:!0})),p(),a()}export{g as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/3.B4vgfaGj.js.br b/apps/dashboard/build/_app/immutable/nodes/3.B4vgfaGj.js.br new file mode 100644 index 0000000..cdc7c2d Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/3.B4vgfaGj.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.B4vgfaGj.js.gz b/apps/dashboard/build/_app/immutable/nodes/3.B4vgfaGj.js.gz new file mode 100644 index 0000000..80c5fbc Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/3.B4vgfaGj.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.DD49Kzda.js b/apps/dashboard/build/_app/immutable/nodes/3.DD49Kzda.js deleted file mode 100644 index 93c7bd1..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/3.DD49Kzda.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{i as p}from"../chunks/dR5TMuCX.js";import{o as r}from"../chunks/BycUxjt3.js";import{p as t,a}from"../chunks/DEYVqDYQ.js";import{g as m}from"../chunks/B-yQpXHS.js";function g(i,o){t(o,!1),r(()=>m("/graph",{replaceState:!0})),p(),a()}export{g as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/3.DD49Kzda.js.br b/apps/dashboard/build/_app/immutable/nodes/3.DD49Kzda.js.br deleted file mode 100644 index 05056bf..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/3.DD49Kzda.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.DD49Kzda.js.gz b/apps/dashboard/build/_app/immutable/nodes/3.DD49Kzda.js.gz deleted file mode 100644 index 6c2bfe7..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/3.DD49Kzda.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js b/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js new file mode 100644 index 0000000..b6f1009 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js @@ -0,0 +1,6 @@ +import"../chunks/Bzak7iHL.js";import{p as ze,s as I,c as Ae,g as e,a as Pe,d as a,e as r,h as b,r as t,i as Qe,t as y,f as ge,u as se,j as qe}from"../chunks/C9Z4nxhR.js";import{d as Be,a as q,s as o}from"../chunks/DP9qWekZ.js";import{a as c,f as m,c as De}from"../chunks/DPfxVJHQ.js";import{i as k}from"../chunks/C2oj68pw.js";import{e as ie,i as ne}from"../chunks/kH-DTQyy.js";import{r as ye}from"../chunks/ZesQ8l8p.js";import{s as oe}from"../chunks/Co2v30Gm.js";import{s as Ke}from"../chunks/BkopTN9z.js";import{b as de}from"../chunks/P9ZHwQBL.js";import{a as X}from"../chunks/BcuCGYSa.js";var Re=m(''),Ue=m('
Source

'),Ve=m('
Target

'),Ge=m(`
Target Memory
`,1),He=m('

'),Je=m(' '),Le=m(" "),We=m(" "),Xe=m(" "),Ye=m(' '),Ze=m('

'),et=m('

'),tt=m('

No connections found for this query.

'),rt=m('
'),at=m('
'),st=m('
'),it=m(`

Explore Connections

Source Memory

Importance Scorer

4-channel neuroscience scoring: novelty, arousal, reward, attention

`);function ft(he,we){ze(we,!0);let V=I(""),G=I(""),F=I(null),C=I(null),B=I(Ae([])),$=I("associations"),O=I(!1),H=I(""),D=I(null);const le={associations:{icon:"◎",desc:"Spreading activation — find related memories via graph traversal"},chains:{icon:"⟿",desc:"Build reasoning path from source to target memory"},bridges:{icon:"⬡",desc:"Find connecting memories between two concepts"}};async function ve(){if(e(V).trim()){b(O,!0);try{const s=await X.search(e(V),1);s.results.length>0&&(b(F,s.results[0],!0),await Y())}catch{}finally{b(O,!1)}}}async function pe(){if(e(G).trim()){b(O,!0);try{const s=await X.search(e(G),1);s.results.length>0&&(b(C,s.results[0],!0),e(F)&&await Y())}catch{}finally{b(O,!1)}}}async function Y(){if(e(F)){b(O,!0);try{const s=(e($)==="chains"||e($)==="bridges")&&e(C)?e(C).id:void 0,i=await X.explore(e(F).id,e($),s);b(B,i.results||i.nodes||i.chain||i.bridges||[],!0)}catch{b(B,[],!0)}finally{b(O,!1)}}}async function ke(){e(H).trim()&&b(D,await X.importance(e(H)),!0)}function Se(s){b($,s,!0),e(F)&&Y()}var Z=it(),ee=a(r(Z),2);ie(ee,20,()=>["associations","chains","bridges"],ne,(s,i)=>{var d=Re(),_=r(d),h=r(_,!0);t(_);var f=a(_,2),p=r(f,!0);t(f);var n=a(f,2),g=r(n,!0);t(n),t(d),y(w=>{oe(d,1,`flex flex-col items-center gap-1 p-3 rounded-xl text-sm transition + ${e($)===i?"glass !border-synapse/30 text-synapse-glow":"glass-subtle text-dim hover:bg-white/[0.03]"}`),o(h,le[i].icon),o(p,w),o(g,le[i].desc)},[()=>i.charAt(0).toUpperCase()+i.slice(1)]),q("click",d,()=>Se(i)),c(s,d)}),t(ee);var te=a(ee,2),ce=a(r(te),2),J=r(ce);ye(J);var Fe=a(J,2);t(ce),t(te);var xe=a(te,2);{var Te=s=>{var i=Ue(),d=a(r(i),2),_=r(d,!0);t(d);var h=a(d,2),f=r(h),p=r(f,!0);t(f);var n=a(f,2),g=r(n);t(n),t(h),t(i),y((w,z)=>{o(_,w),o(p,e(F).nodeType),o(g,`${z??""}% retention`)},[()=>e(F).content.slice(0,200),()=>(e(F).retentionStrength*100).toFixed(0)]),c(s,i)};k(xe,s=>{e(F)&&s(Te)})}var me=a(xe,2);{var $e=s=>{var i=Ge(),d=ge(i),_=r(d),h=a(r(_)),f=r(h);t(h),t(_);var p=a(_,2),n=r(p);ye(n);var g=a(n,2);t(p),t(d);var w=a(d,2);{var z=u=>{var E=Ve(),x=a(r(E),2),K=r(x,!0);t(x);var M=a(x,2),S=r(M),A=r(S,!0);t(S);var T=a(S,2),P=r(T);t(T),t(M),t(E),y((Q,j)=>{o(K,Q),o(A,e(C).nodeType),o(P,`${j??""}% retention`)},[()=>e(C).content.slice(0,200),()=>(e(C).retentionStrength*100).toFixed(0)]),c(u,E)};k(w,u=>{e(C)&&u(z)})}y(()=>o(f,`(for ${e($)??""})`)),q("keydown",n,u=>u.key==="Enter"&&pe()),de(n,()=>e(G),u=>b(G,u)),q("click",g,pe),c(s,i)};k(me,s=>{(e($)==="chains"||e($)==="bridges")&&s($e)})}var ue=a(me,2);{var Ee=s=>{var i=De(),d=ge(i);{var _=p=>{var n=He(),g=a(r(n),2),w=r(g);t(g),t(n),y(()=>o(w,`Exploring ${e($)??""}...`)),c(p,n)},h=p=>{var n=et(),g=r(n),w=r(g),z=r(w);t(w),t(g);var u=a(g,2);ie(u,21,()=>e(B),ne,(E,x,K)=>{var M=Ze(),S=r(M);S.textContent=K+1;var A=a(S,2),T=r(A),P=r(T,!0);t(T);var Q=a(T,2),j=r(Q);{var L=l=>{var v=Je(),N=r(v,!0);t(v),y(()=>o(N,e(x).nodeType)),c(l,v)};k(j,l=>{e(x).nodeType&&l(L)})}var R=a(j,2);{var ae=l=>{var v=Le(),N=r(v);t(v),y(U=>o(N,`Score: ${U??""}`),[()=>Number(e(x).score).toFixed(3)]),c(l,v)};k(R,l=>{e(x).score&&l(ae)})}var W=a(R,2);{var Ie=l=>{var v=We(),N=r(v);t(v),y(U=>o(N,`Similarity: ${U??""}`),[()=>Number(e(x).similarity).toFixed(3)]),c(l,v)};k(W,l=>{e(x).similarity&&l(Ie)})}var be=a(W,2);{var je=l=>{var v=Xe(),N=r(v);t(v),y(U=>o(N,`${U??""}% retention`),[()=>(Number(e(x).retention)*100).toFixed(0)]),c(l,v)};k(be,l=>{e(x).retention&&l(je)})}var Ce=a(be,2);{var Oe=l=>{var v=Ye(),N=r(v,!0);t(v),y(()=>o(N,e(x).connectionType)),c(l,v)};k(Ce,l=>{e(x).connectionType&&l(Oe)})}t(Q),t(A),t(M),y(()=>o(P,e(x).content)),c(E,M)}),t(u),t(n),y(()=>o(z,`${e(B).length??""} Connections Found`)),c(p,n)},f=p=>{var n=tt();c(p,n)};k(d,p=>{e(O)?p(_):e(B).length>0?p(h,1):p(f,!1)})}c(s,i)};k(ue,s=>{e(F)&&s(Ee)})}var _e=a(ue,2),re=a(r(_e),4);Qe(re);var fe=a(re,2),Me=a(fe,2);{var Ne=s=>{const i=se(()=>e(D).channels),d=se(()=>Number(e(D).composite||e(D).compositeScore||0));var _=st(),h=r(_),f=r(h),p=r(f,!0);t(f);var n=a(f,2),g=r(n,!0);t(n),t(h);var w=a(h,2);{var z=u=>{var E=at();ie(E,21,()=>Object.entries(e(i)),ne,(x,K)=>{var M=se(()=>qe(e(K),2));let S=()=>e(M)[0],A=()=>e(M)[1];var T=rt(),P=r(T),Q=r(P,!0);t(P);var j=a(P,2),L=r(j);t(j);var R=a(j,2),ae=r(R,!0);t(R),t(T),y(W=>{o(Q,S()),oe(L,1,`h-full rounded-full transition-all duration-500 + ${S()==="novelty"?"bg-synapse":S()==="arousal"?"bg-dream":S()==="reward"?"bg-recall":"bg-amber-400"}`),Ke(L,`width: ${A()*100}%`),o(ae,W)},[()=>A().toFixed(2)]),c(x,T)}),t(E),c(u,E)};k(w,u=>{e(i)&&u(z)})}t(_),y(u=>{o(p,u),oe(n,1,`px-2 py-1 rounded-lg text-xs ${e(d)>.6?"bg-recall/20 text-recall border border-recall/30":"bg-white/[0.04] text-dim border border-subtle/20"}`),o(g,e(d)>.6?"SAVE":"SKIP")},[()=>e(d).toFixed(2)]),c(s,_)};k(Me,s=>{e(D)&&s(Ne)})}t(_e),t(Z),q("keydown",J,s=>s.key==="Enter"&&ve()),de(J,()=>e(V),s=>b(V,s)),q("click",Fe,ve),de(re,()=>e(H),s=>b(H,s)),q("click",fe,ke),c(he,Z),Pe()}Be(["click","keydown"]);export{ft as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.br b/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.br new file mode 100644 index 0000000..5673275 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.gz b/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.gz new file mode 100644 index 0000000..12ccefb Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.DjYrYj6K.js b/apps/dashboard/build/_app/immutable/nodes/4.DjYrYj6K.js deleted file mode 100644 index 31d44fc..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/4.DjYrYj6K.js +++ /dev/null @@ -1,6 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{p as ze,s as I,c as Ae,g as e,a as Pe,d as r,e as a,h as f,r as t,i as Qe,t as y,f as ge,u as se,j as qe}from"../chunks/DEYVqDYQ.js";import{d as Be,a as q,s as n}from"../chunks/ZM2C7QQX.js";import{a as p,f as u,c as De}from"../chunks/D5-kFxsM.js";import{i as S}from"../chunks/CpubbTHs.js";import{e as oe,i as ie}from"../chunks/CiJhRXcr.js";import{b as ne,r as ye}from"../chunks/Bew31VOg.js";import{s as de}from"../chunks/zt9hmg4X.js";import{s as Ke}from"../chunks/B9t3YtL9.js";import{a as X}from"../chunks/BcuCGYSa.js";var Re=u(''),Ue=u('
Source

'),Ve=u('
Target

'),Ge=u(`
`,1),He=u('

'),Je=u(' '),Le=u(" "),We=u(" "),Xe=u(" "),Ye=u(' '),Ze=u('

'),et=u('

'),tt=u('

No connections found for this query.

'),rt=u('
'),at=u('
'),st=u('
'),ot=u(`

Explore Connections

Importance Scorer

4-channel neuroscience scoring: novelty, arousal, reward, attention

`);function bt(he,we){ze(we,!0);let V=I(""),G=I(""),F=I(null),C=I(null),B=I(Ae([])),$=I("associations"),O=I(!1),H=I(""),D=I(null);const le={associations:{icon:"◎",desc:"Spreading activation — find related memories via graph traversal"},chains:{icon:"⟿",desc:"Build reasoning path from source to target memory"},bridges:{icon:"⬡",desc:"Find connecting memories between two concepts"}};async function ve(){if(e(V).trim()){f(O,!0);try{const s=await X.search(e(V),1);s.results.length>0&&(f(F,s.results[0],!0),await Y())}catch{}finally{f(O,!1)}}}async function ce(){if(e(G).trim()){f(O,!0);try{const s=await X.search(e(G),1);s.results.length>0&&(f(C,s.results[0],!0),e(F)&&await Y())}catch{}finally{f(O,!1)}}}async function Y(){if(e(F)){f(O,!0);try{const s=(e($)==="chains"||e($)==="bridges")&&e(C)?e(C).id:void 0,o=await X.explore(e(F).id,e($),s);f(B,o.results||o.nodes||o.chain||o.bridges||[],!0)}catch{f(B,[],!0)}finally{f(O,!1)}}}async function Se(){e(H).trim()&&f(D,await X.importance(e(H)),!0)}function ke(s){f($,s,!0),e(F)&&Y()}var Z=ot(),ee=a(r(Z),2);oe(ee,20,()=>["associations","chains","bridges"],ie,(s,o)=>{var d=Re(),b=r(d),h=r(b,!0);t(b);var _=a(b,2),c=r(_,!0);t(_);var i=a(_,2),g=r(i,!0);t(i),t(d),y(w=>{de(d,1,`flex flex-col items-center gap-1 p-3 rounded-lg text-sm transition - ${e($)===o?"bg-synapse/15 text-synapse-glow border border-synapse/40":"bg-surface/30 text-dim border border-subtle/20 hover:border-subtle/40"}`),n(h,le[o].icon),n(c,w),n(g,le[o].desc)},[()=>o.charAt(0).toUpperCase()+o.slice(1)]),q("click",d,()=>ke(o)),p(s,d)}),t(ee);var te=a(ee,2),pe=a(r(te),2),J=r(pe);ye(J);var Fe=a(J,2);t(pe),t(te);var xe=a(te,2);{var Te=s=>{var o=Ue(),d=a(r(o),2),b=r(d,!0);t(d);var h=a(d,2),_=r(h),c=r(_,!0);t(_);var i=a(_,2),g=r(i);t(i),t(h),t(o),y((w,z)=>{n(b,w),n(c,e(F).nodeType),n(g,`${z??""}% retention`)},[()=>e(F).content.slice(0,200),()=>(e(F).retentionStrength*100).toFixed(0)]),p(s,o)};S(xe,s=>{e(F)&&s(Te)})}var ue=a(xe,2);{var $e=s=>{var o=Ge(),d=ge(o),b=r(d),h=a(r(b)),_=r(h);t(h),t(b);var c=a(b,2),i=r(c);ye(i);var g=a(i,2);t(c),t(d);var w=a(d,2);{var z=m=>{var E=Ve(),x=a(r(E),2),K=r(x,!0);t(x);var M=a(x,2),k=r(M),A=r(k,!0);t(k);var T=a(k,2),P=r(T);t(T),t(M),t(E),y((Q,j)=>{n(K,Q),n(A,e(C).nodeType),n(P,`${j??""}% retention`)},[()=>e(C).content.slice(0,200),()=>(e(C).retentionStrength*100).toFixed(0)]),p(m,E)};S(w,m=>{e(C)&&m(z)})}y(()=>n(_,`(for ${e($)??""})`)),q("keydown",i,m=>m.key==="Enter"&&ce()),ne(i,()=>e(G),m=>f(G,m)),q("click",g,ce),p(s,o)};S(ue,s=>{(e($)==="chains"||e($)==="bridges")&&s($e)})}var me=a(ue,2);{var Ee=s=>{var o=De(),d=ge(o);{var b=c=>{var i=He(),g=a(r(i),2),w=r(g);t(g),t(i),y(()=>n(w,`Exploring ${e($)??""}...`)),p(c,i)},h=c=>{var i=et(),g=r(i),w=r(g),z=r(w);t(w),t(g);var m=a(g,2);oe(m,21,()=>e(B),ie,(E,x,K)=>{var M=Ze(),k=r(M);k.textContent=K+1;var A=a(k,2),T=r(A),P=r(T,!0);t(T);var Q=a(T,2),j=r(Q);{var L=l=>{var v=Je(),N=r(v,!0);t(v),y(()=>n(N,e(x).nodeType)),p(l,v)};S(j,l=>{e(x).nodeType&&l(L)})}var R=a(j,2);{var ae=l=>{var v=Le(),N=r(v);t(v),y(U=>n(N,`Score: ${U??""}`),[()=>Number(e(x).score).toFixed(3)]),p(l,v)};S(R,l=>{e(x).score&&l(ae)})}var W=a(R,2);{var Ie=l=>{var v=We(),N=r(v);t(v),y(U=>n(N,`Similarity: ${U??""}`),[()=>Number(e(x).similarity).toFixed(3)]),p(l,v)};S(W,l=>{e(x).similarity&&l(Ie)})}var fe=a(W,2);{var je=l=>{var v=Xe(),N=r(v);t(v),y(U=>n(N,`${U??""}% retention`),[()=>(Number(e(x).retention)*100).toFixed(0)]),p(l,v)};S(fe,l=>{e(x).retention&&l(je)})}var Ce=a(fe,2);{var Oe=l=>{var v=Ye(),N=r(v,!0);t(v),y(()=>n(N,e(x).connectionType)),p(l,v)};S(Ce,l=>{e(x).connectionType&&l(Oe)})}t(Q),t(A),t(M),y(()=>n(P,e(x).content)),p(E,M)}),t(m),t(i),y(()=>n(z,`${e(B).length??""} Connections Found`)),p(c,i)},_=c=>{var i=tt();p(c,i)};S(d,c=>{e(O)?c(b):e(B).length>0?c(h,1):c(_,!1)})}p(s,o)};S(me,s=>{e(F)&&s(Ee)})}var be=a(me,2),re=a(r(be),4);Qe(re);var _e=a(re,2),Me=a(_e,2);{var Ne=s=>{const o=se(()=>e(D).channels),d=se(()=>Number(e(D).composite||e(D).compositeScore||0));var b=st(),h=r(b),_=r(h),c=r(_,!0);t(_);var i=a(_,2),g=r(i,!0);t(i),t(h);var w=a(h,2);{var z=m=>{var E=at();oe(E,21,()=>Object.entries(e(o)),ie,(x,K)=>{var M=se(()=>qe(e(K),2));let k=()=>e(M)[0],A=()=>e(M)[1];var T=rt(),P=r(T),Q=r(P,!0);t(P);var j=a(P,2),L=r(j);t(j);var R=a(j,2),ae=r(R,!0);t(R),t(T),y(W=>{n(Q,k()),de(L,1,`h-full rounded-full transition-all duration-500 - ${k()==="novelty"?"bg-synapse":k()==="arousal"?"bg-dream":k()==="reward"?"bg-recall":"bg-amber-400"}`),Ke(L,`width: ${A()*100}%`),n(ae,W)},[()=>A().toFixed(2)]),p(x,T)}),t(E),p(m,E)};S(w,m=>{e(o)&&m(z)})}t(b),y(m=>{n(c,m),de(i,1,`px-2 py-1 rounded text-xs ${e(d)>.6?"bg-recall/20 text-recall border border-recall/30":"bg-surface text-dim border border-subtle/30"}`),n(g,e(d)>.6?"SAVE":"SKIP")},[()=>e(d).toFixed(2)]),p(s,b)};S(Me,s=>{e(D)&&s(Ne)})}t(be),t(Z),q("keydown",J,s=>s.key==="Enter"&&ve()),ne(J,()=>e(V),s=>f(V,s)),q("click",Fe,ve),ne(re,()=>e(H),s=>f(H,s)),q("click",_e,Se),p(he,Z),Pe()}Be(["click","keydown"]);export{bt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/4.DjYrYj6K.js.br b/apps/dashboard/build/_app/immutable/nodes/4.DjYrYj6K.js.br deleted file mode 100644 index da6b3d0..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/4.DjYrYj6K.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.DjYrYj6K.js.gz b/apps/dashboard/build/_app/immutable/nodes/4.DjYrYj6K.js.gz deleted file mode 100644 index 0e8b75b..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/4.DjYrYj6K.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js b/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js new file mode 100644 index 0000000..b7cd273 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js @@ -0,0 +1,8 @@ +import"../chunks/Bzak7iHL.js";import{i as oe}from"../chunks/_Va07L2l.js";import{p as ee,ah as ie,g as e,h as M,e as o,d,r as s,f as ne,t as $,a as te,s as K,u as X,C as Z}from"../chunks/C9Z4nxhR.js";import{s as x,d as de,a as ce}from"../chunks/DP9qWekZ.js";import{a as l,f as m}from"../chunks/DPfxVJHQ.js";import{i as w}from"../chunks/C2oj68pw.js";import{e as re,i as ae}from"../chunks/kH-DTQyy.js";import{s as C}from"../chunks/BkopTN9z.js";import{s as le,a as me}from"../chunks/DWr9YED7.js";import{w as ve,e as ue}from"../chunks/BmeMLq0p.js";import{E as O}from"../chunks/CZ45jJaw.js";import{s as pe}from"../chunks/ZesQ8l8p.js";import{s as fe}from"../chunks/Co2v30Gm.js";import{p as Q}from"../chunks/Do8TgQ-j.js";var xe=m(' '),_e=m('
'),ge=m('
',1),he=m('
'),ye=m('
'),$e=m('
Cognitive Search Pipeline
');function be(q,F){ee(F,!0);let S=Q(F,"resultCount",3,0),j=Q(F,"durationMs",3,0),I=Q(F,"active",3,!1);const p=[{name:"Overfetch",icon:"◎",color:"#818CF8",desc:"Pull 3x results from hybrid search"},{name:"Rerank",icon:"⟿",color:"#00A8FF",desc:"Re-score by relevance quality"},{name:"Temporal",icon:"◷",color:"#00D4FF",desc:"Recent memories get recency bonus"},{name:"Access",icon:"◇",color:"#00FFD1",desc:"FSRS-6 retention threshold filter"},{name:"Context",icon:"◬",color:"#FFB800",desc:"Encoding specificity matching"},{name:"Compete",icon:"⬡",color:"#FF3CAC",desc:"Retrieval-induced forgetting"},{name:"Activate",icon:"◈",color:"#9D00FF",desc:"Spreading activation cascade"}];let _=K(-1),g=K(!1),u=K(!1);ie(()=>{I()&&!e(g)&&P()});function P(){M(g,!0),M(_,-1),M(u,!1);const t=Math.max(1500,(j()||50)*2),a=t/(p.length+1);p.forEach((i,v)=>{setTimeout(()=>{M(_,v,!0)},a*(v+1))}),setTimeout(()=>{M(u,!0),M(g,!1)},t)}var D=$e(),b=o(D),L=d(o(b),2);{var V=t=>{var a=xe(),i=o(a);s(a),$(()=>x(i,`${S()??""} results in ${j()??""}ms`)),l(t,a)};w(L,t=>{e(u)&&t(V)})}s(b);var A=d(b,2);re(A,21,()=>p,ae,(t,a,i)=>{const v=X(()=>i<=e(_)),E=X(()=>i===e(_)&&e(g));var k=ge(),h=ne(k),y=o(h),J=o(y,!0);s(y);var R=d(y,2),T=o(R,!0);s(R),s(h);var U=d(h,2);{var W=B=>{var c=_e();$(()=>C(c,`background: ${i{i{fe(y,1,`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-all duration-300 + ${e(E)?"scale-125":""}`),C(y,`background: ${e(v)?e(a).color+"25":"rgba(255,255,255,0.03)"}; + border: 1.5px solid ${(e(v)?e(a).color:"rgba(255,255,255,0.06)")??""}; + color: ${(e(v)?e(a).color:"#4a4a7a")??""}; + box-shadow: ${e(E)?"0 0 12px "+e(a).color+"40":"none"}`),pe(y,"title",e(a).desc),x(J,e(a).icon),C(R,`color: ${(e(v)?e(a).color:"#4a4a7a")??""}`),x(T,e(a).name)}),l(t,k)}),s(A);var N=d(A,2),z=o(N);{var n=t=>{var a=he();$(i=>C(a,`width: ${i??""}%; + background: linear-gradient(90deg, #818CF8, #00FFD1, #9D00FF); + transition-duration: ${e(g)?"300ms":"500ms"}`),[()=>e(u)?"100":((e(_)+1)/p.length*100).toFixed(0)]),l(t,a)};w(z,t=>{(e(g)||e(u))&&t(n)})}s(N);var r=d(N,2);{var H=t=>{var a=ye(),i=d(o(a),2),v=o(i);s(i),s(a),$(()=>x(v,`Pipeline complete: ${S()??""} memories surfaced from ${p.length??""}-stage cognitive cascade`)),l(t,a)};w(r,t=>{e(u)&&t(H)})}s(D),l(q,D),te()}var we=m('

Waiting for cognitive events...

Events appear here in real-time as Vestige thinks.

'),Ce=m(' '),Fe=m('
'),Se=m(`

`),De=m('
'),ke=m('

Live Feed

');function ze(q,F){ee(F,!1);const S=()=>me(ue,"$eventFeed",j),[j,I]=le();function p(n){return new Date(n).toLocaleTimeString()}function _(n){return{MemoryCreated:"+",MemoryUpdated:"~",MemoryDeleted:"×",MemoryPromoted:"↑",MemoryDemoted:"↓",SearchPerformed:"◎",DreamStarted:"◈",DreamProgress:"◈",DreamCompleted:"◈",ConsolidationStarted:"◉",ConsolidationCompleted:"◉",RetentionDecayed:"↘",ConnectionDiscovered:"━",ActivationSpread:"◬",ImportanceScored:"◫",Heartbeat:"♡"}[n]||"·"}function g(n){const r=n.data;switch(n.type){case"MemoryCreated":return`New ${r.node_type}: "${String(r.content_preview).slice(0,60)}..."`;case"SearchPerformed":return`Searched "${r.query}" → ${r.result_count} results (${r.duration_ms}ms)`;case"DreamStarted":return`Dream started with ${r.memory_count} memories`;case"DreamCompleted":return`Dream complete: ${r.connections_found} connections, ${r.insights_generated} insights (${r.duration_ms}ms)`;case"ConsolidationStarted":return"Consolidation cycle started";case"ConsolidationCompleted":return`Consolidated ${r.nodes_processed} nodes, ${r.decay_applied} decayed (${r.duration_ms}ms)`;case"ConnectionDiscovered":return`Connection: ${String(r.connection_type)} (weight: ${Number(r.weight).toFixed(2)})`;case"ImportanceScored":return`Scored ${Number(r.composite_score).toFixed(2)}: "${String(r.content_preview).slice(0,50)}..."`;case"MemoryPromoted":return`Promoted → ${(Number(r.new_retention)*100).toFixed(0)}% retention`;case"MemoryDemoted":return`Demoted → ${(Number(r.new_retention)*100).toFixed(0)}% retention`;default:return JSON.stringify(r).slice(0,100)}}oe();var u=ke(),P=o(u),D=d(o(P),2),b=o(D),L=o(b);s(b);var V=d(b,2);s(D),s(P);var A=d(P,2);{var N=n=>{var r=we();l(n,r)},z=n=>{var r=De();re(r,5,S,ae,(H,t)=>{var a=Se(),i=o(a),v=o(i,!0);s(i);var E=d(i,2),k=o(E),h=o(k),y=o(h,!0);s(h);var J=d(h,2);{var R=c=>{var f=Ce(),Y=o(f,!0);s(f),$(G=>x(Y,G),[()=>p(String(e(t).data.timestamp))]),l(c,f)};w(J,c=>{e(t).data.timestamp&&c(R)})}s(k);var T=d(k,2),U=o(T,!0);s(T);var W=d(T,2);{var B=c=>{var f=Fe(),Y=o(f);{let G=Z(()=>Number(e(t).data.result_count)||0),se=Z(()=>Number(e(t).data.duration_ms)||0);be(Y,{get resultCount(){return e(G)},get durationMs(){return e(se)},active:!0})}s(f),l(c,f)};w(W,c=>{e(t).type==="SearchPerformed"&&c(B)})}s(E),s(a),$((c,f)=>{C(a,`border-left: 3px solid ${(O[e(t).type]||"#8B95A5")??""}`),C(i,`background: ${(O[e(t).type]||"#8B95A5")??""}15; color: ${(O[e(t).type]||"#8B95A5")??""}`),x(v,c),C(h,`color: ${(O[e(t).type]||"#8B95A5")??""}`),x(y,e(t).type),x(U,f)},[()=>_(e(t).type),()=>g(e(t))]),l(H,a)}),s(r),l(n,r)};w(A,n=>{S().length===0?n(N):n(z,!1)})}s(u),$(()=>x(L,`${S().length??""} events`)),ce("click",V,()=>ve.clearEvents()),l(q,u),te(),I()}de(["click"]);export{ze as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.br b/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.br new file mode 100644 index 0000000..6266711 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.gz b/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.gz new file mode 100644 index 0000000..e00d286 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/5.CzxPa_Z5.js b/apps/dashboard/build/_app/immutable/nodes/5.CzxPa_Z5.js deleted file mode 100644 index 794af06..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/5.CzxPa_Z5.js +++ /dev/null @@ -1,2 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{i as z}from"../chunks/dR5TMuCX.js";import{p as B,t as $,a as G,e as i,d as a,r,g as o}from"../chunks/DEYVqDYQ.js";import{d as K,a as Q,s as m}from"../chunks/ZM2C7QQX.js";import{a as c,f as l}from"../chunks/D5-kFxsM.js";import{i as D}from"../chunks/CpubbTHs.js";import{e as X,i as Z}from"../chunks/CiJhRXcr.js";import{s as h}from"../chunks/B9t3YtL9.js";import{s as ee,a as te}from"../chunks/DUZi1B8N.js";import{w as re,e as ae}from"../chunks/DmEsXEQB.js";import{E as x}from"../chunks/Dwpy08gq.js";var se=l('

Waiting for cognitive events...

Events appear here in real-time as Vestige thinks.

'),oe=l(' '),ie=l(`

`),ne=l('
'),de=l('

Live Feed

');function be(F,M){B(M,!1);const _=()=>te(ae,"$eventFeed",k),[k,N]=ee();function P(t){return new Date(t).toLocaleTimeString()}function E(t){return{MemoryCreated:"+",MemoryUpdated:"~",MemoryDeleted:"×",MemoryPromoted:"↑",MemoryDemoted:"↓",SearchPerformed:"◎",DreamStarted:"◈",DreamProgress:"◈",DreamCompleted:"◈",ConsolidationStarted:"◉",ConsolidationCompleted:"◉",RetentionDecayed:"↘",ConnectionDiscovered:"━",ActivationSpread:"◬",ImportanceScored:"◫",Heartbeat:"♡"}[t]||"·"}function T(t){const e=t.data;switch(t.type){case"MemoryCreated":return`New ${e.node_type}: "${String(e.content_preview).slice(0,60)}..."`;case"SearchPerformed":return`Searched "${e.query}" → ${e.result_count} results (${e.duration_ms}ms)`;case"DreamStarted":return`Dream started with ${e.memory_count} memories`;case"DreamCompleted":return`Dream complete: ${e.connections_found} connections, ${e.insights_generated} insights (${e.duration_ms}ms)`;case"ConsolidationStarted":return"Consolidation cycle started";case"ConsolidationCompleted":return`Consolidated ${e.nodes_processed} nodes, ${e.decay_applied} decayed (${e.duration_ms}ms)`;case"ConnectionDiscovered":return`Connection: ${String(e.connection_type)} (weight: ${Number(e.weight).toFixed(2)})`;case"ImportanceScored":return`Scored ${Number(e.composite_score).toFixed(2)}: "${String(e.content_preview).slice(0,50)}..."`;case"MemoryPromoted":return`Promoted → ${(Number(e.new_retention)*100).toFixed(0)}% retention`;case"MemoryDemoted":return`Demoted → ${(Number(e.new_retention)*100).toFixed(0)}% retention`;default:return JSON.stringify(e).slice(0,100)}}z();var f=de(),g=a(f),S=i(a(g),2),y=a(S),I=a(y);r(y);var L=i(y,2);r(S),r(g);var O=i(g,2);{var j=t=>{var e=se();c(t,e)},R=t=>{var e=ne();X(e,5,_,Z,(V,s)=>{var p=ie(),v=a(p),q=a(v,!0);r(v);var C=i(v,2),b=a(C),u=a(b),A=a(u,!0);r(u);var H=i(u,2);{var J=n=>{var d=oe(),W=a(d,!0);r(d),$(Y=>m(W,Y),[()=>P(String(o(s).data.timestamp))]),c(n,d)};D(H,n=>{o(s).data.timestamp&&n(J)})}r(b);var w=i(b,2),U=a(w,!0);r(w),r(C),r(p),$((n,d)=>{h(p,`border-left: 3px solid ${(x[o(s).type]||"#6b7280")??""}`),h(v,`background: ${(x[o(s).type]||"#6b7280")??""}20; color: ${(x[o(s).type]||"#6b7280")??""}`),m(q,n),h(u,`color: ${(x[o(s).type]||"#6b7280")??""}`),m(A,o(s).type),m(U,d)},[()=>E(o(s).type),()=>T(o(s))]),c(V,p)}),r(e),c(t,e)};D(O,t=>{_().length===0?t(j):t(R,!1)})}r(f),$(()=>m(I,`${_().length??""} events`)),Q("click",L,()=>re.clearEvents()),c(F,f),G(),N()}K(["click"]);export{be as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/5.CzxPa_Z5.js.br b/apps/dashboard/build/_app/immutable/nodes/5.CzxPa_Z5.js.br deleted file mode 100644 index a3137fe..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/5.CzxPa_Z5.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/5.CzxPa_Z5.js.gz b/apps/dashboard/build/_app/immutable/nodes/5.CzxPa_Z5.js.gz deleted file mode 100644 index 1ad49a3..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/5.CzxPa_Z5.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.eFd2PZKr.js b/apps/dashboard/build/_app/immutable/nodes/6.eFd2PZKr.js deleted file mode 100644 index c733da6..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/6.eFd2PZKr.js +++ /dev/null @@ -1,3936 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as Ml,a as uc}from"../chunks/BycUxjt3.js";import{p as Na,a as Fa,d as qt,e as Kt,G as Sl,r as Yt,t as vn,g as Nt,u as Hr,h as We,s as zn,f as dc}from"../chunks/DEYVqDYQ.js";import{s as be,d as fc,a as Tn}from"../chunks/ZM2C7QQX.js";import{i as rs}from"../chunks/CpubbTHs.js";import{e as kr,i as Vr}from"../chunks/CiJhRXcr.js";import{a as Qe,f as nn}from"../chunks/D5-kFxsM.js";import{s as Oe,b as pc,r as mc}from"../chunks/Bew31VOg.js";import{s as _c}from"../chunks/zt9hmg4X.js";import{s as yl}from"../chunks/B9t3YtL9.js";import{b as gc}from"../chunks/DNwVrE-V.js";import{s as vc,a as xc}from"../chunks/DUZi1B8N.js";import{b as Mc}from"../chunks/BbhZG17W.js";import{p as Ws}from"../chunks/Dli8az1I.js";import{N as Sc}from"../chunks/Dwpy08gq.js";import{a as Hi}from"../chunks/BcuCGYSa.js";import{e as yc}from"../chunks/DmEsXEQB.js";/** - * @license - * Copyright 2010-2024 Three.js Authors - * SPDX-License-Identifier: MIT - */const Oa="172",Ai={ROTATE:0,DOLLY:1,PAN:2},Ei={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ec=0,so=1,Tc=2,El=1,bc=2,gn=3,Nn=0,Ne=1,an=2,Mn=0,wi=1,sn=2,ro=3,ao=4,Ac=5,qn=100,wc=101,Rc=102,Cc=103,Pc=104,Dc=200,Lc=201,Uc=202,Ic=203,Gr=204,Wr=205,Nc=206,Fc=207,Oc=208,Bc=209,zc=210,Hc=211,kc=212,Vc=213,Gc=214,Xr=0,Yr=1,qr=2,Pi=3,jr=4,Zr=5,Kr=6,$r=7,Tl=0,Wc=1,Xc=2,Un=0,Yc=1,qc=2,jc=3,bl=4,Zc=5,Kc=6,$c=7,Al=300,Di=301,Li=302,Jr=303,Qr=304,Qs=306,ta=1e3,Zn=1001,ea=1002,ke=1003,Jc=1004,as=1005,ln=1006,rr=1007,Kn=1008,En=1009,wl=1010,Rl=1011,Qi=1012,Ba=1013,$n=1014,cn=1015,Sn=1016,za=1017,Ha=1018,Ui=1020,Cl=35902,Pl=1021,Dl=1022,tn=1023,Ll=1024,Ul=1025,Ri=1026,Ii=1027,ka=1028,Va=1029,Il=1030,Ga=1031,Wa=1033,Fs=33776,Os=33777,Bs=33778,zs=33779,na=35840,ia=35841,sa=35842,ra=35843,aa=36196,oa=37492,la=37496,ca=37808,ha=37809,ua=37810,da=37811,fa=37812,pa=37813,ma=37814,_a=37815,ga=37816,va=37817,xa=37818,Ma=37819,Sa=37820,ya=37821,Hs=36492,Ea=36494,Ta=36495,Nl=36283,ba=36284,Aa=36285,wa=36286,Qc=3200,th=3201,Fl=0,eh=1,Ln="",Ye="srgb",Ni="srgb-linear",Xs="linear",re="srgb",ii=7680,oo=519,nh=512,ih=513,sh=514,Ol=515,rh=516,ah=517,oh=518,lh=519,Ra=35044,lo="300 es",xn=2e3,Ys=2001;class Qn{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const s=this._listeners[t];if(s!==void 0){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const n=this._listeners[t.type];if(n!==void 0){t.target=this;const s=n.slice(0);for(let r=0,a=s.length;r>8&255]+Ee[i>>16&255]+Ee[i>>24&255]+"-"+Ee[t&255]+Ee[t>>8&255]+"-"+Ee[t>>16&15|64]+Ee[t>>24&255]+"-"+Ee[e&63|128]+Ee[e>>8&255]+"-"+Ee[e>>16&255]+Ee[e>>24&255]+Ee[n&255]+Ee[n>>8&255]+Ee[n>>16&255]+Ee[n>>24&255]).toLowerCase()}function jt(i,t,e){return Math.max(t,Math.min(e,i))}function ch(i,t){return(i%t+t)%t}function ar(i,t,e){return(1-e)*i+e*t}function on(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function ae(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const hh={DEG2RAD:ks};class At{constructor(t=0,e=0){At.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6],this.y=s[1]*e+s[4]*n+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=jt(this.x,t.x,e.x),this.y=jt(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=jt(this.x,t,e),this.y=jt(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(jt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(jt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*s+t.x,this.y=r*s+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Wt{constructor(t,e,n,s,r,a,o,l,c){Wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,l,c)}set(t,e,n,s,r,a,o,l,c){const u=this.elements;return u[0]=t,u[1]=s,u[2]=o,u[3]=e,u[4]=r,u[5]=l,u[6]=n,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],u=n[4],d=n[7],f=n[2],m=n[5],g=n[8],x=s[0],p=s[3],h=s[6],A=s[1],b=s[4],E=s[7],D=s[2],w=s[5],R=s[8];return r[0]=a*x+o*A+l*D,r[3]=a*p+o*b+l*w,r[6]=a*h+o*E+l*R,r[1]=c*x+u*A+d*D,r[4]=c*p+u*b+d*w,r[7]=c*h+u*E+d*R,r[2]=f*x+m*A+g*D,r[5]=f*p+m*b+g*w,r[8]=f*h+m*E+g*R,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],u=t[8];return e*a*u-e*o*c-n*r*u+n*o*l+s*r*c-s*a*l}invert(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],u=t[8],d=u*a-o*c,f=o*l-u*r,m=c*r-a*l,g=e*d+n*f+s*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/g;return t[0]=d*x,t[1]=(s*c-u*n)*x,t[2]=(o*n-s*a)*x,t[3]=f*x,t[4]=(u*e-s*l)*x,t[5]=(s*r-o*e)*x,t[6]=m*x,t[7]=(n*l-c*e)*x,t[8]=(a*e-n*r)*x,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+t,-s*c,s*l,-s*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(or.makeScale(t,e)),this}rotate(t){return this.premultiply(or.makeRotation(-t)),this}translate(t,e){return this.premultiply(or.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let s=0;s<9;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const or=new Wt;function Bl(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function qs(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function uh(){const i=qs("canvas");return i.style.display="block",i}const co={};function yi(i){i in co||(co[i]=!0,console.warn(i))}function dh(i,t,e){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(t,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:n()}}setTimeout(r,e)})}function fh(i){const t=i.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function ph(i){const t=i.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const ho=new Wt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),uo=new Wt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function mh(){const i={enabled:!0,workingColorSpace:Ni,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===re&&(s.r=yn(s.r),s.g=yn(s.g),s.b=yn(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===re&&(s.r=Ci(s.r),s.g=Ci(s.g),s.b=Ci(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Ln?Xs:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[Ni]:{primaries:t,whitePoint:n,transfer:Xs,toXYZ:ho,fromXYZ:uo,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Ye},outputColorSpaceConfig:{drawingBufferColorSpace:Ye}},[Ye]:{primaries:t,whitePoint:n,transfer:re,toXYZ:ho,fromXYZ:uo,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Ye}}}),i}const Qt=mh();function yn(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Ci(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let si;class _h{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{si===void 0&&(si=qs("canvas")),si.width=t.width,si.height=t.height;const n=si.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=si}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=qs("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const s=n.getImageData(0,0,t.width,t.height),r=s.data;for(let a=0;a0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Al)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ta:t.x=t.x-Math.floor(t.x);break;case Zn:t.x=t.x<0?0:1;break;case ea:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case ta:t.y=t.y-Math.floor(t.y);break;case Zn:t.y=t.y<0?0:1;break;case ea:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Ae.DEFAULT_IMAGE=null;Ae.DEFAULT_MAPPING=Al;Ae.DEFAULT_ANISOTROPY=1;class le{constructor(t=0,e=0,n=0,s=1){le.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,s){return this.x=t,this.y=e,this.z=n,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,s,r;const l=t.elements,c=l[0],u=l[4],d=l[8],f=l[1],m=l[5],g=l[9],x=l[2],p=l[6],h=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-x)<.01&&Math.abs(g-p)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+x)<.1&&Math.abs(g+p)<.1&&Math.abs(c+m+h-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(c+1)/2,E=(m+1)/2,D=(h+1)/2,w=(u+f)/4,R=(d+x)/4,N=(g+p)/4;return b>E&&b>D?b<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(b),s=w/n,r=R/n):E>D?E<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(E),n=w/s,r=N/s):D<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(D),n=R/r,s=N/r),this.set(n,s,r,e),this}let A=Math.sqrt((p-g)*(p-g)+(d-x)*(d-x)+(f-u)*(f-u));return Math.abs(A)<.001&&(A=1),this.x=(p-g)/A,this.y=(d-x)/A,this.z=(f-u)/A,this.w=Math.acos((c+m+h-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=jt(this.x,t.x,e.x),this.y=jt(this.y,t.y,e.y),this.z=jt(this.z,t.z,e.z),this.w=jt(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=jt(this.x,t,e),this.y=jt(this.y,t,e),this.z=jt(this.z,t,e),this.w=jt(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(jt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class xh extends Qn{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new le(0,0,t,e),this.scissorTest=!1,this.viewport=new le(0,0,t,e);const s={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ln,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new Ae(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o=0?1:-1,b=1-h*h;if(b>Number.EPSILON){const D=Math.sqrt(b),w=Math.atan2(D,h*A);p=Math.sin(p*w)/D,o=Math.sin(o*w)/D}const E=o*A;if(l=l*p+f*E,c=c*p+m*E,u=u*p+g*E,d=d*p+x*E,p===1-o){const D=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=D,c*=D,u*=D,d*=D}}t[e]=l,t[e+1]=c,t[e+2]=u,t[e+3]=d}static multiplyQuaternionsFlat(t,e,n,s,r,a){const o=n[s],l=n[s+1],c=n[s+2],u=n[s+3],d=r[a],f=r[a+1],m=r[a+2],g=r[a+3];return t[e]=o*g+u*d+l*m-c*f,t[e+1]=l*g+u*f+c*d-o*m,t[e+2]=c*g+u*m+o*f-l*d,t[e+3]=u*g-o*d-l*f-c*m,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,s){return this._x=t,this._y=e,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(n/2),u=o(s/2),d=o(r/2),f=l(n/2),m=l(s/2),g=l(r/2);switch(a){case"XYZ":this._x=f*u*d+c*m*g,this._y=c*m*d-f*u*g,this._z=c*u*g+f*m*d,this._w=c*u*d-f*m*g;break;case"YXZ":this._x=f*u*d+c*m*g,this._y=c*m*d-f*u*g,this._z=c*u*g-f*m*d,this._w=c*u*d+f*m*g;break;case"ZXY":this._x=f*u*d-c*m*g,this._y=c*m*d+f*u*g,this._z=c*u*g+f*m*d,this._w=c*u*d-f*m*g;break;case"ZYX":this._x=f*u*d-c*m*g,this._y=c*m*d+f*u*g,this._z=c*u*g-f*m*d,this._w=c*u*d+f*m*g;break;case"YZX":this._x=f*u*d+c*m*g,this._y=c*m*d+f*u*g,this._z=c*u*g-f*m*d,this._w=c*u*d-f*m*g;break;case"XZY":this._x=f*u*d-c*m*g,this._y=c*m*d-f*u*g,this._z=c*u*g+f*m*d,this._w=c*u*d+f*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,s=Math.sin(n);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],s=e[4],r=e[8],a=e[1],o=e[5],l=e[9],c=e[2],u=e[6],d=e[10],f=n+o+d;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(u-l)*m,this._y=(r-c)*m,this._z=(a-s)*m}else if(n>o&&n>d){const m=2*Math.sqrt(1+n-o-d);this._w=(u-l)/m,this._x=.25*m,this._y=(s+a)/m,this._z=(r+c)/m}else if(o>d){const m=2*Math.sqrt(1+o-n-d);this._w=(r-c)/m,this._x=(s+a)/m,this._y=.25*m,this._z=(l+u)/m}else{const m=2*Math.sqrt(1+d-n-o);this._w=(a-s)/m,this._x=(r+c)/m,this._y=(l+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(jt(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const s=Math.min(1,e/n);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,s=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,u=e._w;return this._x=n*u+a*o+s*c-r*l,this._y=s*u+a*l+r*o-n*c,this._z=r*u+a*c+n*l-s*o,this._w=a*u-n*o-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,s=this._y,r=this._z,a=this._w;let o=a*t._w+n*t._x+s*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-e;return this._w=m*a+e*this._w,this._x=m*n+e*this._x,this._y=m*s+e*this._y,this._z=m*r+e*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,o),d=Math.sin((1-e)*u)/c,f=Math.sin(e*u)/c;return this._w=a*d+this._w*f,this._x=n*d+this._x*f,this._y=s*d+this._y*f,this._z=r*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class P{constructor(t=0,e=0,n=0){P.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(fo.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(fo.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*s,this.y=r[1]*e+r[4]*n+r[7]*s,this.z=r[2]*e+r[5]*n+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,s=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*s-o*n),u=2*(o*e-r*s),d=2*(r*n-a*e);return this.x=e+l*c+a*d-o*u,this.y=n+l*u+o*c-r*d,this.z=s+l*d+r*u-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*s,this.y=r[1]*e+r[5]*n+r[9]*s,this.z=r[2]*e+r[6]*n+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=jt(this.x,t.x,e.x),this.y=jt(this.y,t.y,e.y),this.z=jt(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=jt(this.x,t,e),this.y=jt(this.y,t,e),this.z=jt(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(jt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,s=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=s*l-r*o,this.y=r*a-n*l,this.z=n*o-s*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return cr.copy(this).projectOnVector(t),this.sub(cr)}reflect(t){return this.sub(cr.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(jt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,s=this.z-t.z;return e*e+n*n+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const s=Math.sin(e)*t;return this.x=s*Math.sin(n),this.y=Math.cos(e)*t,this.z=s*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const cr=new P,fo=new Jn;class ti{constructor(t=new P(1/0,1/0,1/0),e=new P(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Ke),Ke.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ki),ls.subVectors(this.max,ki),ri.subVectors(t.a,ki),ai.subVectors(t.b,ki),oi.subVectors(t.c,ki),bn.subVectors(ai,ri),An.subVectors(oi,ai),Hn.subVectors(ri,oi);let e=[0,-bn.z,bn.y,0,-An.z,An.y,0,-Hn.z,Hn.y,bn.z,0,-bn.x,An.z,0,-An.x,Hn.z,0,-Hn.x,-bn.y,bn.x,0,-An.y,An.x,0,-Hn.y,Hn.x,0];return!hr(e,ri,ai,oi,ls)||(e=[1,0,0,0,1,0,0,0,1],!hr(e,ri,ai,oi,ls))?!1:(cs.crossVectors(bn,An),e=[cs.x,cs.y,cs.z],hr(e,ri,ai,oi,ls))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ke).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Ke).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(dn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),dn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),dn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),dn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),dn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),dn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),dn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),dn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(dn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const dn=[new P,new P,new P,new P,new P,new P,new P,new P],Ke=new P,os=new ti,ri=new P,ai=new P,oi=new P,bn=new P,An=new P,Hn=new P,ki=new P,ls=new P,cs=new P,kn=new P;function hr(i,t,e,n,s){for(let r=0,a=i.length-3;r<=a;r+=3){kn.fromArray(i,r);const o=s.x*Math.abs(kn.x)+s.y*Math.abs(kn.y)+s.z*Math.abs(kn.z),l=t.dot(kn),c=e.dot(kn),u=n.dot(kn);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const Sh=new ti,Vi=new P,ur=new P;class ei{constructor(t=new P,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):Sh.setFromPoints(t).getCenter(n);let s=0;for(let r=0,a=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Vi.subVectors(t,this.center);const e=Vi.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),s=(n-this.radius)*.5;this.center.addScaledVector(Vi,s/n),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(ur.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Vi.copy(t.center).add(ur)),this.expandByPoint(Vi.copy(t.center).sub(ur))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const fn=new P,dr=new P,hs=new P,wn=new P,fr=new P,us=new P,pr=new P;class ts{constructor(t=new P,e=new P(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,fn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=fn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(fn.copy(this.origin).addScaledVector(this.direction,e),fn.distanceToSquared(t))}distanceSqToSegment(t,e,n,s){dr.copy(t).add(e).multiplyScalar(.5),hs.copy(e).sub(t).normalize(),wn.copy(this.origin).sub(dr);const r=t.distanceTo(e)*.5,a=-this.direction.dot(hs),o=wn.dot(this.direction),l=-wn.dot(hs),c=wn.lengthSq(),u=Math.abs(1-a*a);let d,f,m,g;if(u>0)if(d=a*l-o,f=a*o-l,g=r*u,d>=0)if(f>=-g)if(f<=g){const x=1/u;d*=x,f*=x,m=d*(d+a*f+2*o)+f*(a*d+f+2*l)+c}else f=r,d=Math.max(0,-(a*f+o)),m=-d*d+f*(f+2*l)+c;else f=-r,d=Math.max(0,-(a*f+o)),m=-d*d+f*(f+2*l)+c;else f<=-g?(d=Math.max(0,-(-a*r+o)),f=d>0?-r:Math.min(Math.max(-r,-l),r),m=-d*d+f*(f+2*l)+c):f<=g?(d=0,f=Math.min(Math.max(-r,-l),r),m=f*(f+2*l)+c):(d=Math.max(0,-(a*r+o)),f=d>0?r:Math.min(Math.max(-r,-l),r),m=-d*d+f*(f+2*l)+c);else f=a>0?-r:r,d=Math.max(0,-(a*f+o)),m=-d*d+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,d),s&&s.copy(dr).addScaledVector(hs,f),m}intersectSphere(t,e){fn.subVectors(t.center,this.origin);const n=fn.dot(this.direction),s=fn.dot(fn)-n*n,r=t.radius*t.radius;if(s>r)return null;const a=Math.sqrt(r-s),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,s,r,a,o,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(n=(t.min.x-f.x)*c,s=(t.max.x-f.x)*c):(n=(t.max.x-f.x)*c,s=(t.min.x-f.x)*c),u>=0?(r=(t.min.y-f.y)*u,a=(t.max.y-f.y)*u):(r=(t.max.y-f.y)*u,a=(t.min.y-f.y)*u),n>a||r>s||((r>n||isNaN(n))&&(n=r),(a=0?(o=(t.min.z-f.z)*d,l=(t.max.z-f.z)*d):(o=(t.max.z-f.z)*d,l=(t.min.z-f.z)*d),n>l||o>s)||((o>n||n!==n)&&(n=o),(l=0?n:s,e)}intersectsBox(t){return this.intersectBox(t,fn)!==null}intersectTriangle(t,e,n,s,r){fr.subVectors(e,t),us.subVectors(n,t),pr.crossVectors(fr,us);let a=this.direction.dot(pr),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;wn.subVectors(this.origin,t);const l=o*this.direction.dot(us.crossVectors(wn,us));if(l<0)return null;const c=o*this.direction.dot(fr.cross(wn));if(c<0||l+c>a)return null;const u=-o*wn.dot(pr);return u<0?null:this.at(u/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ne{constructor(t,e,n,s,r,a,o,l,c,u,d,f,m,g,x,p){ne.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,l,c,u,d,f,m,g,x,p)}set(t,e,n,s,r,a,o,l,c,u,d,f,m,g,x,p){const h=this.elements;return h[0]=t,h[4]=e,h[8]=n,h[12]=s,h[1]=r,h[5]=a,h[9]=o,h[13]=l,h[2]=c,h[6]=u,h[10]=d,h[14]=f,h[3]=m,h[7]=g,h[11]=x,h[15]=p,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new ne().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,s=1/li.setFromMatrixColumn(t,0).length(),r=1/li.setFromMatrixColumn(t,1).length(),a=1/li.setFromMatrixColumn(t,2).length();return e[0]=n[0]*s,e[1]=n[1]*s,e[2]=n[2]*s,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,s=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),d=Math.sin(r);if(t.order==="XYZ"){const f=a*u,m=a*d,g=o*u,x=o*d;e[0]=l*u,e[4]=-l*d,e[8]=c,e[1]=m+g*c,e[5]=f-x*c,e[9]=-o*l,e[2]=x-f*c,e[6]=g+m*c,e[10]=a*l}else if(t.order==="YXZ"){const f=l*u,m=l*d,g=c*u,x=c*d;e[0]=f+x*o,e[4]=g*o-m,e[8]=a*c,e[1]=a*d,e[5]=a*u,e[9]=-o,e[2]=m*o-g,e[6]=x+f*o,e[10]=a*l}else if(t.order==="ZXY"){const f=l*u,m=l*d,g=c*u,x=c*d;e[0]=f-x*o,e[4]=-a*d,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*u,e[9]=x-f*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const f=a*u,m=a*d,g=o*u,x=o*d;e[0]=l*u,e[4]=g*c-m,e[8]=f*c+x,e[1]=l*d,e[5]=x*c+f,e[9]=m*c-g,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const f=a*l,m=a*c,g=o*l,x=o*c;e[0]=l*u,e[4]=x-f*d,e[8]=g*d+m,e[1]=d,e[5]=a*u,e[9]=-o*u,e[2]=-c*u,e[6]=m*d+g,e[10]=f-x*d}else if(t.order==="XZY"){const f=a*l,m=a*c,g=o*l,x=o*c;e[0]=l*u,e[4]=-d,e[8]=c*u,e[1]=f*d+x,e[5]=a*u,e[9]=m*d-g,e[2]=g*d-m,e[6]=o*u,e[10]=x*d+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(yh,t,Eh)}lookAt(t,e,n){const s=this.elements;return Be.subVectors(t,e),Be.lengthSq()===0&&(Be.z=1),Be.normalize(),Rn.crossVectors(n,Be),Rn.lengthSq()===0&&(Math.abs(n.z)===1?Be.x+=1e-4:Be.z+=1e-4,Be.normalize(),Rn.crossVectors(n,Be)),Rn.normalize(),ds.crossVectors(Be,Rn),s[0]=Rn.x,s[4]=ds.x,s[8]=Be.x,s[1]=Rn.y,s[5]=ds.y,s[9]=Be.y,s[2]=Rn.z,s[6]=ds.z,s[10]=Be.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],u=n[1],d=n[5],f=n[9],m=n[13],g=n[2],x=n[6],p=n[10],h=n[14],A=n[3],b=n[7],E=n[11],D=n[15],w=s[0],R=s[4],N=s[8],y=s[12],M=s[1],C=s[5],W=s[9],H=s[13],q=s[2],J=s[6],X=s[10],at=s[14],k=s[3],ut=s[7],xt=s[11],Rt=s[15];return r[0]=a*w+o*M+l*q+c*k,r[4]=a*R+o*C+l*J+c*ut,r[8]=a*N+o*W+l*X+c*xt,r[12]=a*y+o*H+l*at+c*Rt,r[1]=u*w+d*M+f*q+m*k,r[5]=u*R+d*C+f*J+m*ut,r[9]=u*N+d*W+f*X+m*xt,r[13]=u*y+d*H+f*at+m*Rt,r[2]=g*w+x*M+p*q+h*k,r[6]=g*R+x*C+p*J+h*ut,r[10]=g*N+x*W+p*X+h*xt,r[14]=g*y+x*H+p*at+h*Rt,r[3]=A*w+b*M+E*q+D*k,r[7]=A*R+b*C+E*J+D*ut,r[11]=A*N+b*W+E*X+D*xt,r[15]=A*y+b*H+E*at+D*Rt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],s=t[8],r=t[12],a=t[1],o=t[5],l=t[9],c=t[13],u=t[2],d=t[6],f=t[10],m=t[14],g=t[3],x=t[7],p=t[11],h=t[15];return g*(+r*l*d-s*c*d-r*o*f+n*c*f+s*o*m-n*l*m)+x*(+e*l*m-e*c*f+r*a*f-s*a*m+s*c*u-r*l*u)+p*(+e*c*d-e*o*m-r*a*d+n*a*m+r*o*u-n*c*u)+h*(-s*o*u-e*l*d+e*o*f+s*a*d-n*a*f+n*l*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],u=t[8],d=t[9],f=t[10],m=t[11],g=t[12],x=t[13],p=t[14],h=t[15],A=d*p*c-x*f*c+x*l*m-o*p*m-d*l*h+o*f*h,b=g*f*c-u*p*c-g*l*m+a*p*m+u*l*h-a*f*h,E=u*x*c-g*d*c+g*o*m-a*x*m-u*o*h+a*d*h,D=g*d*l-u*x*l-g*o*f+a*x*f+u*o*p-a*d*p,w=e*A+n*b+s*E+r*D;if(w===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/w;return t[0]=A*R,t[1]=(x*f*r-d*p*r-x*s*m+n*p*m+d*s*h-n*f*h)*R,t[2]=(o*p*r-x*l*r+x*s*c-n*p*c-o*s*h+n*l*h)*R,t[3]=(d*l*r-o*f*r-d*s*c+n*f*c+o*s*m-n*l*m)*R,t[4]=b*R,t[5]=(u*p*r-g*f*r+g*s*m-e*p*m-u*s*h+e*f*h)*R,t[6]=(g*l*r-a*p*r-g*s*c+e*p*c+a*s*h-e*l*h)*R,t[7]=(a*f*r-u*l*r+u*s*c-e*f*c-a*s*m+e*l*m)*R,t[8]=E*R,t[9]=(g*d*r-u*x*r-g*n*m+e*x*m+u*n*h-e*d*h)*R,t[10]=(a*x*r-g*o*r+g*n*c-e*x*c-a*n*h+e*o*h)*R,t[11]=(u*o*r-a*d*r-u*n*c+e*d*c+a*n*m-e*o*m)*R,t[12]=D*R,t[13]=(u*x*s-g*d*s+g*n*f-e*x*f-u*n*p+e*d*p)*R,t[14]=(g*o*s-a*x*s-g*n*l+e*x*l+a*n*p-e*o*p)*R,t[15]=(a*d*s-u*o*s+u*n*l-e*d*l-a*n*f+e*o*f)*R,this}scale(t){const e=this.elements,n=t.x,s=t.y,r=t.z;return e[0]*=n,e[4]*=s,e[8]*=r,e[1]*=n,e[5]*=s,e[9]*=r,e[2]*=n,e[6]*=s,e[10]*=r,e[3]*=n,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,s))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),s=Math.sin(e),r=1-n,a=t.x,o=t.y,l=t.z,c=r*a,u=r*o;return this.set(c*a+n,c*o-s*l,c*l+s*o,0,c*o+s*l,u*o+n,u*l-s*a,0,c*l-s*o,u*l+s*a,r*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,s,r,a){return this.set(1,n,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,n){const s=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,u=a+a,d=o+o,f=r*c,m=r*u,g=r*d,x=a*u,p=a*d,h=o*d,A=l*c,b=l*u,E=l*d,D=n.x,w=n.y,R=n.z;return s[0]=(1-(x+h))*D,s[1]=(m+E)*D,s[2]=(g-b)*D,s[3]=0,s[4]=(m-E)*w,s[5]=(1-(f+h))*w,s[6]=(p+A)*w,s[7]=0,s[8]=(g+b)*R,s[9]=(p-A)*R,s[10]=(1-(f+x))*R,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,n){const s=this.elements;let r=li.set(s[0],s[1],s[2]).length();const a=li.set(s[4],s[5],s[6]).length(),o=li.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],$e.copy(this);const c=1/r,u=1/a,d=1/o;return $e.elements[0]*=c,$e.elements[1]*=c,$e.elements[2]*=c,$e.elements[4]*=u,$e.elements[5]*=u,$e.elements[6]*=u,$e.elements[8]*=d,$e.elements[9]*=d,$e.elements[10]*=d,e.setFromRotationMatrix($e),n.x=r,n.y=a,n.z=o,this}makePerspective(t,e,n,s,r,a,o=xn){const l=this.elements,c=2*r/(e-t),u=2*r/(n-s),d=(e+t)/(e-t),f=(n+s)/(n-s);let m,g;if(o===xn)m=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===Ys)m=-a/(a-r),g=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,s,r,a,o=xn){const l=this.elements,c=1/(e-t),u=1/(n-s),d=1/(a-r),f=(e+t)*c,m=(n+s)*u;let g,x;if(o===xn)g=(a+r)*d,x=-2*d;else if(o===Ys)g=r*d,x=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=x,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let s=0;s<16;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const li=new P,$e=new ne,yh=new P(0,0,0),Eh=new P(1,1,1),Rn=new P,ds=new P,Be=new P,po=new ne,mo=new Jn;class hn{constructor(t=0,e=0,n=0,s=hn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,s=this._order){return this._x=t,this._y=e,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const s=t.elements,r=s[0],a=s[4],o=s[8],l=s[1],c=s[5],u=s[9],d=s[2],f=s[6],m=s[10];switch(e){case"XYZ":this._y=Math.asin(jt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-jt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(jt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-jt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(jt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-jt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return po.makeRotationFromQuaternion(t),this.setFromRotationMatrix(po,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return mo.setFromEuler(this),this.setFromQuaternion(mo,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}hn.DEFAULT_ORDER="XYZ";class Xa{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let n=0;n0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){s.children=[];for(let o=0;o0){s.animations=[];for(let o=0;o0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),m.length>0&&(n.animations=m),g.length>0&&(n.nodes=g)}return n.object=s,n;function a(o){const l=[];for(const c in o){const u=o[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,n,s,r){Je.subVectors(s,e),mn.subVectors(n,e),_r.subVectors(t,e);const a=Je.dot(Je),o=Je.dot(mn),l=Je.dot(_r),c=mn.dot(mn),u=mn.dot(_r),d=a*c-o*o;if(d===0)return r.set(0,0,0),null;const f=1/d,m=(c*l-o*u)*f,g=(a*u-o*l)*f;return r.set(1-m-g,g,m)}static containsPoint(t,e,n,s){return this.getBarycoord(t,e,n,s,_n)===null?!1:_n.x>=0&&_n.y>=0&&_n.x+_n.y<=1}static getInterpolation(t,e,n,s,r,a,o,l){return this.getBarycoord(t,e,n,s,_n)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,_n.x),l.addScaledVector(a,_n.y),l.addScaledVector(o,_n.z),l)}static getInterpolatedAttribute(t,e,n,s,r,a){return Mr.setScalar(0),Sr.setScalar(0),yr.setScalar(0),Mr.fromBufferAttribute(t,e),Sr.fromBufferAttribute(t,n),yr.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(Mr,r.x),a.addScaledVector(Sr,r.y),a.addScaledVector(yr,r.z),a}static isFrontFacing(t,e,n,s){return Je.subVectors(n,e),mn.subVectors(t,e),Je.cross(mn).dot(s)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,s){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,n,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Je.subVectors(this.c,this.b),mn.subVectors(this.a,this.b),Je.cross(mn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return qe.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return qe.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,s,r){return qe.getInterpolation(t,this.a,this.b,this.c,e,n,s,r)}containsPoint(t){return qe.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return qe.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,s=this.b,r=this.c;let a,o;ui.subVectors(s,n),di.subVectors(r,n),gr.subVectors(t,n);const l=ui.dot(gr),c=di.dot(gr);if(l<=0&&c<=0)return e.copy(n);vr.subVectors(t,s);const u=ui.dot(vr),d=di.dot(vr);if(u>=0&&d<=u)return e.copy(s);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),e.copy(n).addScaledVector(ui,a);xr.subVectors(t,r);const m=ui.dot(xr),g=di.dot(xr);if(g>=0&&m<=g)return e.copy(r);const x=m*c-l*g;if(x<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(n).addScaledVector(di,o);const p=u*g-m*d;if(p<=0&&d-u>=0&&m-g>=0)return So.subVectors(r,s),o=(d-u)/(d-u+(m-g)),e.copy(s).addScaledVector(So,o);const h=1/(p+x+f);return a=x*h,o=f*h,e.copy(n).addScaledVector(ui,a).addScaledVector(di,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const kl={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},Cn={h:0,s:0,l:0},ps={h:0,s:0,l:0};function Er(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}class Dt{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){const s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ye){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Qt.toWorkingColorSpace(this,e),this}setRGB(t,e,n,s=Qt.workingColorSpace){return this.r=t,this.g=e,this.b=n,Qt.toWorkingColorSpace(this,s),this}setHSL(t,e,n,s=Qt.workingColorSpace){if(t=ch(t,1),e=jt(e,0,1),n=jt(n,0,1),e===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,a=2*n-r;this.r=Er(a,r,t+1/3),this.g=Er(a,r,t),this.b=Er(a,r,t-1/3)}return Qt.toWorkingColorSpace(this,s),this}setStyle(t,e=Ye){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Ye){const n=kl[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=yn(t.r),this.g=yn(t.g),this.b=yn(t.b),this}copyLinearToSRGB(t){return this.r=Ci(t.r),this.g=Ci(t.g),this.b=Ci(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ye){return Qt.fromWorkingColorSpace(Te.copy(this),t),Math.round(jt(Te.r*255,0,255))*65536+Math.round(jt(Te.g*255,0,255))*256+Math.round(jt(Te.b*255,0,255))}getHexString(t=Ye){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Qt.workingColorSpace){Qt.fromWorkingColorSpace(Te.copy(this),e);const n=Te.r,s=Te.g,r=Te.b,a=Math.max(n,s,r),o=Math.min(n,s,r);let l,c;const u=(o+a)/2;if(o===a)l=0,c=0;else{const d=a-o;switch(c=u<=.5?d/(a+o):d/(2-a-o),a){case n:l=(s-r)/d+(s0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==wi&&(n.blending=this.blending),this.side!==Nn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Gr&&(n.blendSrc=this.blendSrc),this.blendDst!==Wr&&(n.blendDst=this.blendDst),this.blendEquation!==qn&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Pi&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==oo&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ii&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ii&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ii&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=s(t.textures),a=s(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const s=e.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class tr extends Fn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Dt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new hn,this.combine=Tl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const fe=new P,ms=new At;class ve{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=Ra,this.updateRanges=[],this.gpuType=cn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ti);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new P(-1/0,-1/0,-1/0),new P(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,s=e.length;n0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const c=n[l];t.data.attributes[l]=c.toJSON(t.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(s[l]=u,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const s=t.attributes;for(const c in s){const u=s[c];this.setAttribute(c,u.clone(e))}const r=t.morphAttributes;for(const c in r){const u=[],d=r[c];for(let f=0,m=d.length;f0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(yo.copy(r).invert(),Vn.copy(t.ray).applyMatrix4(yo),!(n.boundingBox!==null&&Vn.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Vn)))}_computeIntersections(t,e,n){let s;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,u=r.attributes.uv1,d=r.attributes.normal,f=r.groups,m=r.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,x=f.length;ge.far?null:{distance:c,point:Ss.clone(),object:i}}function ys(i,t,e,n,s,r,a,o,l,c){i.getVertexPosition(o,gs),i.getVertexPosition(l,vs),i.getVertexPosition(c,xs);const u=Ph(i,t,e,n,gs,vs,xs,To);if(u){const d=new P;qe.getBarycoord(To,gs,vs,xs,d),s&&(u.uv=qe.getInterpolatedAttribute(s,o,l,c,d,new At)),r&&(u.uv1=qe.getInterpolatedAttribute(r,o,l,c,d,new At)),a&&(u.normal=qe.getInterpolatedAttribute(a,o,l,c,d,new P),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new P,materialIndex:0};qe.getNormal(gs,vs,xs,f.normal),u.face=f,u.barycoord=d}return u}class es extends xe{constructor(t=1,e=1,n=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:s,heightSegments:r,depthSegments:a};const o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],u=[],d=[];let f=0,m=0;g("z","y","x",-1,-1,n,e,t,a,r,0),g("z","y","x",1,-1,n,e,-t,a,r,1),g("x","z","y",1,1,t,n,e,s,a,2),g("x","z","y",1,-1,t,n,-e,s,a,3),g("x","y","z",1,-1,t,e,n,s,r,4),g("x","y","z",-1,-1,t,e,-n,s,r,5),this.setIndex(l),this.setAttribute("position",new we(c,3)),this.setAttribute("normal",new we(u,3)),this.setAttribute("uv",new we(d,2));function g(x,p,h,A,b,E,D,w,R,N,y){const M=E/R,C=D/N,W=E/2,H=D/2,q=w/2,J=R+1,X=N+1;let at=0,k=0;const ut=new P;for(let xt=0;xt0?1:-1,u.push(ut.x,ut.y,ut.z),d.push(Vt/R),d.push(1-xt/N),at+=1}}for(let xt=0;xt0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Xl extends Se{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ne,this.projectionMatrix=new ne,this.projectionMatrixInverse=new ne,this.coordinateSystem=xn}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Pn=new P,bo=new At,Ao=new At;class He extends Xl{constructor(t=50,e=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=Ca*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(ks*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Ca*2*Math.atan(Math.tan(ks*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Pn.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Pn.x,Pn.y).multiplyScalar(-t/Pn.z),Pn.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Pn.x,Pn.y).multiplyScalar(-t/Pn.z)}getViewSize(t,e){return this.getViewBounds(t,bo,Ao),e.subVectors(Ao,bo)}setViewOffset(t,e,n,s,r,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(ks*.5*this.fov)/this.zoom,n=2*e,s=this.aspect*n,r=-.5*s;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*s/l,e-=a.offsetY*n/c,s*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const pi=-90,mi=1;class Ih extends Se{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new He(pi,mi,t,e);s.layers=this.layers,this.add(s);const r=new He(pi,mi,t,e);r.layers=this.layers,this.add(r);const a=new He(pi,mi,t,e);a.layers=this.layers,this.add(a);const o=new He(pi,mi,t,e);o.layers=this.layers,this.add(o);const l=new He(pi,mi,t,e);l.layers=this.layers,this.add(l);const c=new He(pi,mi,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,s,r,a,o,l]=e;for(const c of e)this.remove(c);if(t===xn)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===Ys)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,u]=this.children,d=t.getRenderTarget(),f=t.getActiveCubeFace(),m=t.getActiveMipmapLevel(),g=t.xr.enabled;t.xr.enabled=!1;const x=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,s),t.render(e,r),t.setRenderTarget(n,1,s),t.render(e,a),t.setRenderTarget(n,2,s),t.render(e,o),t.setRenderTarget(n,3,s),t.render(e,l),t.setRenderTarget(n,4,s),t.render(e,c),n.texture.generateMipmaps=x,t.setRenderTarget(n,5,s),t.render(e,u),t.setRenderTarget(d,f,m),t.xr.enabled=g,n.texture.needsPMREMUpdate=!0}}class Yl extends Ae{constructor(t,e,n,s,r,a,o,l,c,u){t=t!==void 0?t:[],e=e!==void 0?e:Di,super(t,e,n,s,r,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Nh extends en{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},s=[n,n,n,n,n,n];this.texture=new Yl(s,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:ln}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},s=new es(5,5,5),r=new Ie({name:"CubemapFromEquirect",uniforms:Fi(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Ne,blending:Mn});r.uniforms.tEquirect.value=e;const a=new De(s,r),o=e.minFilter;return e.minFilter===Kn&&(e.minFilter=ln),new Ih(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,s){const r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,s);t.setRenderTarget(r)}}class Zs{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new Dt(t),this.density=e}clone(){return new Zs(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Fh extends Se{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new hn,this.environmentIntensity=1,this.environmentRotation=new hn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class Oh{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Ra,this.updateRanges=[],this.version=0,this.uuid=In()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let s=0,r=this.stride;st.far||e.push({distance:l,point:Xi.clone(),uv:qe.getInterpolation(Xi,Es,qi,Ts,wo,Ar,Ro,new At),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function bs(i,t,e,n,s,r){xi.subVectors(i,e).addScalar(.5).multiply(n),s!==void 0?(Yi.x=r*xi.x-s*xi.y,Yi.y=s*xi.x+r*xi.y):Yi.copy(xi),i.copy(t),i.x+=Yi.x,i.y+=Yi.y,i.applyMatrix4(ql)}class Bh extends Ae{constructor(t=null,e=1,n=1,s,r,a,o,l,c=ke,u=ke,d,f){super(null,a,o,l,c,u,s,r,d,f),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Po extends ve{constructor(t,e,n,s=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const Mi=new ne,Do=new ne,As=[],Lo=new ti,zh=new ne,ji=new De,Zi=new ei;class Hh extends De{constructor(t,e,n){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new Po(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Vh.getNormalMatrix(t),s=this.coplanarPoint(wr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Gn=new ei,ws=new P;class Ya{constructor(t=new Dn,e=new Dn,n=new Dn,s=new Dn,r=new Dn,a=new Dn){this.planes=[t,e,n,s,r,a]}set(t,e,n,s,r,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(s),o[4].copy(r),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=xn){const n=this.planes,s=t.elements,r=s[0],a=s[1],o=s[2],l=s[3],c=s[4],u=s[5],d=s[6],f=s[7],m=s[8],g=s[9],x=s[10],p=s[11],h=s[12],A=s[13],b=s[14],E=s[15];if(n[0].setComponents(l-r,f-c,p-m,E-h).normalize(),n[1].setComponents(l+r,f+c,p+m,E+h).normalize(),n[2].setComponents(l+a,f+u,p+g,E+A).normalize(),n[3].setComponents(l-a,f-u,p-g,E-A).normalize(),n[4].setComponents(l-o,f-d,p-x,E-b).normalize(),e===xn)n[5].setComponents(l+o,f+d,p+x,E+b).normalize();else if(e===Ys)n[5].setComponents(o,d,x,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Gn.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Gn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Gn)}intersectsSprite(t){return Gn.center.set(0,0,0),Gn.radius=.7071067811865476,Gn.applyMatrix4(t.matrixWorld),this.intersectsSphere(Gn)}intersectsSphere(t){const e=this.planes,n=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(n)0?t.max.x:t.min.x,ws.y=s.normal.y>0?t.max.y:t.min.y,ws.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(ws)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Da extends Fn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Dt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const $s=new P,Js=new P,Uo=new ne,Ki=new ts,Rs=new ei,Rr=new P,Io=new P;class No extends Se{constructor(t=new xe,e=new Da){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[0];for(let s=1,r=e.count;s0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rn)return;Rr.applyMatrix4(i.matrixWorld);const l=t.ray.origin.distanceTo(Rr);if(!(lt.far))return{distance:l,point:Io.clone().applyMatrix4(i.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:i}}class Vs extends Fn{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Dt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}const Fo=new ne,La=new ts,Ps=new ei,Ds=new P;class Cr extends Se{constructor(t=new xe,e=new Vs){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,s=this.matrixWorld,r=t.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ps.copy(n.boundingSphere),Ps.applyMatrix4(s),Ps.radius+=r,t.ray.intersectsSphere(Ps)===!1)return;Fo.copy(s).invert(),La.copy(t.ray).applyMatrix4(Fo);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,d=n.attributes.position;if(c!==null){const f=Math.max(0,a.start),m=Math.min(c.count,a.start+a.count);for(let g=f,x=m;g0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class Ti extends Se{constructor(){super(),this.isGroup=!0,this.type="Group"}}class Gh extends Ae{constructor(t,e,n,s,r,a,o,l,c){super(t,e,n,s,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class jl extends Ae{constructor(t,e,n,s,r,a,o,l,c,u=Ri){if(u!==Ri&&u!==Ii)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Ri&&(n=$n),n===void 0&&u===Ii&&(n=Ui),super(null,s,r,a,o,l,u,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:ke,this.minFilter=l!==void 0?l:ke,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}class er extends xe{constructor(t=1,e=1,n=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:s};const r=t/2,a=e/2,o=Math.floor(n),l=Math.floor(s),c=o+1,u=l+1,d=t/o,f=e/l,m=[],g=[],x=[],p=[];for(let h=0;h0)&&m.push(b,E,w),(h!==n-1||lm.start-g.start);let f=0;for(let m=1;m 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #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 -#endif`,vu=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,xu=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,Mu=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,Su=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,yu=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,Eu=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - varying vec3 vColor; -#endif`,Tu=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif -#ifdef USE_BATCHING_COLOR - vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); - vColor.xyz *= batchingColor.xyz; -#endif`,bu=`#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; -} -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`,Au=`#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_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #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`,wu=`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`,Ru=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,Cu=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,Pu=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE - emissiveColor = sRGBTransferEOTF( emissiveColor ); - #endif - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,Du=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,Lu="gl_FragColor = linearToOutputTexel( gl_FragColor );",Uu=`vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferEOTF( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -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 ); -}`,Iu=`#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, envMapRotation * 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`,Nu=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform mat3 envMapRotation; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,Fu=`#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`,Ou=`#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`,Bu=`#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`,zu=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,Hu=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,ku=`#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`,Vu=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Gu=`#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 -}`,Wu=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,Xu=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,Yu=`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`,qu=`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 ) { - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -} -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`,ju=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * 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, envMapRotation * 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`,Zu=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,Ku=`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`,$u=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,Ju=`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`,Qu=`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_DISPERSION - material.dispersion = dispersion; -#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`,td=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - float dispersion; - #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 ); -}`,ed=` -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.shadowIntensity, 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.shadowIntensity, 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.shadowIntensity, 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`,nd=`#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`,id=`#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`,sd=`#if defined( USE_LOGDEPTHBUF ) - gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,rd=`#if defined( USE_LOGDEPTHBUF ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,ad=`#ifdef USE_LOGDEPTHBUF - varying float vFragDepth; - varying float vIsPerspective; -#endif`,od=`#ifdef USE_LOGDEPTHBUF - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,ld=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,cd=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,hd=`#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`,ud=`#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`,dd=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,fd=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,pd=`#ifdef USE_INSTANCING_MORPH - float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; - } -#endif`,md=`#if defined( USE_MORPHCOLORS ) - 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`,_d=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,gd=`#ifdef USE_MORPHTARGETS - #ifndef USE_INSTANCING_MORPH - uniform float morphTargetBaseInfluence; - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - #endif - 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 ); - } -#endif`,vd=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,xd=`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;`,Md=`#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`,Sd=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,yd=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,Ed=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,Td=`#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`,bd=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,Ad=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,wd=`#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`,Rd=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,Cd=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Pd=`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 float ShiftRight8 = 1. / 256.; -const float Inv255 = 1. / 255.; -const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); -const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); -const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); -const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); -vec4 packDepthToRGBA( const in float v ) { - if( v <= 0.0 ) - return vec4( 0., 0., 0., 0. ); - if( v >= 1.0 ) - return vec4( 1., 1., 1., 1. ); - float vuf; - float af = modf( v * PackFactors.a, vuf ); - float bf = modf( vuf * ShiftRight8, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); -} -vec3 packDepthToRGB( const in float v ) { - if( v <= 0.0 ) - return vec3( 0., 0., 0. ); - if( v >= 1.0 ) - return vec3( 1., 1., 1. ); - float vuf; - float bf = modf( v * PackFactors.b, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec3( vuf * Inv255, gf * PackUpscale, bf ); -} -vec2 packDepthToRG( const in float v ) { - if( v <= 0.0 ) - return vec2( 0., 0. ); - if( v >= 1.0 ) - return vec2( 1., 1. ); - float vuf; - float gf = modf( v * 256., vuf ); - return vec2( vuf * Inv255, gf ); -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors4 ); -} -float unpackRGBToDepth( const in vec3 v ) { - return dot( v, UnpackFactors3 ); -} -float unpackRGToDepth( const in vec2 v ) { - return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; -} -vec4 pack2HalfToRGBA( const in 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( const in 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 ); -}`,Dd=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,Ld=`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;`,Ud=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,Id=`#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`,Nd=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,Fd=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,Od=`#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 shadowIntensity; - 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 shadowIntensity; - 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 shadowIntensity; - 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 shadowIntensity, 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 mix( 1.0, shadow, shadowIntensity ); - } - 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 shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - float shadow = 1.0; - vec3 lightToPosition = shadowCoord.xyz; - - float lightToPositionLength = length( lightToPosition ); - if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { - float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - shadow = ( - 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 - shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } -#endif`,Bd=`#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 shadowIntensity; - 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 shadowIntensity; - 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 shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,zd=`#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`,Hd=`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.shadowIntensity, 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.shadowIntensity, 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.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,kd=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,Vd=`#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`,Gd=`#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`,Wd=`#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`,Xd=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,Yd=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,qd=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,jd=`#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 CineonToneMapping( 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 ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 NeutralToneMapping( vec3 color ) { - const float StartCompression = 0.8 - 0.04; - const float Desaturation = 0.15; - color *= toneMappingExposure; - float x = min( color.r, min( color.g, color.b ) ); - float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; - color -= offset; - float peak = max( color.r, max( color.g, color.b ) ); - if ( peak < StartCompression ) return color; - float d = 1. - StartCompression; - float newPeak = 1. - d * d / ( peak + d - StartCompression ); - color *= newPeak / peak; - float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); - return mix( color, vec3( newPeak ), g ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,Zd=`#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.dispersion, 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`,Kd=`#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 dispersion, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec4 transmittedLight; - vec3 transmittance; - #ifdef USE_DISPERSION - float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; - vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); - for ( int i = 0; i < 3; i ++ ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], 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 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); - transmittedLight[ i ] = transmissionSample[ i ]; - transmittedLight.a += transmissionSample.a; - transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; - } - transmittedLight.a /= 3.0; - #else - 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; - transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - #endif - 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`,$d=`#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`,Jd=`#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`,Qd=`#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`,tf=`#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 ef=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,nf=`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 -}`,sf=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,rf=`#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; -uniform mat3 backgroundRotation; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,af=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,of=`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 -}`,lf=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,cf=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #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 ); - #elif DEPTH_PACKING == 3202 - gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); - #elif DEPTH_PACKING == 3203 - gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); - #endif -}`,hf=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,uf=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,df=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,ff=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,pf=`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 - #include -}`,mf=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,_f=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #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 -}`,gf=`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() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #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 -}`,vf=`#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 - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,xf=`#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() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - 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 -}`,Mf=`#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 - #include - vViewPosition = - mvPosition.xyz; -}`,Sf=`#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() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #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 -}`,yf=`#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 - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,Ef=`#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() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,Tf=`#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 - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,bf=`#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() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - 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 -}`,Af=`#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 - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,wf=`#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_DISPERSION - uniform float dispersion; -#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() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - 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 -}`,Rf=`#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 - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,Cf=`#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() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - 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 -}`,Pf=`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 - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,Df=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,Lf=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,Uf=`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 -}`,If=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix[ 3 ]; - vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); - #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 -}`,Nf=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,Xt={alphahash_fragment:nu,alphahash_pars_fragment:iu,alphamap_fragment:su,alphamap_pars_fragment:ru,alphatest_fragment:au,alphatest_pars_fragment:ou,aomap_fragment:lu,aomap_pars_fragment:cu,batching_pars_vertex:hu,batching_vertex:uu,begin_vertex:du,beginnormal_vertex:fu,bsdfs:pu,iridescence_fragment:mu,bumpmap_pars_fragment:_u,clipping_planes_fragment:gu,clipping_planes_pars_fragment:vu,clipping_planes_pars_vertex:xu,clipping_planes_vertex:Mu,color_fragment:Su,color_pars_fragment:yu,color_pars_vertex:Eu,color_vertex:Tu,common:bu,cube_uv_reflection_fragment:Au,defaultnormal_vertex:wu,displacementmap_pars_vertex:Ru,displacementmap_vertex:Cu,emissivemap_fragment:Pu,emissivemap_pars_fragment:Du,colorspace_fragment:Lu,colorspace_pars_fragment:Uu,envmap_fragment:Iu,envmap_common_pars_fragment:Nu,envmap_pars_fragment:Fu,envmap_pars_vertex:Ou,envmap_physical_pars_fragment:ju,envmap_vertex:Bu,fog_vertex:zu,fog_pars_vertex:Hu,fog_fragment:ku,fog_pars_fragment:Vu,gradientmap_pars_fragment:Gu,lightmap_pars_fragment:Wu,lights_lambert_fragment:Xu,lights_lambert_pars_fragment:Yu,lights_pars_begin:qu,lights_toon_fragment:Zu,lights_toon_pars_fragment:Ku,lights_phong_fragment:$u,lights_phong_pars_fragment:Ju,lights_physical_fragment:Qu,lights_physical_pars_fragment:td,lights_fragment_begin:ed,lights_fragment_maps:nd,lights_fragment_end:id,logdepthbuf_fragment:sd,logdepthbuf_pars_fragment:rd,logdepthbuf_pars_vertex:ad,logdepthbuf_vertex:od,map_fragment:ld,map_pars_fragment:cd,map_particle_fragment:hd,map_particle_pars_fragment:ud,metalnessmap_fragment:dd,metalnessmap_pars_fragment:fd,morphinstance_vertex:pd,morphcolor_vertex:md,morphnormal_vertex:_d,morphtarget_pars_vertex:gd,morphtarget_vertex:vd,normal_fragment_begin:xd,normal_fragment_maps:Md,normal_pars_fragment:Sd,normal_pars_vertex:yd,normal_vertex:Ed,normalmap_pars_fragment:Td,clearcoat_normal_fragment_begin:bd,clearcoat_normal_fragment_maps:Ad,clearcoat_pars_fragment:wd,iridescence_pars_fragment:Rd,opaque_fragment:Cd,packing:Pd,premultiplied_alpha_fragment:Dd,project_vertex:Ld,dithering_fragment:Ud,dithering_pars_fragment:Id,roughnessmap_fragment:Nd,roughnessmap_pars_fragment:Fd,shadowmap_pars_fragment:Od,shadowmap_pars_vertex:Bd,shadowmap_vertex:zd,shadowmask_pars_fragment:Hd,skinbase_vertex:kd,skinning_pars_vertex:Vd,skinning_vertex:Gd,skinnormal_vertex:Wd,specularmap_fragment:Xd,specularmap_pars_fragment:Yd,tonemapping_fragment:qd,tonemapping_pars_fragment:jd,transmission_fragment:Zd,transmission_pars_fragment:Kd,uv_pars_fragment:$d,uv_pars_vertex:Jd,uv_vertex:Qd,worldpos_vertex:tf,background_vert:ef,background_frag:nf,backgroundCube_vert:sf,backgroundCube_frag:rf,cube_vert:af,cube_frag:of,depth_vert:lf,depth_frag:cf,distanceRGBA_vert:hf,distanceRGBA_frag:uf,equirect_vert:df,equirect_frag:ff,linedashed_vert:pf,linedashed_frag:mf,meshbasic_vert:_f,meshbasic_frag:gf,meshlambert_vert:vf,meshlambert_frag:xf,meshmatcap_vert:Mf,meshmatcap_frag:Sf,meshnormal_vert:yf,meshnormal_frag:Ef,meshphong_vert:Tf,meshphong_frag:bf,meshphysical_vert:Af,meshphysical_frag:wf,meshtoon_vert:Rf,meshtoon_frag:Cf,points_vert:Pf,points_frag:Df,shadow_vert:Lf,shadow_frag:Uf,sprite_vert:If,sprite_frag:Nf},dt={common:{diffuse:{value:new Dt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Wt},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Wt}},envmap:{envMap:{value:null},envMapRotation:{value:new Wt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Wt},normalScale:{value:new At(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Dt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Dt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0},uvTransform:{value:new Wt}},sprite:{diffuse:{value:new Dt(16777215)},opacity:{value:1},center:{value:new At(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Wt},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0}}},rn={basic:{uniforms:Pe([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.fog]),vertexShader:Xt.meshbasic_vert,fragmentShader:Xt.meshbasic_frag},lambert:{uniforms:Pe([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new Dt(0)}}]),vertexShader:Xt.meshlambert_vert,fragmentShader:Xt.meshlambert_frag},phong:{uniforms:Pe([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new Dt(0)},specular:{value:new Dt(1118481)},shininess:{value:30}}]),vertexShader:Xt.meshphong_vert,fragmentShader:Xt.meshphong_frag},standard:{uniforms:Pe([dt.common,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.roughnessmap,dt.metalnessmap,dt.fog,dt.lights,{emissive:{value:new Dt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Xt.meshphysical_vert,fragmentShader:Xt.meshphysical_frag},toon:{uniforms:Pe([dt.common,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.gradientmap,dt.fog,dt.lights,{emissive:{value:new Dt(0)}}]),vertexShader:Xt.meshtoon_vert,fragmentShader:Xt.meshtoon_frag},matcap:{uniforms:Pe([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,{matcap:{value:null}}]),vertexShader:Xt.meshmatcap_vert,fragmentShader:Xt.meshmatcap_frag},points:{uniforms:Pe([dt.points,dt.fog]),vertexShader:Xt.points_vert,fragmentShader:Xt.points_frag},dashed:{uniforms:Pe([dt.common,dt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Xt.linedashed_vert,fragmentShader:Xt.linedashed_frag},depth:{uniforms:Pe([dt.common,dt.displacementmap]),vertexShader:Xt.depth_vert,fragmentShader:Xt.depth_frag},normal:{uniforms:Pe([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,{opacity:{value:1}}]),vertexShader:Xt.meshnormal_vert,fragmentShader:Xt.meshnormal_frag},sprite:{uniforms:Pe([dt.sprite,dt.fog]),vertexShader:Xt.sprite_vert,fragmentShader:Xt.sprite_frag},background:{uniforms:{uvTransform:{value:new Wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Xt.background_vert,fragmentShader:Xt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Wt}},vertexShader:Xt.backgroundCube_vert,fragmentShader:Xt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Xt.cube_vert,fragmentShader:Xt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Xt.equirect_vert,fragmentShader:Xt.equirect_frag},distanceRGBA:{uniforms:Pe([dt.common,dt.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Xt.distanceRGBA_vert,fragmentShader:Xt.distanceRGBA_frag},shadow:{uniforms:Pe([dt.lights,dt.fog,{color:{value:new Dt(0)},opacity:{value:1}}]),vertexShader:Xt.shadow_vert,fragmentShader:Xt.shadow_frag}};rn.physical={uniforms:Pe([rn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Wt},clearcoatNormalScale:{value:new At(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Wt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Wt},sheen:{value:0},sheenColor:{value:new Dt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Wt},transmissionSamplerSize:{value:new At},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Wt},attenuationDistance:{value:0},attenuationColor:{value:new Dt(0)},specularColor:{value:new Dt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Wt},anisotropyVector:{value:new At},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Wt}}]),vertexShader:Xt.meshphysical_vert,fragmentShader:Xt.meshphysical_frag};const Ls={r:0,b:0,g:0},Wn=new hn,Ff=new ne;function Of(i,t,e,n,s,r,a){const o=new Dt(0);let l=r===!0?0:1,c,u,d=null,f=0,m=null;function g(b){let E=b.isScene===!0?b.background:null;return E&&E.isTexture&&(E=(b.backgroundBlurriness>0?e:t).get(E)),E}function x(b){let E=!1;const D=g(b);D===null?h(o,l):D&&D.isColor&&(h(D,1),E=!0);const w=i.xr.getEnvironmentBlendMode();w==="additive"?n.buffers.color.setClear(0,0,0,1,a):w==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||E)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function p(b,E){const D=g(E);D&&(D.isCubeTexture||D.mapping===Qs)?(u===void 0&&(u=new De(new es(1,1,1),new Ie({name:"BackgroundCubeMaterial",uniforms:Fi(rn.backgroundCube.uniforms),vertexShader:rn.backgroundCube.vertexShader,fragmentShader:rn.backgroundCube.fragmentShader,side:Ne,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(w,R,N){this.matrixWorld.copyPosition(N.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),Wn.copy(E.backgroundRotation),Wn.x*=-1,Wn.y*=-1,Wn.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(Wn.y*=-1,Wn.z*=-1),u.material.uniforms.envMap.value=D,u.material.uniforms.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=E.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=E.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Ff.makeRotationFromEuler(Wn)),u.material.toneMapped=Qt.getTransfer(D.colorSpace)!==re,(d!==D||f!==D.version||m!==i.toneMapping)&&(u.material.needsUpdate=!0,d=D,f=D.version,m=i.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):D&&D.isTexture&&(c===void 0&&(c=new De(new er(2,2),new Ie({name:"BackgroundMaterial",uniforms:Fi(rn.background.uniforms),vertexShader:rn.background.vertexShader,fragmentShader:rn.background.fragmentShader,side:Nn,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=D,c.material.uniforms.backgroundIntensity.value=E.backgroundIntensity,c.material.toneMapped=Qt.getTransfer(D.colorSpace)!==re,D.matrixAutoUpdate===!0&&D.updateMatrix(),c.material.uniforms.uvTransform.value.copy(D.matrix),(d!==D||f!==D.version||m!==i.toneMapping)&&(c.material.needsUpdate=!0,d=D,f=D.version,m=i.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function h(b,E){b.getRGB(Ls,Wl(i)),n.buffers.color.setClear(Ls.r,Ls.g,Ls.b,E,a)}function A(){u!==void 0&&(u.geometry.dispose(),u.material.dispose()),c!==void 0&&(c.geometry.dispose(),c.material.dispose())}return{getClearColor:function(){return o},setClearColor:function(b,E=1){o.set(b),l=E,h(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,h(o,l)},render:x,addToRenderList:p,dispose:A}}function Bf(i,t){const e=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=f(null);let r=s,a=!1;function o(M,C,W,H,q){let J=!1;const X=d(H,W,C);r!==X&&(r=X,c(r.object)),J=m(M,H,W,q),J&&g(M,H,W,q),q!==null&&t.update(q,i.ELEMENT_ARRAY_BUFFER),(J||a)&&(a=!1,E(M,C,W,H),q!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(q).buffer))}function l(){return i.createVertexArray()}function c(M){return i.bindVertexArray(M)}function u(M){return i.deleteVertexArray(M)}function d(M,C,W){const H=W.wireframe===!0;let q=n[M.id];q===void 0&&(q={},n[M.id]=q);let J=q[C.id];J===void 0&&(J={},q[C.id]=J);let X=J[H];return X===void 0&&(X=f(l()),J[H]=X),X}function f(M){const C=[],W=[],H=[];for(let q=0;q=0){const xt=q[k];let Rt=J[k];if(Rt===void 0&&(k==="instanceMatrix"&&M.instanceMatrix&&(Rt=M.instanceMatrix),k==="instanceColor"&&M.instanceColor&&(Rt=M.instanceColor)),xt===void 0||xt.attribute!==Rt||Rt&&xt.data!==Rt.data)return!0;X++}return r.attributesNum!==X||r.index!==H}function g(M,C,W,H){const q={},J=C.attributes;let X=0;const at=W.getAttributes();for(const k in at)if(at[k].location>=0){let xt=J[k];xt===void 0&&(k==="instanceMatrix"&&M.instanceMatrix&&(xt=M.instanceMatrix),k==="instanceColor"&&M.instanceColor&&(xt=M.instanceColor));const Rt={};Rt.attribute=xt,xt&&xt.data&&(Rt.data=xt.data),q[k]=Rt,X++}r.attributes=q,r.attributesNum=X,r.index=H}function x(){const M=r.newAttributes;for(let C=0,W=M.length;C=0){let ut=q[at];if(ut===void 0&&(at==="instanceMatrix"&&M.instanceMatrix&&(ut=M.instanceMatrix),at==="instanceColor"&&M.instanceColor&&(ut=M.instanceColor)),ut!==void 0){const xt=ut.normalized,Rt=ut.itemSize,Vt=t.get(ut);if(Vt===void 0)continue;const wt=Vt.buffer,V=Vt.type,it=Vt.bytesPerElement,Mt=V===i.INT||V===i.UNSIGNED_INT||ut.gpuType===Ba;if(ut.isInterleavedBufferAttribute){const ct=ut.data,Ct=ct.stride,Pt=ut.offset;if(ct.isInstancedInterleavedBuffer){for(let nt=0;nt0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=e.logarithmicDepthBuffer===!0,f=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),m=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),x=i.getParameter(i.MAX_TEXTURE_SIZE),p=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),h=i.getParameter(i.MAX_VERTEX_ATTRIBS),A=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),b=i.getParameter(i.MAX_VARYING_VECTORS),E=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),D=g>0,w=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:m,maxVertexTextures:g,maxTextureSize:x,maxCubemapSize:p,maxAttributes:h,maxVertexUniforms:A,maxVaryings:b,maxFragmentUniforms:E,vertexTextures:D,maxSamples:w}}function kf(i){const t=this;let e=null,n=0,s=!1,r=!1;const a=new Dn,o=new Wt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const m=d.length!==0||f||n!==0||s;return s=f,n=d.length,m},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,f){e=u(d,f,0)},this.setState=function(d,f,m){const g=d.clippingPlanes,x=d.clipIntersection,p=d.clipShadows,h=i.get(d);if(!s||g===null||g.length===0||r&&!p)r?u(null):c();else{const A=r?0:n,b=A*4;let E=h.clippingState||null;l.value=E,E=u(g,f,b,m);for(let D=0;D!==b;++D)E[D]=e[D];h.clippingState=E,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=A}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(d,f,m,g){const x=d!==null?d.length:0;let p=null;if(x!==0){if(p=l.value,g!==!0||p===null){const h=m+x*4,A=f.matrixWorldInverse;o.getNormalMatrix(A),(p===null||p.length0){const c=new Nh(l.height);return c.fromEquirectangularTexture(i,a),t.set(a,c),a.addEventListener("dispose",s),e(c.texture,a.mapping)}else return null}}return a}function s(a){const o=a.target;o.removeEventListener("dispose",s);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function r(){t=new WeakMap}return{get:n,dispose:r}}const bi=4,qo=[.125,.215,.35,.446,.526,.582],jn=20,Lr=new Kl,jo=new Dt;let Ur=null,Ir=0,Nr=0,Fr=!1;const Yn=(1+Math.sqrt(5))/2,Si=1/Yn,Zo=[new P(-Yn,Si,0),new P(Yn,Si,0),new P(-Si,0,Yn),new P(Si,0,Yn),new P(0,Yn,-Si),new P(0,Yn,Si),new P(-1,1,-1),new P(1,1,-1),new P(-1,1,1),new P(1,1,1)];class Ko{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,s=100){Ur=this._renderer.getRenderTarget(),Ir=this._renderer.getActiveCubeFace(),Nr=this._renderer.getActiveMipmapLevel(),Fr=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,s,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Qo(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Jo(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?b:0,b,b),u.setRenderTarget(s),x&&u.render(g,o),u.render(t,o)}g.geometry.dispose(),g.material.dispose(),u.toneMapping=f,u.autoClear=d,t.background=p}_textureToCubeUV(t,e){const n=this._renderer,s=t.mapping===Di||t.mapping===Li;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=Qo()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Jo());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new De(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;const l=this._cubeSize;Us(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(a,Lr)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rjn&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${jn}`);const h=[];let A=0;for(let R=0;Rb-bi?s-b+bi:0),w=4*(this._cubeSize-E);Us(e,D,w,3*E,2*E),l.setRenderTarget(e),l.render(d,Lr)}}function Gf(i){const t=[],e=[],n=[];let s=i;const r=i-bi+1+qo.length;for(let a=0;ai-bi?l=qo[a-i+bi-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],m=6,g=6,x=3,p=2,h=1,A=new Float32Array(x*g*m),b=new Float32Array(p*g*m),E=new Float32Array(h*g*m);for(let w=0;w2?0:-1,y=[R,N,0,R+2/3,N,0,R+2/3,N+1,0,R,N,0,R+2/3,N+1,0,R,N+1,0];A.set(y,x*g*w),b.set(f,p*g*w);const M=[w,w,w,w,w,w];E.set(M,h*g*w)}const D=new xe;D.setAttribute("position",new ve(A,x)),D.setAttribute("uv",new ve(b,p)),D.setAttribute("faceIndex",new ve(E,h)),t.push(D),s>bi&&s--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function $o(i,t,e){const n=new en(i,t,e);return n.texture.mapping=Qs,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Us(i,t,e,n,s){i.viewport.set(t,e,n,s),i.scissor.set(t,e,n,s)}function Wf(i,t,e){const n=new Float32Array(jn),s=new P(0,1,0);return new Ie({name:"SphericalGaussianBlur",defines:{n:jn,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Za(),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:Mn,depthTest:!1,depthWrite:!1})}function Jo(){return new Ie({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Za(),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:Mn,depthTest:!1,depthWrite:!1})}function Qo(){return new Ie({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Za(),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:Mn,depthTest:!1,depthWrite:!1})}function Za(){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 Xf(i){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===Jr||l===Qr,u=l===Di||l===Li;if(c||u){let d=t.get(o);const f=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return e===null&&(e=new Ko(i)),d=c?e.fromEquirectangular(o,d):e.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),d.texture;if(d!==void 0)return d.texture;{const m=o.image;return c&&m&&m.height>0||u&&m&&s(m)?(e===null&&(e=new Ko(i)),d=c?e.fromEquirectangular(o):e.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function s(o){let l=0;const c=6;for(let u=0;ut.maxTextureSize&&(D=Math.ceil(E/t.maxTextureSize),E=t.maxTextureSize);const w=new Float32Array(E*D*4*d),R=new Hl(w,E,D,d);R.type=cn,R.needsUpdate=!0;const N=b*4;for(let M=0;M0)return i;const s=t*e;let r=el[s];if(r===void 0&&(r=new Float32Array(s),el[s]=r),t!==0){n.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,i[a].toArray(r,o)}return r}function me(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e":" "} ${o}: ${e[a]}`)}return n.join(` -`)}const ll=new Wt;function Xp(i){Qt._getMatrix(ll,Qt.workingColorSpace,i);const t=`mat3( ${ll.elements.map(e=>e.toFixed(4))} )`;switch(Qt.getTransfer(i)){case Xs:return[t,"LinearTransferOETF"];case re:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[t,"LinearTransferOETF"]}}function cl(i,t,e){const n=i.getShaderParameter(t,i.COMPILE_STATUS),s=i.getShaderInfoLog(t).trim();if(n&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const a=parseInt(r[1]);return e.toUpperCase()+` - -`+s+` - -`+Wp(i.getShaderSource(t),a)}else return s}function Yp(i,t){const e=Xp(t);return[`vec4 ${i}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(` -`)}function qp(i,t){let e;switch(t){case Yc:e="Linear";break;case qc:e="Reinhard";break;case jc:e="Cineon";break;case bl:e="ACESFilmic";break;case Kc:e="AgX";break;case $c:e="Neutral";break;case Zc:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+i+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const Is=new P;function jp(){Qt.getLuminanceCoefficients(Is);const i=Is.x.toFixed(4),t=Is.y.toFixed(4),e=Is.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(` -`)}function Zp(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ji).join(` -`)}function Kp(i){const t=[];for(const e in i){const n=i[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(` -`)}function $p(i,t){const e={},n=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Ia(i){return i.replace(Jp,tm)}const Qp=new Map;function tm(i,t){let e=Xt[t];if(e===void 0){const n=Qp.get(t);if(n!==void 0)e=Xt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return Ia(e)}const em=/#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 dl(i){return i.replace(em,nm)}function nm(i,t,e,n){let s="";for(let r=parseInt(t);r0&&(p+=` -`),h=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g].filter(Ji).join(` -`),h.length>0&&(h+=` -`)):(p=[fl(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+u:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(Ji).join(` -`),h=[fl(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+u:"",e.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==Un?"#define TONE_MAPPING":"",e.toneMapping!==Un?Xt.tonemapping_pars_fragment:"",e.toneMapping!==Un?qp("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Xt.colorspace_pars_fragment,Yp("linearToOutputTexel",e.outputColorSpace),jp(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` -`].filter(Ji).join(` -`)),a=Ia(a),a=hl(a,e),a=ul(a,e),o=Ia(o),o=hl(o,e),o=ul(o,e),a=dl(a),o=dl(o),e.isRawShaderMaterial!==!0&&(A=`#version 300 es -`,p=[m,"#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+p,h=["#define varying in",e.glslVersion===lo?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===lo?"":"#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(` -`)+` -`+h);const b=A+p+a,E=A+h+o,D=ol(s,s.VERTEX_SHADER,b),w=ol(s,s.FRAGMENT_SHADER,E);s.attachShader(x,D),s.attachShader(x,w),e.index0AttributeName!==void 0?s.bindAttribLocation(x,0,e.index0AttributeName):e.morphTargets===!0&&s.bindAttribLocation(x,0,"position"),s.linkProgram(x);function R(C){if(i.debug.checkShaderErrors){const W=s.getProgramInfoLog(x).trim(),H=s.getShaderInfoLog(D).trim(),q=s.getShaderInfoLog(w).trim();let J=!0,X=!0;if(s.getProgramParameter(x,s.LINK_STATUS)===!1)if(J=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,x,D,w);else{const at=cl(s,D,"vertex"),k=cl(s,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(x,s.VALIDATE_STATUS)+` - -Material Name: `+C.name+` -Material Type: `+C.type+` - -Program Info Log: `+W+` -`+at+` -`+k)}else W!==""?console.warn("THREE.WebGLProgram: Program Info Log:",W):(H===""||q==="")&&(X=!1);X&&(C.diagnostics={runnable:J,programLog:W,vertexShader:{log:H,prefix:p},fragmentShader:{log:q,prefix:h}})}s.deleteShader(D),s.deleteShader(w),N=new Gs(s,x),y=$p(s,x)}let N;this.getUniforms=function(){return N===void 0&&R(this),N};let y;this.getAttributes=function(){return y===void 0&&R(this),y};let M=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=s.getProgramParameter(x,Vp)),M},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(x),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Gp++,this.cacheKey=t,this.usedTimes=1,this.program=x,this.vertexShader=D,this.fragmentShader=w,this}let cm=0;class hm{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return n===void 0&&(n=new um(t),e.set(t,n)),n}}class um{constructor(t){this.id=cm++,this.code=t,this.usedTimes=0}}function dm(i,t,e,n,s,r,a){const o=new Xa,l=new hm,c=new Set,u=[],d=s.logarithmicDepthBuffer,f=s.vertexTextures;let m=s.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function x(y){return c.add(y),y===0?"uv":`uv${y}`}function p(y,M,C,W,H){const q=W.fog,J=H.geometry,X=y.isMeshStandardMaterial?W.environment:null,at=(y.isMeshStandardMaterial?e:t).get(y.envMap||X),k=at&&at.mapping===Qs?at.image.height:null,ut=g[y.type];y.precision!==null&&(m=s.getMaxPrecision(y.precision),m!==y.precision&&console.warn("THREE.WebGLProgram.getParameters:",y.precision,"not supported, using",m,"instead."));const xt=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,Rt=xt!==void 0?xt.length:0;let Vt=0;J.morphAttributes.position!==void 0&&(Vt=1),J.morphAttributes.normal!==void 0&&(Vt=2),J.morphAttributes.color!==void 0&&(Vt=3);let wt,V,it,Mt;if(ut){const ie=rn[ut];wt=ie.vertexShader,V=ie.fragmentShader}else wt=y.vertexShader,V=y.fragmentShader,l.update(y),it=l.getVertexShaderID(y),Mt=l.getFragmentShaderID(y);const ct=i.getRenderTarget(),Ct=i.state.buffers.depth.getReversed(),Pt=H.isInstancedMesh===!0,nt=H.isBatchedMesh===!0,Q=!!y.map,O=!!y.matcap,ot=!!at,T=!!y.aoMap,lt=!!y.lightMap,tt=!!y.bumpMap,rt=!!y.normalMap,$=!!y.displacementMap,Ft=!!y.emissiveMap,_t=!!y.metalnessMap,S=!!y.roughnessMap,_=y.anisotropy>0,F=y.clearcoat>0,j=y.dispersion>0,K=y.iridescence>0,Y=y.sheen>0,Et=y.transmission>0,ft=_&&!!y.anisotropyMap,ht=F&&!!y.clearcoatMap,Ot=F&&!!y.clearcoatNormalMap,et=F&&!!y.clearcoatRoughnessMap,gt=K&&!!y.iridescenceMap,Lt=K&&!!y.iridescenceThicknessMap,Bt=Y&&!!y.sheenColorMap,yt=Y&&!!y.sheenRoughnessMap,Zt=!!y.specularMap,kt=!!y.specularColorMap,se=!!y.specularIntensityMap,L=Et&&!!y.transmissionMap,pt=Et&&!!y.thicknessMap,G=!!y.gradientMap,Z=!!y.alphaMap,St=y.alphaTest>0,vt=!!y.alphaHash,Gt=!!y.extensions;let he=Un;y.toneMapped&&(ct===null||ct.isXRRenderTarget===!0)&&(he=i.toneMapping);const ye={shaderID:ut,shaderType:y.type,shaderName:y.name,vertexShader:wt,fragmentShader:V,defines:y.defines,customVertexShaderID:it,customFragmentShaderID:Mt,isRawShaderMaterial:y.isRawShaderMaterial===!0,glslVersion:y.glslVersion,precision:m,batching:nt,batchingColor:nt&&H._colorsTexture!==null,instancing:Pt,instancingColor:Pt&&H.instanceColor!==null,instancingMorph:Pt&&H.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:ct===null?i.outputColorSpace:ct.isXRRenderTarget===!0?ct.texture.colorSpace:Ni,alphaToCoverage:!!y.alphaToCoverage,map:Q,matcap:O,envMap:ot,envMapMode:ot&&at.mapping,envMapCubeUVHeight:k,aoMap:T,lightMap:lt,bumpMap:tt,normalMap:rt,displacementMap:f&&$,emissiveMap:Ft,normalMapObjectSpace:rt&&y.normalMapType===eh,normalMapTangentSpace:rt&&y.normalMapType===Fl,metalnessMap:_t,roughnessMap:S,anisotropy:_,anisotropyMap:ft,clearcoat:F,clearcoatMap:ht,clearcoatNormalMap:Ot,clearcoatRoughnessMap:et,dispersion:j,iridescence:K,iridescenceMap:gt,iridescenceThicknessMap:Lt,sheen:Y,sheenColorMap:Bt,sheenRoughnessMap:yt,specularMap:Zt,specularColorMap:kt,specularIntensityMap:se,transmission:Et,transmissionMap:L,thicknessMap:pt,gradientMap:G,opaque:y.transparent===!1&&y.blending===wi&&y.alphaToCoverage===!1,alphaMap:Z,alphaTest:St,alphaHash:vt,combine:y.combine,mapUv:Q&&x(y.map.channel),aoMapUv:T&&x(y.aoMap.channel),lightMapUv:lt&&x(y.lightMap.channel),bumpMapUv:tt&&x(y.bumpMap.channel),normalMapUv:rt&&x(y.normalMap.channel),displacementMapUv:$&&x(y.displacementMap.channel),emissiveMapUv:Ft&&x(y.emissiveMap.channel),metalnessMapUv:_t&&x(y.metalnessMap.channel),roughnessMapUv:S&&x(y.roughnessMap.channel),anisotropyMapUv:ft&&x(y.anisotropyMap.channel),clearcoatMapUv:ht&&x(y.clearcoatMap.channel),clearcoatNormalMapUv:Ot&&x(y.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:et&&x(y.clearcoatRoughnessMap.channel),iridescenceMapUv:gt&&x(y.iridescenceMap.channel),iridescenceThicknessMapUv:Lt&&x(y.iridescenceThicknessMap.channel),sheenColorMapUv:Bt&&x(y.sheenColorMap.channel),sheenRoughnessMapUv:yt&&x(y.sheenRoughnessMap.channel),specularMapUv:Zt&&x(y.specularMap.channel),specularColorMapUv:kt&&x(y.specularColorMap.channel),specularIntensityMapUv:se&&x(y.specularIntensityMap.channel),transmissionMapUv:L&&x(y.transmissionMap.channel),thicknessMapUv:pt&&x(y.thicknessMap.channel),alphaMapUv:Z&&x(y.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(rt||_),vertexColors:y.vertexColors,vertexAlphas:y.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!J.attributes.uv&&(Q||Z),fog:!!q,useFog:y.fog===!0,fogExp2:!!q&&q.isFogExp2,flatShading:y.flatShading===!0,sizeAttenuation:y.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:Ct,skinning:H.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:Rt,morphTextureStride:Vt,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:y.dithering,shadowMapEnabled:i.shadowMap.enabled&&C.length>0,shadowMapType:i.shadowMap.type,toneMapping:he,decodeVideoTexture:Q&&y.map.isVideoTexture===!0&&Qt.getTransfer(y.map.colorSpace)===re,decodeVideoTextureEmissive:Ft&&y.emissiveMap.isVideoTexture===!0&&Qt.getTransfer(y.emissiveMap.colorSpace)===re,premultipliedAlpha:y.premultipliedAlpha,doubleSided:y.side===an,flipSided:y.side===Ne,useDepthPacking:y.depthPacking>=0,depthPacking:y.depthPacking||0,index0AttributeName:y.index0AttributeName,extensionClipCullDistance:Gt&&y.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Gt&&y.extensions.multiDraw===!0||nt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:y.customProgramCacheKey()};return ye.vertexUv1s=c.has(1),ye.vertexUv2s=c.has(2),ye.vertexUv3s=c.has(3),c.clear(),ye}function h(y){const M=[];if(y.shaderID?M.push(y.shaderID):(M.push(y.customVertexShaderID),M.push(y.customFragmentShaderID)),y.defines!==void 0)for(const C in y.defines)M.push(C),M.push(y.defines[C]);return y.isRawShaderMaterial===!1&&(A(M,y),b(M,y),M.push(i.outputColorSpace)),M.push(y.customProgramCacheKey),M.join()}function A(y,M){y.push(M.precision),y.push(M.outputColorSpace),y.push(M.envMapMode),y.push(M.envMapCubeUVHeight),y.push(M.mapUv),y.push(M.alphaMapUv),y.push(M.lightMapUv),y.push(M.aoMapUv),y.push(M.bumpMapUv),y.push(M.normalMapUv),y.push(M.displacementMapUv),y.push(M.emissiveMapUv),y.push(M.metalnessMapUv),y.push(M.roughnessMapUv),y.push(M.anisotropyMapUv),y.push(M.clearcoatMapUv),y.push(M.clearcoatNormalMapUv),y.push(M.clearcoatRoughnessMapUv),y.push(M.iridescenceMapUv),y.push(M.iridescenceThicknessMapUv),y.push(M.sheenColorMapUv),y.push(M.sheenRoughnessMapUv),y.push(M.specularMapUv),y.push(M.specularColorMapUv),y.push(M.specularIntensityMapUv),y.push(M.transmissionMapUv),y.push(M.thicknessMapUv),y.push(M.combine),y.push(M.fogExp2),y.push(M.sizeAttenuation),y.push(M.morphTargetsCount),y.push(M.morphAttributeCount),y.push(M.numDirLights),y.push(M.numPointLights),y.push(M.numSpotLights),y.push(M.numSpotLightMaps),y.push(M.numHemiLights),y.push(M.numRectAreaLights),y.push(M.numDirLightShadows),y.push(M.numPointLightShadows),y.push(M.numSpotLightShadows),y.push(M.numSpotLightShadowsWithMaps),y.push(M.numLightProbes),y.push(M.shadowMapType),y.push(M.toneMapping),y.push(M.numClippingPlanes),y.push(M.numClipIntersection),y.push(M.depthPacking)}function b(y,M){o.disableAll(),M.supportsVertexTextures&&o.enable(0),M.instancing&&o.enable(1),M.instancingColor&&o.enable(2),M.instancingMorph&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),M.dispersion&&o.enable(20),M.batchingColor&&o.enable(21),y.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.reverseDepthBuffer&&o.enable(4),M.skinning&&o.enable(5),M.morphTargets&&o.enable(6),M.morphNormals&&o.enable(7),M.morphColors&&o.enable(8),M.premultipliedAlpha&&o.enable(9),M.shadowMapEnabled&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.decodeVideoTextureEmissive&&o.enable(20),M.alphaToCoverage&&o.enable(21),y.push(o.mask)}function E(y){const M=g[y.type];let C;if(M){const W=rn[M];C=js.clone(W.uniforms)}else C=y.uniforms;return C}function D(y,M){let C;for(let W=0,H=u.length;W0?n.push(h):m.transparent===!0?s.push(h):e.push(h)}function l(d,f,m,g,x,p){const h=a(d,f,m,g,x,p);m.transmission>0?n.unshift(h):m.transparent===!0?s.unshift(h):e.unshift(h)}function c(d,f){e.length>1&&e.sort(d||pm),n.length>1&&n.sort(f||pl),s.length>1&&s.sort(f||pl)}function u(){for(let d=t,f=i.length;d=r.length?(a=new ml,r.push(a)):a=r[s],a}function e(){i=new WeakMap}return{get:t,dispose:e}}function _m(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new P,color:new Dt};break;case"SpotLight":e={position:new P,direction:new P,color:new Dt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new P,color:new Dt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new P,skyColor:new Dt,groundColor:new Dt};break;case"RectAreaLight":e={color:new Dt,position:new P,halfWidth:new P,halfHeight:new P};break}return i[t.id]=e,e}}}function gm(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new At};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new At};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new At,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[t.id]=e,e}}}let vm=0;function xm(i,t){return(t.castShadow?2:0)-(i.castShadow?2:0)+(t.map?1:0)-(i.map?1:0)}function Mm(i){const t=new _m,e=gm(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new P);const s=new P,r=new ne,a=new ne;function o(c){let u=0,d=0,f=0;for(let y=0;y<9;y++)n.probe[y].set(0,0,0);let m=0,g=0,x=0,p=0,h=0,A=0,b=0,E=0,D=0,w=0,R=0;c.sort(xm);for(let y=0,M=c.length;y0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=dt.LTC_FLOAT_1,n.rectAreaLTC2=dt.LTC_FLOAT_2):(n.rectAreaLTC1=dt.LTC_HALF_1,n.rectAreaLTC2=dt.LTC_HALF_2)),n.ambient[0]=u,n.ambient[1]=d,n.ambient[2]=f;const N=n.hash;(N.directionalLength!==m||N.pointLength!==g||N.spotLength!==x||N.rectAreaLength!==p||N.hemiLength!==h||N.numDirectionalShadows!==A||N.numPointShadows!==b||N.numSpotShadows!==E||N.numSpotMaps!==D||N.numLightProbes!==R)&&(n.directional.length=m,n.spot.length=x,n.rectArea.length=p,n.point.length=g,n.hemi.length=h,n.directionalShadow.length=A,n.directionalShadowMap.length=A,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=E,n.spotShadowMap.length=E,n.directionalShadowMatrix.length=A,n.pointShadowMatrix.length=b,n.spotLightMatrix.length=E+D-w,n.spotLightMap.length=D,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=R,N.directionalLength=m,N.pointLength=g,N.spotLength=x,N.rectAreaLength=p,N.hemiLength=h,N.numDirectionalShadows=A,N.numPointShadows=b,N.numSpotShadows=E,N.numSpotMaps=D,N.numLightProbes=R,n.version=vm++)}function l(c,u){let d=0,f=0,m=0,g=0,x=0;const p=u.matrixWorldInverse;for(let h=0,A=c.length;h=a.length?(o=new _l(i),a.push(o)):o=a[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}const ym=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,Em=`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 Tm(i,t,e){let n=new Ya;const s=new At,r=new At,a=new le,o=new Xh({depthPacking:th}),l=new Yh,c={},u=e.maxTextureSize,d={[Nn]:Ne,[Ne]:Nn,[an]:an},f=new Ie({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new At},radius:{value:4}},vertexShader:ym,fragmentShader:Em}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const g=new xe;g.setAttribute("position",new ve(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new De(g,f),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=El;let h=this.type;this.render=function(w,R,N){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||w.length===0)return;const y=i.getRenderTarget(),M=i.getActiveCubeFace(),C=i.getActiveMipmapLevel(),W=i.state;W.setBlending(Mn),W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const H=h!==gn&&this.type===gn,q=h===gn&&this.type!==gn;for(let J=0,X=w.length;Ju||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/ut.x),s.x=r.x*ut.x,k.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/ut.y),s.y=r.y*ut.y,k.mapSize.y=r.y)),k.map===null||H===!0||q===!0){const Rt=this.type!==gn?{minFilter:ke,magFilter:ke}:{};k.map!==null&&k.map.dispose(),k.map=new en(s.x,s.y,Rt),k.map.texture.name=at.name+".shadowMap",k.camera.updateProjectionMatrix()}i.setRenderTarget(k.map),i.clear();const xt=k.getViewportCount();for(let Rt=0;Rt0||R.map&&R.alphaTest>0){const W=M.uuid,H=R.uuid;let q=c[W];q===void 0&&(q={},c[W]=q);let J=q[H];J===void 0&&(J=M.clone(),q[H]=J,R.addEventListener("dispose",D)),M=J}if(M.visible=R.visible,M.wireframe=R.wireframe,y===gn?M.side=R.shadowSide!==null?R.shadowSide:R.side:M.side=R.shadowSide!==null?R.shadowSide:d[R.side],M.alphaMap=R.alphaMap,M.alphaTest=R.alphaTest,M.map=R.map,M.clipShadows=R.clipShadows,M.clippingPlanes=R.clippingPlanes,M.clipIntersection=R.clipIntersection,M.displacementMap=R.displacementMap,M.displacementScale=R.displacementScale,M.displacementBias=R.displacementBias,M.wireframeLinewidth=R.wireframeLinewidth,M.linewidth=R.linewidth,N.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const W=i.properties.get(M);W.light=N}return M}function E(w,R,N,y,M){if(w.visible===!1)return;if(w.layers.test(R.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&M===gn)&&(!w.frustumCulled||n.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,w.matrixWorld);const H=t.update(w),q=w.material;if(Array.isArray(q)){const J=H.groups;for(let X=0,at=J.length;X=1):k.indexOf("OpenGL ES")!==-1&&(at=parseFloat(/^OpenGL ES (\d)/.exec(k)[1]),X=at>=2);let ut=null,xt={};const Rt=i.getParameter(i.SCISSOR_BOX),Vt=i.getParameter(i.VIEWPORT),wt=new le().fromArray(Rt),V=new le().fromArray(Vt);function it(L,pt,G,Z){const St=new Uint8Array(4),vt=i.createTexture();i.bindTexture(L,vt),i.texParameteri(L,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(L,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let Gt=0;Gt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new At,u=new WeakMap;let d;const f=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(S,_){return m?new OffscreenCanvas(S,_):qs("canvas")}function x(S,_,F){let j=1;const K=_t(S);if((K.width>F||K.height>F)&&(j=F/Math.max(K.width,K.height)),j<1)if(typeof HTMLImageElement<"u"&&S instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&S instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&S instanceof ImageBitmap||typeof VideoFrame<"u"&&S instanceof VideoFrame){const Y=Math.floor(j*K.width),Et=Math.floor(j*K.height);d===void 0&&(d=g(Y,Et));const ft=_?g(Y,Et):d;return ft.width=Y,ft.height=Et,ft.getContext("2d").drawImage(S,0,0,Y,Et),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+K.width+"x"+K.height+") to ("+Y+"x"+Et+")."),ft}else return"data"in S&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+K.width+"x"+K.height+")."),S;return S}function p(S){return S.generateMipmaps}function h(S){i.generateMipmap(S)}function A(S){return S.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:S.isWebGL3DRenderTarget?i.TEXTURE_3D:S.isWebGLArrayRenderTarget||S.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function b(S,_,F,j,K=!1){if(S!==null){if(i[S]!==void 0)return i[S];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+S+"'")}let Y=_;if(_===i.RED&&(F===i.FLOAT&&(Y=i.R32F),F===i.HALF_FLOAT&&(Y=i.R16F),F===i.UNSIGNED_BYTE&&(Y=i.R8)),_===i.RED_INTEGER&&(F===i.UNSIGNED_BYTE&&(Y=i.R8UI),F===i.UNSIGNED_SHORT&&(Y=i.R16UI),F===i.UNSIGNED_INT&&(Y=i.R32UI),F===i.BYTE&&(Y=i.R8I),F===i.SHORT&&(Y=i.R16I),F===i.INT&&(Y=i.R32I)),_===i.RG&&(F===i.FLOAT&&(Y=i.RG32F),F===i.HALF_FLOAT&&(Y=i.RG16F),F===i.UNSIGNED_BYTE&&(Y=i.RG8)),_===i.RG_INTEGER&&(F===i.UNSIGNED_BYTE&&(Y=i.RG8UI),F===i.UNSIGNED_SHORT&&(Y=i.RG16UI),F===i.UNSIGNED_INT&&(Y=i.RG32UI),F===i.BYTE&&(Y=i.RG8I),F===i.SHORT&&(Y=i.RG16I),F===i.INT&&(Y=i.RG32I)),_===i.RGB_INTEGER&&(F===i.UNSIGNED_BYTE&&(Y=i.RGB8UI),F===i.UNSIGNED_SHORT&&(Y=i.RGB16UI),F===i.UNSIGNED_INT&&(Y=i.RGB32UI),F===i.BYTE&&(Y=i.RGB8I),F===i.SHORT&&(Y=i.RGB16I),F===i.INT&&(Y=i.RGB32I)),_===i.RGBA_INTEGER&&(F===i.UNSIGNED_BYTE&&(Y=i.RGBA8UI),F===i.UNSIGNED_SHORT&&(Y=i.RGBA16UI),F===i.UNSIGNED_INT&&(Y=i.RGBA32UI),F===i.BYTE&&(Y=i.RGBA8I),F===i.SHORT&&(Y=i.RGBA16I),F===i.INT&&(Y=i.RGBA32I)),_===i.RGB&&F===i.UNSIGNED_INT_5_9_9_9_REV&&(Y=i.RGB9_E5),_===i.RGBA){const Et=K?Xs:Qt.getTransfer(j);F===i.FLOAT&&(Y=i.RGBA32F),F===i.HALF_FLOAT&&(Y=i.RGBA16F),F===i.UNSIGNED_BYTE&&(Y=Et===re?i.SRGB8_ALPHA8:i.RGBA8),F===i.UNSIGNED_SHORT_4_4_4_4&&(Y=i.RGBA4),F===i.UNSIGNED_SHORT_5_5_5_1&&(Y=i.RGB5_A1)}return(Y===i.R16F||Y===i.R32F||Y===i.RG16F||Y===i.RG32F||Y===i.RGBA16F||Y===i.RGBA32F)&&t.get("EXT_color_buffer_float"),Y}function E(S,_){let F;return S?_===null||_===$n||_===Ui?F=i.DEPTH24_STENCIL8:_===cn?F=i.DEPTH32F_STENCIL8:_===Qi&&(F=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):_===null||_===$n||_===Ui?F=i.DEPTH_COMPONENT24:_===cn?F=i.DEPTH_COMPONENT32F:_===Qi&&(F=i.DEPTH_COMPONENT16),F}function D(S,_){return p(S)===!0||S.isFramebufferTexture&&S.minFilter!==ke&&S.minFilter!==ln?Math.log2(Math.max(_.width,_.height))+1:S.mipmaps!==void 0&&S.mipmaps.length>0?S.mipmaps.length:S.isCompressedTexture&&Array.isArray(S.image)?_.mipmaps.length:1}function w(S){const _=S.target;_.removeEventListener("dispose",w),N(_),_.isVideoTexture&&u.delete(_)}function R(S){const _=S.target;_.removeEventListener("dispose",R),M(_)}function N(S){const _=n.get(S);if(_.__webglInit===void 0)return;const F=S.source,j=f.get(F);if(j){const K=j[_.__cacheKey];K.usedTimes--,K.usedTimes===0&&y(S),Object.keys(j).length===0&&f.delete(F)}n.remove(S)}function y(S){const _=n.get(S);i.deleteTexture(_.__webglTexture);const F=S.source,j=f.get(F);delete j[_.__cacheKey],a.memory.textures--}function M(S){const _=n.get(S);if(S.depthTexture&&(S.depthTexture.dispose(),n.remove(S.depthTexture)),S.isWebGLCubeRenderTarget)for(let j=0;j<6;j++){if(Array.isArray(_.__webglFramebuffer[j]))for(let K=0;K<_.__webglFramebuffer[j].length;K++)i.deleteFramebuffer(_.__webglFramebuffer[j][K]);else i.deleteFramebuffer(_.__webglFramebuffer[j]);_.__webglDepthbuffer&&i.deleteRenderbuffer(_.__webglDepthbuffer[j])}else{if(Array.isArray(_.__webglFramebuffer))for(let j=0;j<_.__webglFramebuffer.length;j++)i.deleteFramebuffer(_.__webglFramebuffer[j]);else i.deleteFramebuffer(_.__webglFramebuffer);if(_.__webglDepthbuffer&&i.deleteRenderbuffer(_.__webglDepthbuffer),_.__webglMultisampledFramebuffer&&i.deleteFramebuffer(_.__webglMultisampledFramebuffer),_.__webglColorRenderbuffer)for(let j=0;j<_.__webglColorRenderbuffer.length;j++)_.__webglColorRenderbuffer[j]&&i.deleteRenderbuffer(_.__webglColorRenderbuffer[j]);_.__webglDepthRenderbuffer&&i.deleteRenderbuffer(_.__webglDepthRenderbuffer)}const F=S.textures;for(let j=0,K=F.length;j=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+S+" texture units while this GPU supports only "+s.maxTextures),C+=1,S}function q(S){const _=[];return _.push(S.wrapS),_.push(S.wrapT),_.push(S.wrapR||0),_.push(S.magFilter),_.push(S.minFilter),_.push(S.anisotropy),_.push(S.internalFormat),_.push(S.format),_.push(S.type),_.push(S.generateMipmaps),_.push(S.premultiplyAlpha),_.push(S.flipY),_.push(S.unpackAlignment),_.push(S.colorSpace),_.join()}function J(S,_){const F=n.get(S);if(S.isVideoTexture&&$(S),S.isRenderTargetTexture===!1&&S.version>0&&F.__version!==S.version){const j=S.image;if(j===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(j.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{V(F,S,_);return}}e.bindTexture(i.TEXTURE_2D,F.__webglTexture,i.TEXTURE0+_)}function X(S,_){const F=n.get(S);if(S.version>0&&F.__version!==S.version){V(F,S,_);return}e.bindTexture(i.TEXTURE_2D_ARRAY,F.__webglTexture,i.TEXTURE0+_)}function at(S,_){const F=n.get(S);if(S.version>0&&F.__version!==S.version){V(F,S,_);return}e.bindTexture(i.TEXTURE_3D,F.__webglTexture,i.TEXTURE0+_)}function k(S,_){const F=n.get(S);if(S.version>0&&F.__version!==S.version){it(F,S,_);return}e.bindTexture(i.TEXTURE_CUBE_MAP,F.__webglTexture,i.TEXTURE0+_)}const ut={[ta]:i.REPEAT,[Zn]:i.CLAMP_TO_EDGE,[ea]:i.MIRRORED_REPEAT},xt={[ke]:i.NEAREST,[Jc]:i.NEAREST_MIPMAP_NEAREST,[as]:i.NEAREST_MIPMAP_LINEAR,[ln]:i.LINEAR,[rr]:i.LINEAR_MIPMAP_NEAREST,[Kn]:i.LINEAR_MIPMAP_LINEAR},Rt={[nh]:i.NEVER,[lh]:i.ALWAYS,[ih]:i.LESS,[Ol]:i.LEQUAL,[sh]:i.EQUAL,[oh]:i.GEQUAL,[rh]:i.GREATER,[ah]:i.NOTEQUAL};function Vt(S,_){if(_.type===cn&&t.has("OES_texture_float_linear")===!1&&(_.magFilter===ln||_.magFilter===rr||_.magFilter===as||_.magFilter===Kn||_.minFilter===ln||_.minFilter===rr||_.minFilter===as||_.minFilter===Kn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(S,i.TEXTURE_WRAP_S,ut[_.wrapS]),i.texParameteri(S,i.TEXTURE_WRAP_T,ut[_.wrapT]),(S===i.TEXTURE_3D||S===i.TEXTURE_2D_ARRAY)&&i.texParameteri(S,i.TEXTURE_WRAP_R,ut[_.wrapR]),i.texParameteri(S,i.TEXTURE_MAG_FILTER,xt[_.magFilter]),i.texParameteri(S,i.TEXTURE_MIN_FILTER,xt[_.minFilter]),_.compareFunction&&(i.texParameteri(S,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(S,i.TEXTURE_COMPARE_FUNC,Rt[_.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(_.magFilter===ke||_.minFilter!==as&&_.minFilter!==Kn||_.type===cn&&t.has("OES_texture_float_linear")===!1)return;if(_.anisotropy>1||n.get(_).__currentAnisotropy){const F=t.get("EXT_texture_filter_anisotropic");i.texParameterf(S,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(_.anisotropy,s.getMaxAnisotropy())),n.get(_).__currentAnisotropy=_.anisotropy}}}function wt(S,_){let F=!1;S.__webglInit===void 0&&(S.__webglInit=!0,_.addEventListener("dispose",w));const j=_.source;let K=f.get(j);K===void 0&&(K={},f.set(j,K));const Y=q(_);if(Y!==S.__cacheKey){K[Y]===void 0&&(K[Y]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,F=!0),K[Y].usedTimes++;const Et=K[S.__cacheKey];Et!==void 0&&(K[S.__cacheKey].usedTimes--,Et.usedTimes===0&&y(_)),S.__cacheKey=Y,S.__webglTexture=K[Y].texture}return F}function V(S,_,F){let j=i.TEXTURE_2D;(_.isDataArrayTexture||_.isCompressedArrayTexture)&&(j=i.TEXTURE_2D_ARRAY),_.isData3DTexture&&(j=i.TEXTURE_3D);const K=wt(S,_),Y=_.source;e.bindTexture(j,S.__webglTexture,i.TEXTURE0+F);const Et=n.get(Y);if(Y.version!==Et.__version||K===!0){e.activeTexture(i.TEXTURE0+F);const ft=Qt.getPrimaries(Qt.workingColorSpace),ht=_.colorSpace===Ln?null:Qt.getPrimaries(_.colorSpace),Ot=_.colorSpace===Ln||ft===ht?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,_.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,_.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ot);let et=x(_.image,!1,s.maxTextureSize);et=Ft(_,et);const gt=r.convert(_.format,_.colorSpace),Lt=r.convert(_.type);let Bt=b(_.internalFormat,gt,Lt,_.colorSpace,_.isVideoTexture);Vt(j,_);let yt;const Zt=_.mipmaps,kt=_.isVideoTexture!==!0,se=Et.__version===void 0||K===!0,L=Y.dataReady,pt=D(_,et);if(_.isDepthTexture)Bt=E(_.format===Ii,_.type),se&&(kt?e.texStorage2D(i.TEXTURE_2D,1,Bt,et.width,et.height):e.texImage2D(i.TEXTURE_2D,0,Bt,et.width,et.height,0,gt,Lt,null));else if(_.isDataTexture)if(Zt.length>0){kt&&se&&e.texStorage2D(i.TEXTURE_2D,pt,Bt,Zt[0].width,Zt[0].height);for(let G=0,Z=Zt.length;G0){const St=Yo(yt.width,yt.height,_.format,_.type);for(const vt of _.layerUpdates){const Gt=yt.data.subarray(vt*St/yt.data.BYTES_PER_ELEMENT,(vt+1)*St/yt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,G,0,0,vt,yt.width,yt.height,1,gt,Gt)}_.clearLayerUpdates()}else e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,G,0,0,0,yt.width,yt.height,et.depth,gt,yt.data)}else e.compressedTexImage3D(i.TEXTURE_2D_ARRAY,G,Bt,yt.width,yt.height,et.depth,0,yt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else kt?L&&e.texSubImage3D(i.TEXTURE_2D_ARRAY,G,0,0,0,yt.width,yt.height,et.depth,gt,Lt,yt.data):e.texImage3D(i.TEXTURE_2D_ARRAY,G,Bt,yt.width,yt.height,et.depth,0,gt,Lt,yt.data)}else{kt&&se&&e.texStorage2D(i.TEXTURE_2D,pt,Bt,Zt[0].width,Zt[0].height);for(let G=0,Z=Zt.length;G0){const G=Yo(et.width,et.height,_.format,_.type);for(const Z of _.layerUpdates){const St=et.data.subarray(Z*G/et.data.BYTES_PER_ELEMENT,(Z+1)*G/et.data.BYTES_PER_ELEMENT);e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,Z,et.width,et.height,1,gt,Lt,St)}_.clearLayerUpdates()}else e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,et.width,et.height,et.depth,gt,Lt,et.data)}else e.texImage3D(i.TEXTURE_2D_ARRAY,0,Bt,et.width,et.height,et.depth,0,gt,Lt,et.data);else if(_.isData3DTexture)kt?(se&&e.texStorage3D(i.TEXTURE_3D,pt,Bt,et.width,et.height,et.depth),L&&e.texSubImage3D(i.TEXTURE_3D,0,0,0,0,et.width,et.height,et.depth,gt,Lt,et.data)):e.texImage3D(i.TEXTURE_3D,0,Bt,et.width,et.height,et.depth,0,gt,Lt,et.data);else if(_.isFramebufferTexture){if(se)if(kt)e.texStorage2D(i.TEXTURE_2D,pt,Bt,et.width,et.height);else{let G=et.width,Z=et.height;for(let St=0;St>=1,Z>>=1}}else if(Zt.length>0){if(kt&&se){const G=_t(Zt[0]);e.texStorage2D(i.TEXTURE_2D,pt,Bt,G.width,G.height)}for(let G=0,Z=Zt.length;G0&&pt++;const Z=_t(gt[0]);e.texStorage2D(i.TEXTURE_CUBE_MAP,pt,Zt,Z.width,Z.height)}for(let Z=0;Z<6;Z++)if(et){kt?L&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Z,0,0,0,gt[Z].width,gt[Z].height,Bt,yt,gt[Z].data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Z,0,Zt,gt[Z].width,gt[Z].height,0,Bt,yt,gt[Z].data);for(let St=0;St>Y),Lt=Math.max(1,_.height>>Y);K===i.TEXTURE_3D||K===i.TEXTURE_2D_ARRAY?e.texImage3D(K,Y,ht,gt,Lt,_.depth,0,Et,ft,null):e.texImage2D(K,Y,ht,gt,Lt,0,Et,ft,null)}e.bindFramebuffer(i.FRAMEBUFFER,S),rt(_)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,j,K,et.__webglTexture,0,tt(_)):(K===i.TEXTURE_2D||K>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,j,K,et.__webglTexture,Y),e.bindFramebuffer(i.FRAMEBUFFER,null)}function ct(S,_,F){if(i.bindRenderbuffer(i.RENDERBUFFER,S),_.depthBuffer){const j=_.depthTexture,K=j&&j.isDepthTexture?j.type:null,Y=E(_.stencilBuffer,K),Et=_.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ft=tt(_);rt(_)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,ft,Y,_.width,_.height):F?i.renderbufferStorageMultisample(i.RENDERBUFFER,ft,Y,_.width,_.height):i.renderbufferStorage(i.RENDERBUFFER,Y,_.width,_.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,Et,i.RENDERBUFFER,S)}else{const j=_.textures;for(let K=0;K{delete _.__boundDepthTexture,delete _.__depthDisposeCallback,j.removeEventListener("dispose",K)};j.addEventListener("dispose",K),_.__depthDisposeCallback=K}_.__boundDepthTexture=j}if(S.depthTexture&&!_.__autoAllocateDepthBuffer){if(F)throw new Error("target.depthTexture not supported in Cube render targets");Ct(_.__webglFramebuffer,S)}else if(F){_.__webglDepthbuffer=[];for(let j=0;j<6;j++)if(e.bindFramebuffer(i.FRAMEBUFFER,_.__webglFramebuffer[j]),_.__webglDepthbuffer[j]===void 0)_.__webglDepthbuffer[j]=i.createRenderbuffer(),ct(_.__webglDepthbuffer[j],S,!1);else{const K=S.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Y=_.__webglDepthbuffer[j];i.bindRenderbuffer(i.RENDERBUFFER,Y),i.framebufferRenderbuffer(i.FRAMEBUFFER,K,i.RENDERBUFFER,Y)}}else if(e.bindFramebuffer(i.FRAMEBUFFER,_.__webglFramebuffer),_.__webglDepthbuffer===void 0)_.__webglDepthbuffer=i.createRenderbuffer(),ct(_.__webglDepthbuffer,S,!1);else{const j=S.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,K=_.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,K),i.framebufferRenderbuffer(i.FRAMEBUFFER,j,i.RENDERBUFFER,K)}e.bindFramebuffer(i.FRAMEBUFFER,null)}function nt(S,_,F){const j=n.get(S);_!==void 0&&Mt(j.__webglFramebuffer,S,S.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),F!==void 0&&Pt(S)}function Q(S){const _=S.texture,F=n.get(S),j=n.get(_);S.addEventListener("dispose",R);const K=S.textures,Y=S.isWebGLCubeRenderTarget===!0,Et=K.length>1;if(Et||(j.__webglTexture===void 0&&(j.__webglTexture=i.createTexture()),j.__version=_.version,a.memory.textures++),Y){F.__webglFramebuffer=[];for(let ft=0;ft<6;ft++)if(_.mipmaps&&_.mipmaps.length>0){F.__webglFramebuffer[ft]=[];for(let ht=0;ht<_.mipmaps.length;ht++)F.__webglFramebuffer[ft][ht]=i.createFramebuffer()}else F.__webglFramebuffer[ft]=i.createFramebuffer()}else{if(_.mipmaps&&_.mipmaps.length>0){F.__webglFramebuffer=[];for(let ft=0;ft<_.mipmaps.length;ft++)F.__webglFramebuffer[ft]=i.createFramebuffer()}else F.__webglFramebuffer=i.createFramebuffer();if(Et)for(let ft=0,ht=K.length;ft0&&rt(S)===!1){F.__webglMultisampledFramebuffer=i.createFramebuffer(),F.__webglColorRenderbuffer=[],e.bindFramebuffer(i.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let ft=0;ft0)for(let ht=0;ht<_.mipmaps.length;ht++)Mt(F.__webglFramebuffer[ft][ht],S,_,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ft,ht);else Mt(F.__webglFramebuffer[ft],S,_,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ft,0);p(_)&&h(i.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(Et){for(let ft=0,ht=K.length;ft0)for(let ht=0;ht<_.mipmaps.length;ht++)Mt(F.__webglFramebuffer[ht],S,_,i.COLOR_ATTACHMENT0,ft,ht);else Mt(F.__webglFramebuffer,S,_,i.COLOR_ATTACHMENT0,ft,0);p(_)&&h(ft),e.unbindTexture()}S.depthBuffer&&Pt(S)}function O(S){const _=S.textures;for(let F=0,j=_.length;F0){if(rt(S)===!1){const _=S.textures,F=S.width,j=S.height;let K=i.COLOR_BUFFER_BIT;const Y=S.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Et=n.get(S),ft=_.length>1;if(ft)for(let ht=0;ht<_.length;ht++)e.bindFramebuffer(i.FRAMEBUFFER,Et.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+ht,i.RENDERBUFFER,null),e.bindFramebuffer(i.FRAMEBUFFER,Et.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+ht,i.TEXTURE_2D,null,0);e.bindFramebuffer(i.READ_FRAMEBUFFER,Et.__webglMultisampledFramebuffer),e.bindFramebuffer(i.DRAW_FRAMEBUFFER,Et.__webglFramebuffer);for(let ht=0;ht<_.length;ht++){if(S.resolveDepthBuffer&&(S.depthBuffer&&(K|=i.DEPTH_BUFFER_BIT),S.stencilBuffer&&S.resolveStencilBuffer&&(K|=i.STENCIL_BUFFER_BIT)),ft){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,Et.__webglColorRenderbuffer[ht]);const Ot=n.get(_[ht]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,Ot,0)}i.blitFramebuffer(0,0,F,j,0,0,F,j,K,i.NEAREST),l===!0&&(ot.length=0,T.length=0,ot.push(i.COLOR_ATTACHMENT0+ht),S.depthBuffer&&S.resolveDepthBuffer===!1&&(ot.push(Y),T.push(Y),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,T)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,ot))}if(e.bindFramebuffer(i.READ_FRAMEBUFFER,null),e.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),ft)for(let ht=0;ht<_.length;ht++){e.bindFramebuffer(i.FRAMEBUFFER,Et.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+ht,i.RENDERBUFFER,Et.__webglColorRenderbuffer[ht]);const Ot=n.get(_[ht]).__webglTexture;e.bindFramebuffer(i.FRAMEBUFFER,Et.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+ht,i.TEXTURE_2D,Ot,0)}e.bindFramebuffer(i.DRAW_FRAMEBUFFER,Et.__webglMultisampledFramebuffer)}else if(S.depthBuffer&&S.resolveDepthBuffer===!1&&l){const _=S.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[_])}}}function tt(S){return Math.min(s.maxSamples,S.samples)}function rt(S){const _=n.get(S);return S.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&_.__useRenderToTexture!==!1}function $(S){const _=a.render.frame;u.get(S)!==_&&(u.set(S,_),S.update())}function Ft(S,_){const F=S.colorSpace,j=S.format,K=S.type;return S.isCompressedTexture===!0||S.isVideoTexture===!0||F!==Ni&&F!==Ln&&(Qt.getTransfer(F)===re?(j!==tn||K!==En)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",F)),_}function _t(S){return typeof HTMLImageElement<"u"&&S instanceof HTMLImageElement?(c.width=S.naturalWidth||S.width,c.height=S.naturalHeight||S.height):typeof VideoFrame<"u"&&S instanceof VideoFrame?(c.width=S.displayWidth,c.height=S.displayHeight):(c.width=S.width,c.height=S.height),c}this.allocateTextureUnit=H,this.resetTextureUnits=W,this.setTexture2D=J,this.setTexture2DArray=X,this.setTexture3D=at,this.setTextureCube=k,this.rebindTextures=nt,this.setupRenderTarget=Q,this.updateRenderTargetMipmap=O,this.updateMultisampleRenderTarget=lt,this.setupDepthRenderbuffer=Pt,this.setupFrameBufferTexture=Mt,this.useMultisampledRTT=rt}function Rm(i,t){function e(n,s=Ln){let r;const a=Qt.getTransfer(s);if(n===En)return i.UNSIGNED_BYTE;if(n===za)return i.UNSIGNED_SHORT_4_4_4_4;if(n===Ha)return i.UNSIGNED_SHORT_5_5_5_1;if(n===Cl)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===wl)return i.BYTE;if(n===Rl)return i.SHORT;if(n===Qi)return i.UNSIGNED_SHORT;if(n===Ba)return i.INT;if(n===$n)return i.UNSIGNED_INT;if(n===cn)return i.FLOAT;if(n===Sn)return i.HALF_FLOAT;if(n===Pl)return i.ALPHA;if(n===Dl)return i.RGB;if(n===tn)return i.RGBA;if(n===Ll)return i.LUMINANCE;if(n===Ul)return i.LUMINANCE_ALPHA;if(n===Ri)return i.DEPTH_COMPONENT;if(n===Ii)return i.DEPTH_STENCIL;if(n===ka)return i.RED;if(n===Va)return i.RED_INTEGER;if(n===Il)return i.RG;if(n===Ga)return i.RG_INTEGER;if(n===Wa)return i.RGBA_INTEGER;if(n===Fs||n===Os||n===Bs||n===zs)if(a===re)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===Fs)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Os)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Bs)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===zs)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===Fs)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Os)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Bs)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===zs)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===na||n===ia||n===sa||n===ra)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===na)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===ia)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===sa)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ra)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===aa||n===oa||n===la)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(n===aa||n===oa)return a===re?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===la)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===ca||n===ha||n===ua||n===da||n===fa||n===pa||n===ma||n===_a||n===ga||n===va||n===xa||n===Ma||n===Sa||n===ya)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(n===ca)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===ha)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===ua)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===da)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===fa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===pa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===ma)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===_a)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===ga)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===va)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===xa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Ma)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Sa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===ya)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Hs||n===Ea||n===Ta)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(n===Hs)return a===re?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Ea)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Ta)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Nl||n===ba||n===Aa||n===wa)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(n===Hs)return r.COMPRESSED_RED_RGTC1_EXT;if(n===ba)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Aa)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===wa)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Ui?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:e}}const Cm={type:"move"};class Br{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ti,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 Ti,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ti,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let s=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(const x of t.hand.values()){const p=e.getJointPose(x,n),h=this._getHandJoint(c,x);p!==null&&(h.matrix.fromArray(p.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,h.jointRadius=p.radius),h.visible=p!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=u.position.distanceTo(d.position),m=.02,g=.005;c.inputState.pinching&&f>m+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=m-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(s=e.getPose(t.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Cm)))}return o!==null&&(o.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const n=new Ti;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}const Pm=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,Dm=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class Lm{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){const s=new Ae,r=t.properties.get(s);r.__webglTexture=e.texture,(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,n=new Ie({vertexShader:Pm,fragmentShader:Dm,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new De(new er(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Um extends Qn{constructor(t,e){super();const n=this;let s=null,r=1,a=null,o="local-floor",l=1,c=null,u=null,d=null,f=null,m=null,g=null;const x=new Lm,p=e.getContextAttributes();let h=null,A=null;const b=[],E=[],D=new At;let w=null;const R=new He;R.viewport=new le;const N=new He;N.viewport=new le;const y=[R,N],M=new Kh;let C=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(V){let it=b[V];return it===void 0&&(it=new Br,b[V]=it),it.getTargetRaySpace()},this.getControllerGrip=function(V){let it=b[V];return it===void 0&&(it=new Br,b[V]=it),it.getGripSpace()},this.getHand=function(V){let it=b[V];return it===void 0&&(it=new Br,b[V]=it),it.getHandSpace()};function H(V){const it=E.indexOf(V.inputSource);if(it===-1)return;const Mt=b[it];Mt!==void 0&&(Mt.update(V.inputSource,V.frame,c||a),Mt.dispatchEvent({type:V.type,data:V.inputSource}))}function q(){s.removeEventListener("select",H),s.removeEventListener("selectstart",H),s.removeEventListener("selectend",H),s.removeEventListener("squeeze",H),s.removeEventListener("squeezestart",H),s.removeEventListener("squeezeend",H),s.removeEventListener("end",q),s.removeEventListener("inputsourceschange",J);for(let V=0;V=0&&(E[ct]=null,b[ct].disconnect(Mt))}for(let it=0;it=E.length){E.push(Mt),ct=Pt;break}else if(E[Pt]===null){E[Pt]=Mt,ct=Pt;break}if(ct===-1)break}const Ct=b[ct];Ct&&Ct.connect(Mt)}}const X=new P,at=new P;function k(V,it,Mt){X.setFromMatrixPosition(it.matrixWorld),at.setFromMatrixPosition(Mt.matrixWorld);const ct=X.distanceTo(at),Ct=it.projectionMatrix.elements,Pt=Mt.projectionMatrix.elements,nt=Ct[14]/(Ct[10]-1),Q=Ct[14]/(Ct[10]+1),O=(Ct[9]+1)/Ct[5],ot=(Ct[9]-1)/Ct[5],T=(Ct[8]-1)/Ct[0],lt=(Pt[8]+1)/Pt[0],tt=nt*T,rt=nt*lt,$=ct/(-T+lt),Ft=$*-T;if(it.matrixWorld.decompose(V.position,V.quaternion,V.scale),V.translateX(Ft),V.translateZ($),V.matrixWorld.compose(V.position,V.quaternion,V.scale),V.matrixWorldInverse.copy(V.matrixWorld).invert(),Ct[10]===-1)V.projectionMatrix.copy(it.projectionMatrix),V.projectionMatrixInverse.copy(it.projectionMatrixInverse);else{const _t=nt+$,S=Q+$,_=tt-Ft,F=rt+(ct-Ft),j=O*Q/S*_t,K=ot*Q/S*_t;V.projectionMatrix.makePerspective(_,F,j,K,_t,S),V.projectionMatrixInverse.copy(V.projectionMatrix).invert()}}function ut(V,it){it===null?V.matrixWorld.copy(V.matrix):V.matrixWorld.multiplyMatrices(it.matrixWorld,V.matrix),V.matrixWorldInverse.copy(V.matrixWorld).invert()}this.updateCamera=function(V){if(s===null)return;let it=V.near,Mt=V.far;x.texture!==null&&(x.depthNear>0&&(it=x.depthNear),x.depthFar>0&&(Mt=x.depthFar)),M.near=N.near=R.near=it,M.far=N.far=R.far=Mt,(C!==M.near||W!==M.far)&&(s.updateRenderState({depthNear:M.near,depthFar:M.far}),C=M.near,W=M.far),R.layers.mask=V.layers.mask|2,N.layers.mask=V.layers.mask|4,M.layers.mask=R.layers.mask|N.layers.mask;const ct=V.parent,Ct=M.cameras;ut(M,ct);for(let Pt=0;Pt0&&(p.alphaTest.value=h.alphaTest);const A=t.get(h),b=A.envMap,E=A.envMapRotation;b&&(p.envMap.value=b,Xn.copy(E),Xn.x*=-1,Xn.y*=-1,Xn.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(Xn.y*=-1,Xn.z*=-1),p.envMapRotation.value.setFromMatrix4(Im.makeRotationFromEuler(Xn)),p.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=h.reflectivity,p.ior.value=h.ior,p.refractionRatio.value=h.refractionRatio),h.lightMap&&(p.lightMap.value=h.lightMap,p.lightMapIntensity.value=h.lightMapIntensity,e(h.lightMap,p.lightMapTransform)),h.aoMap&&(p.aoMap.value=h.aoMap,p.aoMapIntensity.value=h.aoMapIntensity,e(h.aoMap,p.aoMapTransform))}function a(p,h){p.diffuse.value.copy(h.color),p.opacity.value=h.opacity,h.map&&(p.map.value=h.map,e(h.map,p.mapTransform))}function o(p,h){p.dashSize.value=h.dashSize,p.totalSize.value=h.dashSize+h.gapSize,p.scale.value=h.scale}function l(p,h,A,b){p.diffuse.value.copy(h.color),p.opacity.value=h.opacity,p.size.value=h.size*A,p.scale.value=b*.5,h.map&&(p.map.value=h.map,e(h.map,p.uvTransform)),h.alphaMap&&(p.alphaMap.value=h.alphaMap,e(h.alphaMap,p.alphaMapTransform)),h.alphaTest>0&&(p.alphaTest.value=h.alphaTest)}function c(p,h){p.diffuse.value.copy(h.color),p.opacity.value=h.opacity,p.rotation.value=h.rotation,h.map&&(p.map.value=h.map,e(h.map,p.mapTransform)),h.alphaMap&&(p.alphaMap.value=h.alphaMap,e(h.alphaMap,p.alphaMapTransform)),h.alphaTest>0&&(p.alphaTest.value=h.alphaTest)}function u(p,h){p.specular.value.copy(h.specular),p.shininess.value=Math.max(h.shininess,1e-4)}function d(p,h){h.gradientMap&&(p.gradientMap.value=h.gradientMap)}function f(p,h){p.metalness.value=h.metalness,h.metalnessMap&&(p.metalnessMap.value=h.metalnessMap,e(h.metalnessMap,p.metalnessMapTransform)),p.roughness.value=h.roughness,h.roughnessMap&&(p.roughnessMap.value=h.roughnessMap,e(h.roughnessMap,p.roughnessMapTransform)),h.envMap&&(p.envMapIntensity.value=h.envMapIntensity)}function m(p,h,A){p.ior.value=h.ior,h.sheen>0&&(p.sheenColor.value.copy(h.sheenColor).multiplyScalar(h.sheen),p.sheenRoughness.value=h.sheenRoughness,h.sheenColorMap&&(p.sheenColorMap.value=h.sheenColorMap,e(h.sheenColorMap,p.sheenColorMapTransform)),h.sheenRoughnessMap&&(p.sheenRoughnessMap.value=h.sheenRoughnessMap,e(h.sheenRoughnessMap,p.sheenRoughnessMapTransform))),h.clearcoat>0&&(p.clearcoat.value=h.clearcoat,p.clearcoatRoughness.value=h.clearcoatRoughness,h.clearcoatMap&&(p.clearcoatMap.value=h.clearcoatMap,e(h.clearcoatMap,p.clearcoatMapTransform)),h.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=h.clearcoatRoughnessMap,e(h.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),h.clearcoatNormalMap&&(p.clearcoatNormalMap.value=h.clearcoatNormalMap,e(h.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(h.clearcoatNormalScale),h.side===Ne&&p.clearcoatNormalScale.value.negate())),h.dispersion>0&&(p.dispersion.value=h.dispersion),h.iridescence>0&&(p.iridescence.value=h.iridescence,p.iridescenceIOR.value=h.iridescenceIOR,p.iridescenceThicknessMinimum.value=h.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=h.iridescenceThicknessRange[1],h.iridescenceMap&&(p.iridescenceMap.value=h.iridescenceMap,e(h.iridescenceMap,p.iridescenceMapTransform)),h.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=h.iridescenceThicknessMap,e(h.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),h.transmission>0&&(p.transmission.value=h.transmission,p.transmissionSamplerMap.value=A.texture,p.transmissionSamplerSize.value.set(A.width,A.height),h.transmissionMap&&(p.transmissionMap.value=h.transmissionMap,e(h.transmissionMap,p.transmissionMapTransform)),p.thickness.value=h.thickness,h.thicknessMap&&(p.thicknessMap.value=h.thicknessMap,e(h.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=h.attenuationDistance,p.attenuationColor.value.copy(h.attenuationColor)),h.anisotropy>0&&(p.anisotropyVector.value.set(h.anisotropy*Math.cos(h.anisotropyRotation),h.anisotropy*Math.sin(h.anisotropyRotation)),h.anisotropyMap&&(p.anisotropyMap.value=h.anisotropyMap,e(h.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=h.specularIntensity,p.specularColor.value.copy(h.specularColor),h.specularColorMap&&(p.specularColorMap.value=h.specularColorMap,e(h.specularColorMap,p.specularColorMapTransform)),h.specularIntensityMap&&(p.specularIntensityMap.value=h.specularIntensityMap,e(h.specularIntensityMap,p.specularIntensityMapTransform))}function g(p,h){h.matcap&&(p.matcap.value=h.matcap)}function x(p,h){const A=t.get(h).light;p.referencePosition.value.setFromMatrixPosition(A.matrixWorld),p.nearDistance.value=A.shadow.camera.near,p.farDistance.value=A.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function Fm(i,t,e,n){let s={},r={},a=[];const o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(A,b){const E=b.program;n.uniformBlockBinding(A,E)}function c(A,b){let E=s[A.id];E===void 0&&(g(A),E=u(A),s[A.id]=E,A.addEventListener("dispose",p));const D=b.program;n.updateUBOMapping(A,D);const w=t.render.frame;r[A.id]!==w&&(f(A),r[A.id]=w)}function u(A){const b=d();A.__bindingPointIndex=b;const E=i.createBuffer(),D=A.__size,w=A.usage;return i.bindBuffer(i.UNIFORM_BUFFER,E),i.bufferData(i.UNIFORM_BUFFER,D,w),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,b,E),E}function d(){for(let A=0;A0&&(E+=D-w),A.__size=E,A.__cache={},this}function x(A){const b={boundary:0,storage:0};return typeof A=="number"||typeof A=="boolean"?(b.boundary=4,b.storage=4):A.isVector2?(b.boundary=8,b.storage=8):A.isVector3||A.isColor?(b.boundary=16,b.storage=12):A.isVector4?(b.boundary=16,b.storage=16):A.isMatrix3?(b.boundary=48,b.storage=48):A.isMatrix4?(b.boundary=64,b.storage=64):A.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",A),b}function p(A){const b=A.target;b.removeEventListener("dispose",p);const E=a.indexOf(b.__bindingPointIndex);a.splice(E,1),i.deleteBuffer(s[b.id]),delete s[b.id],delete r[b.id]}function h(){for(const A in s)i.deleteBuffer(s[A]);a=[],s={},r={}}return{bind:l,update:c,dispose:h}}class Om{constructor(t={}){const{canvas:e=uh(),context:n=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=t;this.isWebGLRenderer=!0;let m;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");m=n.getContextAttributes().alpha}else m=a;const g=new Uint32Array(4),x=new Int32Array(4);let p=null,h=null;const A=[],b=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ye,this.toneMapping=Un,this.toneMappingExposure=1;const E=this;let D=!1,w=0,R=0,N=null,y=-1,M=null;const C=new le,W=new le;let H=null;const q=new Dt(0);let J=0,X=e.width,at=e.height,k=1,ut=null,xt=null;const Rt=new le(0,0,X,at),Vt=new le(0,0,X,at);let wt=!1;const V=new Ya;let it=!1,Mt=!1;this.transmissionResolutionScale=1;const ct=new ne,Ct=new ne,Pt=new P,nt=new le,Q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let O=!1;function ot(){return N===null?k:1}let T=n;function lt(v,U){return e.getContext(v,U)}try{const v={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Oa}`),e.addEventListener("webglcontextlost",Z,!1),e.addEventListener("webglcontextrestored",St,!1),e.addEventListener("webglcontextcreationerror",vt,!1),T===null){const U="webgl2";if(T=lt(U,v),T===null)throw lt(U)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(v){throw console.error("THREE.WebGLRenderer: "+v.message),v}let tt,rt,$,Ft,_t,S,_,F,j,K,Y,Et,ft,ht,Ot,et,gt,Lt,Bt,yt,Zt,kt,se,L;function pt(){tt=new Yf(T),tt.init(),kt=new Rm(T,tt),rt=new Hf(T,tt,t,kt),$=new Am(T,tt),rt.reverseDepthBuffer&&f&&$.buffers.depth.setReversed(!0),Ft=new Zf(T),_t=new fm,S=new wm(T,tt,$,_t,rt,kt,Ft),_=new Vf(E),F=new Xf(E),j=new eu(T),se=new Bf(T,j),K=new qf(T,j,Ft,se),Y=new $f(T,K,j,Ft),Bt=new Kf(T,rt,S),et=new kf(_t),Et=new dm(E,_,F,tt,rt,se,et),ft=new Nm(E,_t),ht=new mm,Ot=new Sm(tt),Lt=new Of(E,_,F,$,Y,m,l),gt=new Tm(E,Y,rt),L=new Fm(T,Ft,rt,$),yt=new zf(T,tt,Ft),Zt=new jf(T,tt,Ft),Ft.programs=Et.programs,E.capabilities=rt,E.extensions=tt,E.properties=_t,E.renderLists=ht,E.shadowMap=gt,E.state=$,E.info=Ft}pt();const G=new Um(E,T);this.xr=G,this.getContext=function(){return T},this.getContextAttributes=function(){return T.getContextAttributes()},this.forceContextLoss=function(){const v=tt.get("WEBGL_lose_context");v&&v.loseContext()},this.forceContextRestore=function(){const v=tt.get("WEBGL_lose_context");v&&v.restoreContext()},this.getPixelRatio=function(){return k},this.setPixelRatio=function(v){v!==void 0&&(k=v,this.setSize(X,at,!1))},this.getSize=function(v){return v.set(X,at)},this.setSize=function(v,U,B=!0){if(G.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=v,at=U,e.width=Math.floor(v*k),e.height=Math.floor(U*k),B===!0&&(e.style.width=v+"px",e.style.height=U+"px"),this.setViewport(0,0,v,U)},this.getDrawingBufferSize=function(v){return v.set(X*k,at*k).floor()},this.setDrawingBufferSize=function(v,U,B){X=v,at=U,k=B,e.width=Math.floor(v*B),e.height=Math.floor(U*B),this.setViewport(0,0,v,U)},this.getCurrentViewport=function(v){return v.copy(C)},this.getViewport=function(v){return v.copy(Rt)},this.setViewport=function(v,U,B,z){v.isVector4?Rt.set(v.x,v.y,v.z,v.w):Rt.set(v,U,B,z),$.viewport(C.copy(Rt).multiplyScalar(k).round())},this.getScissor=function(v){return v.copy(Vt)},this.setScissor=function(v,U,B,z){v.isVector4?Vt.set(v.x,v.y,v.z,v.w):Vt.set(v,U,B,z),$.scissor(W.copy(Vt).multiplyScalar(k).round())},this.getScissorTest=function(){return wt},this.setScissorTest=function(v){$.setScissorTest(wt=v)},this.setOpaqueSort=function(v){ut=v},this.setTransparentSort=function(v){xt=v},this.getClearColor=function(v){return v.copy(Lt.getClearColor())},this.setClearColor=function(){Lt.setClearColor.apply(Lt,arguments)},this.getClearAlpha=function(){return Lt.getClearAlpha()},this.setClearAlpha=function(){Lt.setClearAlpha.apply(Lt,arguments)},this.clear=function(v=!0,U=!0,B=!0){let z=0;if(v){let I=!1;if(N!==null){const st=N.texture.format;I=st===Wa||st===Ga||st===Va}if(I){const st=N.texture.type,mt=st===En||st===$n||st===Qi||st===Ui||st===za||st===Ha,Tt=Lt.getClearColor(),bt=Lt.getClearAlpha(),zt=Tt.r,Ht=Tt.g,Ut=Tt.b;mt?(g[0]=zt,g[1]=Ht,g[2]=Ut,g[3]=bt,T.clearBufferuiv(T.COLOR,0,g)):(x[0]=zt,x[1]=Ht,x[2]=Ut,x[3]=bt,T.clearBufferiv(T.COLOR,0,x))}else z|=T.COLOR_BUFFER_BIT}U&&(z|=T.DEPTH_BUFFER_BIT),B&&(z|=T.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),T.clear(z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Z,!1),e.removeEventListener("webglcontextrestored",St,!1),e.removeEventListener("webglcontextcreationerror",vt,!1),Lt.dispose(),ht.dispose(),Ot.dispose(),_t.dispose(),_.dispose(),F.dispose(),Y.dispose(),se.dispose(),L.dispose(),Et.dispose(),G.dispose(),G.removeEventListener("sessionstart",$a),G.removeEventListener("sessionend",Ja),On.stop()};function Z(v){v.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),D=!0}function St(){console.log("THREE.WebGLRenderer: Context Restored."),D=!1;const v=Ft.autoReset,U=gt.enabled,B=gt.autoUpdate,z=gt.needsUpdate,I=gt.type;pt(),Ft.autoReset=v,gt.enabled=U,gt.autoUpdate=B,gt.needsUpdate=z,gt.type=I}function vt(v){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",v.statusMessage)}function Gt(v){const U=v.target;U.removeEventListener("dispose",Gt),he(U)}function he(v){ye(v),_t.remove(v)}function ye(v){const U=_t.get(v).programs;U!==void 0&&(U.forEach(function(B){Et.releaseProgram(B)}),v.isShaderMaterial&&Et.releaseShaderCache(v))}this.renderBufferDirect=function(v,U,B,z,I,st){U===null&&(U=Q);const mt=I.isMesh&&I.matrixWorld.determinant()<0,Tt=rc(v,U,B,z,I);$.setMaterial(z,mt);let bt=B.index,zt=1;if(z.wireframe===!0){if(bt=K.getWireframeAttribute(B),bt===void 0)return;zt=2}const Ht=B.drawRange,Ut=B.attributes.position;let $t=Ht.start*zt,te=(Ht.start+Ht.count)*zt;st!==null&&($t=Math.max($t,st.start*zt),te=Math.min(te,(st.start+st.count)*zt)),bt!==null?($t=Math.max($t,0),te=Math.min(te,bt.count)):Ut!=null&&($t=Math.max($t,0),te=Math.min(te,Ut.count));const de=te-$t;if(de<0||de===1/0)return;se.setup(I,z,Tt,B,bt);let ue,Jt=yt;if(bt!==null&&(ue=j.get(bt),Jt=Zt,Jt.setIndex(ue)),I.isMesh)z.wireframe===!0?($.setLineWidth(z.wireframeLinewidth*ot()),Jt.setMode(T.LINES)):Jt.setMode(T.TRIANGLES);else if(I.isLine){let It=z.linewidth;It===void 0&&(It=1),$.setLineWidth(It*ot()),I.isLineSegments?Jt.setMode(T.LINES):I.isLineLoop?Jt.setMode(T.LINE_LOOP):Jt.setMode(T.LINE_STRIP)}else I.isPoints?Jt.setMode(T.POINTS):I.isSprite&&Jt.setMode(T.TRIANGLES);if(I.isBatchedMesh)if(I._multiDrawInstances!==null)Jt.renderMultiDrawInstances(I._multiDrawStarts,I._multiDrawCounts,I._multiDrawCount,I._multiDrawInstances);else if(tt.get("WEBGL_multi_draw"))Jt.renderMultiDraw(I._multiDrawStarts,I._multiDrawCounts,I._multiDrawCount);else{const It=I._multiDrawStarts,Me=I._multiDrawCounts,ee=I._multiDrawCount,Ze=bt?j.get(bt).bytesPerElement:1,ni=_t.get(z).currentProgram.getUniforms();for(let Fe=0;Fe{function st(){if(z.forEach(function(mt){_t.get(mt).currentProgram.isReady()&&z.delete(mt)}),z.size===0){I(v);return}setTimeout(st,10)}tt.get("KHR_parallel_shader_compile")!==null?st():setTimeout(st,10)})};let je=null;function un(v){je&&je(v)}function $a(){On.stop()}function Ja(){On.start()}const On=new $l;On.setAnimationLoop(un),typeof self<"u"&&On.setContext(self),this.setAnimationLoop=function(v){je=v,G.setAnimationLoop(v),v===null?On.stop():On.start()},G.addEventListener("sessionstart",$a),G.addEventListener("sessionend",Ja),this.render=function(v,U){if(U!==void 0&&U.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(D===!0)return;if(v.matrixWorldAutoUpdate===!0&&v.updateMatrixWorld(),U.parent===null&&U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),G.enabled===!0&&G.isPresenting===!0&&(G.cameraAutoUpdate===!0&&G.updateCamera(U),U=G.getCamera()),v.isScene===!0&&v.onBeforeRender(E,v,U,N),h=Ot.get(v,b.length),h.init(U),b.push(h),Ct.multiplyMatrices(U.projectionMatrix,U.matrixWorldInverse),V.setFromProjectionMatrix(Ct),Mt=this.localClippingEnabled,it=et.init(this.clippingPlanes,Mt),p=ht.get(v,A.length),p.init(),A.push(p),G.enabled===!0&&G.isPresenting===!0){const st=E.xr.getDepthSensingMesh();st!==null&&ir(st,U,-1/0,E.sortObjects)}ir(v,U,0,E.sortObjects),p.finish(),E.sortObjects===!0&&p.sort(ut,xt),O=G.enabled===!1||G.isPresenting===!1||G.hasDepthSensing()===!1,O&&Lt.addToRenderList(p,v),this.info.render.frame++,it===!0&&et.beginShadows();const B=h.state.shadowsArray;gt.render(B,v,U),it===!0&&et.endShadows(),this.info.autoReset===!0&&this.info.reset();const z=p.opaque,I=p.transmissive;if(h.setupLights(),U.isArrayCamera){const st=U.cameras;if(I.length>0)for(let mt=0,Tt=st.length;mt0&&to(z,I,v,U),O&&Lt.render(v),Qa(p,v,U);N!==null&&R===0&&(S.updateMultisampleRenderTarget(N),S.updateRenderTargetMipmap(N)),v.isScene===!0&&v.onAfterRender(E,v,U),se.resetDefaultState(),y=-1,M=null,b.pop(),b.length>0?(h=b[b.length-1],it===!0&&et.setGlobalState(E.clippingPlanes,h.state.camera)):h=null,A.pop(),A.length>0?p=A[A.length-1]:p=null};function ir(v,U,B,z){if(v.visible===!1)return;if(v.layers.test(U.layers)){if(v.isGroup)B=v.renderOrder;else if(v.isLOD)v.autoUpdate===!0&&v.update(U);else if(v.isLight)h.pushLight(v),v.castShadow&&h.pushShadow(v);else if(v.isSprite){if(!v.frustumCulled||V.intersectsSprite(v)){z&&nt.setFromMatrixPosition(v.matrixWorld).applyMatrix4(Ct);const mt=Y.update(v),Tt=v.material;Tt.visible&&p.push(v,mt,Tt,B,nt.z,null)}}else if((v.isMesh||v.isLine||v.isPoints)&&(!v.frustumCulled||V.intersectsObject(v))){const mt=Y.update(v),Tt=v.material;if(z&&(v.boundingSphere!==void 0?(v.boundingSphere===null&&v.computeBoundingSphere(),nt.copy(v.boundingSphere.center)):(mt.boundingSphere===null&&mt.computeBoundingSphere(),nt.copy(mt.boundingSphere.center)),nt.applyMatrix4(v.matrixWorld).applyMatrix4(Ct)),Array.isArray(Tt)){const bt=mt.groups;for(let zt=0,Ht=bt.length;zt0&&is(I,U,B),st.length>0&&is(st,U,B),mt.length>0&&is(mt,U,B),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1)}function to(v,U,B,z){if((B.isScene===!0?B.overrideMaterial:null)!==null)return;h.state.transmissionRenderTarget[z.id]===void 0&&(h.state.transmissionRenderTarget[z.id]=new en(1,1,{generateMipmaps:!0,type:tt.has("EXT_color_buffer_half_float")||tt.has("EXT_color_buffer_float")?Sn:En,minFilter:Kn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Qt.workingColorSpace}));const st=h.state.transmissionRenderTarget[z.id],mt=z.viewport||C;st.setSize(mt.z*E.transmissionResolutionScale,mt.w*E.transmissionResolutionScale);const Tt=E.getRenderTarget();E.setRenderTarget(st),E.getClearColor(q),J=E.getClearAlpha(),J<1&&E.setClearColor(16777215,.5),E.clear(),O&&Lt.render(B);const bt=E.toneMapping;E.toneMapping=Un;const zt=z.viewport;if(z.viewport!==void 0&&(z.viewport=void 0),h.setupLightsView(z),it===!0&&et.setGlobalState(E.clippingPlanes,z),is(v,B,z),S.updateMultisampleRenderTarget(st),S.updateRenderTargetMipmap(st),tt.has("WEBGL_multisampled_render_to_texture")===!1){let Ht=!1;for(let Ut=0,$t=U.length;Ut<$t;Ut++){const te=U[Ut],de=te.object,ue=te.geometry,Jt=te.material,It=te.group;if(Jt.side===an&&de.layers.test(z.layers)){const Me=Jt.side;Jt.side=Ne,Jt.needsUpdate=!0,eo(de,B,z,ue,Jt,It),Jt.side=Me,Jt.needsUpdate=!0,Ht=!0}}Ht===!0&&(S.updateMultisampleRenderTarget(st),S.updateRenderTargetMipmap(st))}E.setRenderTarget(Tt),E.setClearColor(q,J),zt!==void 0&&(z.viewport=zt),E.toneMapping=bt}function is(v,U,B){const z=U.isScene===!0?U.overrideMaterial:null;for(let I=0,st=v.length;I0),Ut=!!B.morphAttributes.position,$t=!!B.morphAttributes.normal,te=!!B.morphAttributes.color;let de=Un;z.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(de=E.toneMapping);const ue=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,Jt=ue!==void 0?ue.length:0,It=_t.get(z),Me=h.state.lights;if(it===!0&&(Mt===!0||v!==M)){const Re=v===M&&z.id===y;et.setState(z,v,Re)}let ee=!1;z.version===It.__version?(It.needsLights&&It.lightsStateVersion!==Me.state.version||It.outputColorSpace!==Tt||I.isBatchedMesh&&It.batching===!1||!I.isBatchedMesh&&It.batching===!0||I.isBatchedMesh&&It.batchingColor===!0&&I.colorTexture===null||I.isBatchedMesh&&It.batchingColor===!1&&I.colorTexture!==null||I.isInstancedMesh&&It.instancing===!1||!I.isInstancedMesh&&It.instancing===!0||I.isSkinnedMesh&&It.skinning===!1||!I.isSkinnedMesh&&It.skinning===!0||I.isInstancedMesh&&It.instancingColor===!0&&I.instanceColor===null||I.isInstancedMesh&&It.instancingColor===!1&&I.instanceColor!==null||I.isInstancedMesh&&It.instancingMorph===!0&&I.morphTexture===null||I.isInstancedMesh&&It.instancingMorph===!1&&I.morphTexture!==null||It.envMap!==bt||z.fog===!0&&It.fog!==st||It.numClippingPlanes!==void 0&&(It.numClippingPlanes!==et.numPlanes||It.numIntersection!==et.numIntersection)||It.vertexAlphas!==zt||It.vertexTangents!==Ht||It.morphTargets!==Ut||It.morphNormals!==$t||It.morphColors!==te||It.toneMapping!==de||It.morphTargetsCount!==Jt)&&(ee=!0):(ee=!0,It.__version=z.version);let Ze=It.currentProgram;ee===!0&&(Ze=ss(z,U,I));let ni=!1,Fe=!1,zi=!1;const ce=Ze.getUniforms(),Ve=It.uniforms;if($.useProgram(Ze.program)&&(ni=!0,Fe=!0,zi=!0),z.id!==y&&(y=z.id,Fe=!0),ni||M!==v){$.buffers.depth.getReversed()?(ct.copy(v.projectionMatrix),fh(ct),ph(ct),ce.setValue(T,"projectionMatrix",ct)):ce.setValue(T,"projectionMatrix",v.projectionMatrix),ce.setValue(T,"viewMatrix",v.matrixWorldInverse);const Le=ce.map.cameraPosition;Le!==void 0&&Le.setValue(T,Pt.setFromMatrixPosition(v.matrixWorld)),rt.logarithmicDepthBuffer&&ce.setValue(T,"logDepthBufFC",2/(Math.log(v.far+1)/Math.LN2)),(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial)&&ce.setValue(T,"isOrthographic",v.isOrthographicCamera===!0),M!==v&&(M=v,Fe=!0,zi=!0)}if(I.isSkinnedMesh){ce.setOptional(T,I,"bindMatrix"),ce.setOptional(T,I,"bindMatrixInverse");const Re=I.skeleton;Re&&(Re.boneTexture===null&&Re.computeBoneTexture(),ce.setValue(T,"boneTexture",Re.boneTexture,S))}I.isBatchedMesh&&(ce.setOptional(T,I,"batchingTexture"),ce.setValue(T,"batchingTexture",I._matricesTexture,S),ce.setOptional(T,I,"batchingIdTexture"),ce.setValue(T,"batchingIdTexture",I._indirectTexture,S),ce.setOptional(T,I,"batchingColorTexture"),I._colorsTexture!==null&&ce.setValue(T,"batchingColorTexture",I._colorsTexture,S));const Ge=B.morphAttributes;if((Ge.position!==void 0||Ge.normal!==void 0||Ge.color!==void 0)&&Bt.update(I,B,Ze),(Fe||It.receiveShadow!==I.receiveShadow)&&(It.receiveShadow=I.receiveShadow,ce.setValue(T,"receiveShadow",I.receiveShadow)),z.isMeshGouraudMaterial&&z.envMap!==null&&(Ve.envMap.value=bt,Ve.flipEnvMap.value=bt.isCubeTexture&&bt.isRenderTargetTexture===!1?-1:1),z.isMeshStandardMaterial&&z.envMap===null&&U.environment!==null&&(Ve.envMapIntensity.value=U.environmentIntensity),Fe&&(ce.setValue(T,"toneMappingExposure",E.toneMappingExposure),It.needsLights&&ac(Ve,zi),st&&z.fog===!0&&ft.refreshFogUniforms(Ve,st),ft.refreshMaterialUniforms(Ve,z,k,at,h.state.transmissionRenderTarget[v.id]),Gs.upload(T,no(It),Ve,S)),z.isShaderMaterial&&z.uniformsNeedUpdate===!0&&(Gs.upload(T,no(It),Ve,S),z.uniformsNeedUpdate=!1),z.isSpriteMaterial&&ce.setValue(T,"center",I.center),ce.setValue(T,"modelViewMatrix",I.modelViewMatrix),ce.setValue(T,"normalMatrix",I.normalMatrix),ce.setValue(T,"modelMatrix",I.matrixWorld),z.isShaderMaterial||z.isRawShaderMaterial){const Re=z.uniformsGroups;for(let Le=0,sr=Re.length;Le0&&S.useMultisampledRTT(v)===!1?I=_t.get(v).__webglMultisampledFramebuffer:Array.isArray(Ht)?I=Ht[B]:I=Ht,C.copy(v.viewport),W.copy(v.scissor),H=v.scissorTest}else C.copy(Rt).multiplyScalar(k).floor(),W.copy(Vt).multiplyScalar(k).floor(),H=wt;if(B!==0&&(I=lc),$.bindFramebuffer(T.FRAMEBUFFER,I)&&z&&$.drawBuffers(v,I),$.viewport(C),$.scissor(W),$.setScissorTest(H),st){const bt=_t.get(v.texture);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+U,bt.__webglTexture,B)}else if(mt){const bt=_t.get(v.texture),zt=U;T.framebufferTextureLayer(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,bt.__webglTexture,B,zt)}else if(v!==null&&B!==0){const bt=_t.get(v.texture);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_2D,bt.__webglTexture,B)}y=-1},this.readRenderTargetPixels=function(v,U,B,z,I,st,mt){if(!(v&&v.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Tt=_t.get(v).__webglFramebuffer;if(v.isWebGLCubeRenderTarget&&mt!==void 0&&(Tt=Tt[mt]),Tt){$.bindFramebuffer(T.FRAMEBUFFER,Tt);try{const bt=v.texture,zt=bt.format,Ht=bt.type;if(!rt.textureFormatReadable(zt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!rt.textureTypeReadable(Ht)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}U>=0&&U<=v.width-z&&B>=0&&B<=v.height-I&&T.readPixels(U,B,z,I,kt.convert(zt),kt.convert(Ht),st)}finally{const bt=N!==null?_t.get(N).__webglFramebuffer:null;$.bindFramebuffer(T.FRAMEBUFFER,bt)}}},this.readRenderTargetPixelsAsync=async function(v,U,B,z,I,st,mt){if(!(v&&v.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Tt=_t.get(v).__webglFramebuffer;if(v.isWebGLCubeRenderTarget&&mt!==void 0&&(Tt=Tt[mt]),Tt){const bt=v.texture,zt=bt.format,Ht=bt.type;if(!rt.textureFormatReadable(zt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!rt.textureTypeReadable(Ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(U>=0&&U<=v.width-z&&B>=0&&B<=v.height-I){$.bindFramebuffer(T.FRAMEBUFFER,Tt);const Ut=T.createBuffer();T.bindBuffer(T.PIXEL_PACK_BUFFER,Ut),T.bufferData(T.PIXEL_PACK_BUFFER,st.byteLength,T.STREAM_READ),T.readPixels(U,B,z,I,kt.convert(zt),kt.convert(Ht),0);const $t=N!==null?_t.get(N).__webglFramebuffer:null;$.bindFramebuffer(T.FRAMEBUFFER,$t);const te=T.fenceSync(T.SYNC_GPU_COMMANDS_COMPLETE,0);return T.flush(),await dh(T,te,4),T.bindBuffer(T.PIXEL_PACK_BUFFER,Ut),T.getBufferSubData(T.PIXEL_PACK_BUFFER,0,st),T.deleteBuffer(Ut),T.deleteSync(te),st}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(v,U=null,B=0){v.isTexture!==!0&&(yi("WebGLRenderer: copyFramebufferToTexture function signature has changed."),U=arguments[0]||null,v=arguments[1]);const z=Math.pow(2,-B),I=Math.floor(v.image.width*z),st=Math.floor(v.image.height*z),mt=U!==null?U.x:0,Tt=U!==null?U.y:0;S.setTexture2D(v,0),T.copyTexSubImage2D(T.TEXTURE_2D,B,0,0,mt,Tt,I,st),$.unbindTexture()};const cc=T.createFramebuffer(),hc=T.createFramebuffer();this.copyTextureToTexture=function(v,U,B=null,z=null,I=0,st=null){v.isTexture!==!0&&(yi("WebGLRenderer: copyTextureToTexture function signature has changed."),z=arguments[0]||null,v=arguments[1],U=arguments[2],st=arguments[3]||0,B=null),st===null&&(I!==0?(yi("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),st=I,I=0):st=0);let mt,Tt,bt,zt,Ht,Ut,$t,te,de;const ue=v.isCompressedTexture?v.mipmaps[st]:v.image;if(B!==null)mt=B.max.x-B.min.x,Tt=B.max.y-B.min.y,bt=B.isBox3?B.max.z-B.min.z:1,zt=B.min.x,Ht=B.min.y,Ut=B.isBox3?B.min.z:0;else{const Ge=Math.pow(2,-I);mt=Math.floor(ue.width*Ge),Tt=Math.floor(ue.height*Ge),v.isDataArrayTexture?bt=ue.depth:v.isData3DTexture?bt=Math.floor(ue.depth*Ge):bt=1,zt=0,Ht=0,Ut=0}z!==null?($t=z.x,te=z.y,de=z.z):($t=0,te=0,de=0);const Jt=kt.convert(U.format),It=kt.convert(U.type);let Me;U.isData3DTexture?(S.setTexture3D(U,0),Me=T.TEXTURE_3D):U.isDataArrayTexture||U.isCompressedArrayTexture?(S.setTexture2DArray(U,0),Me=T.TEXTURE_2D_ARRAY):(S.setTexture2D(U,0),Me=T.TEXTURE_2D),T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,U.flipY),T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),T.pixelStorei(T.UNPACK_ALIGNMENT,U.unpackAlignment);const ee=T.getParameter(T.UNPACK_ROW_LENGTH),Ze=T.getParameter(T.UNPACK_IMAGE_HEIGHT),ni=T.getParameter(T.UNPACK_SKIP_PIXELS),Fe=T.getParameter(T.UNPACK_SKIP_ROWS),zi=T.getParameter(T.UNPACK_SKIP_IMAGES);T.pixelStorei(T.UNPACK_ROW_LENGTH,ue.width),T.pixelStorei(T.UNPACK_IMAGE_HEIGHT,ue.height),T.pixelStorei(T.UNPACK_SKIP_PIXELS,zt),T.pixelStorei(T.UNPACK_SKIP_ROWS,Ht),T.pixelStorei(T.UNPACK_SKIP_IMAGES,Ut);const ce=v.isDataArrayTexture||v.isData3DTexture,Ve=U.isDataArrayTexture||U.isData3DTexture;if(v.isDepthTexture){const Ge=_t.get(v),Re=_t.get(U),Le=_t.get(Ge.__renderTarget),sr=_t.get(Re.__renderTarget);$.bindFramebuffer(T.READ_FRAMEBUFFER,Le.__webglFramebuffer),$.bindFramebuffer(T.DRAW_FRAMEBUFFER,sr.__webglFramebuffer);for(let Bn=0;BnMath.PI&&(n-=Ue),s<-Math.PI?s+=Ue:s>Math.PI&&(s-=Ue),n<=s?this._spherical.theta=Math.max(n,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+s)/2?Math.max(n,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(pe.setFromSpherical(this._spherical),pe.applyQuaternion(this._quatInverse),e.copy(this.target).add(pe),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=pe.length();a=this._clampDistance(o*this._scale);const l=o-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),r=!!l}else if(this.object.isOrthographicCamera){const o=new P(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=l!==this.object.zoom;const c=new P(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(o),this.object.updateMatrixWorld(),a=pe.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(Ns.origin.copy(this.object.position),Ns.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Ns.direction))zr||8*(1-this._lastQuaternion.dot(this.object.quaternion))>zr||this._lastTargetPosition.distanceToSquared(this.target)>zr?(this.dispatchEvent(gl),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Ue/60*this.autoRotateSpeed*t:Ue/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){pe.setFromMatrixColumn(e,0),pe.multiplyScalar(-t),this._panOffset.add(pe)}_panUp(t,e){this.screenSpacePanning===!0?pe.setFromMatrixColumn(e,1):(pe.setFromMatrixColumn(e,0),pe.crossVectors(this.object.up,pe)),pe.multiplyScalar(t),this._panOffset.add(pe)}_pan(t,e){const n=this.domElement;if(this.object.isPerspectiveCamera){const s=this.object.position;pe.copy(s).sub(this.target);let r=pe.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/n.clientHeight,this.object.matrix),this._panUp(2*e*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),s=t-n.left,r=e-n.top,a=n.width,o=n.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Ue*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ue*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(n,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(n,s)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Ue*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ue*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(n,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e - varying vec2 vUv; - uniform sampler2D colorTexture; - uniform vec2 invSize; - uniform vec2 direction; - uniform float gaussianCoefficients[KERNEL_RADIUS]; - - void main() { - float weightSum = gaussianCoefficients[0]; - vec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum; - for( int i = 1; i < KERNEL_RADIUS; i ++ ) { - float x = float(i); - float w = gaussianCoefficients[i]; - vec2 uvOffset = direction * invSize * x; - vec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb; - vec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb; - diffuseSum += (sample1 + sample2) * w; - weightSum += 2.0 * w; - } - gl_FragColor = vec4(diffuseSum/weightSum, 1.0); - }`})}getCompositeMaterial(t){return new Ie({defines:{NUM_MIPS:t},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv; - void main() { - vUv = uv; - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - }`,fragmentShader:`varying vec2 vUv; - uniform sampler2D blurTexture1; - uniform sampler2D blurTexture2; - uniform sampler2D blurTexture3; - uniform sampler2D blurTexture4; - uniform sampler2D blurTexture5; - uniform float bloomStrength; - uniform float bloomRadius; - uniform float bloomFactors[NUM_MIPS]; - uniform vec3 bloomTintColors[NUM_MIPS]; - - float lerpBloomFactor(const in float factor) { - float mirrorFactor = 1.2 - factor; - return mix(factor, mirrorFactor, bloomRadius); - } - - void main() { - gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + - lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + - lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + - lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + - lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) ); - }`})}}Oi.BlurDirectionX=new At(1,0);Oi.BlurDirectionY=new At(0,1);var a_=nn('
');function o_(i,t){Na(t,!0);let e=Ws(t,"events",19,()=>[]),n=Ws(t,"isDreaming",3,!1),s,r,a,o,l,c,u,d,f,m,g,x,p,h,A=new Map,b=new Map,E=new Map,D=null,w=null,R=new Map,N=0,y=0,M=[],C=[],W=[],H=[];Ml(()=>{q(),J(),X(),at(),xt(),window.addEventListener("resize",Mt),s.addEventListener("pointermove",ct),s.addEventListener("click",Ct)}),uc(()=>{cancelAnimationFrame(m),window.removeEventListener("resize",Mt),s==null||s.removeEventListener("pointermove",ct),s==null||s.removeEventListener("click",Ct),a==null||a.traverse(nt=>{var Q;(nt instanceof De||nt instanceof Hh)&&((Q=nt.geometry)==null||Q.dispose(),Array.isArray(nt.material)?nt.material.forEach(O=>O.dispose()):nt.material&&nt.material.dispose())}),r==null||r.dispose(),c==null||c.dispose()});function q(){a=new Fh,a.fog=new Zs(328976,.008),o=new He(60,s.clientWidth/s.clientHeight,.1,2e3),o.position.set(0,30,80),r=new Om({antialias:!0,alpha:!0,powerPreference:"high-performance"}),r.setSize(s.clientWidth,s.clientHeight),r.setPixelRatio(Math.min(window.devicePixelRatio,2)),r.toneMapping=bl,r.toneMappingExposure=1.2,s.appendChild(r.domElement),l=new zm(o,r.domElement),l.enableDamping=!0,l.dampingFactor=.05,l.rotateSpeed=.5,l.zoomSpeed=.8,l.minDistance=10,l.maxDistance=500,l.autoRotate=!0,l.autoRotateSpeed=.3,c=new i_(r),c.addPass(new s_(a,o)),u=new Oi(new At(s.clientWidth,s.clientHeight),.8,.4,.85),c.addPass(u);const nt=new Zh(1710650,.5);a.add(nt);const Q=new ko(6514417,1.5,200);Q.position.set(50,50,50),a.add(Q);const O=new ko(11032055,1,200);O.position.set(-50,-30,-50),a.add(O),d=new Jh,d.params.Points={threshold:2},f=new At}function J(){const nt=new xe,Q=3e3,O=new Float32Array(Q*3),ot=new Float32Array(Q);for(let lt=0;lt{const T=1-2*ot/(nt-1||1),lt=Math.sqrt(1-T*T),tt=2*Math.PI*ot/Q,rt=30+nt*.5,$=new P(lt*Math.cos(tt)*rt,T*rt,lt*Math.sin(tt)*rt);O.isCenter&&$.set(0,0,0),b.set(O.id,$),R.set(O.id,new P);const Ft=.5+O.retention*2,_t=Sc[O.type]||"#6b7280",S=new ja(Ft,16,16),_=new Wh({color:new Dt(_t),emissive:new Dt(_t),emissiveIntensity:.3+O.retention*.5,roughness:.3,metalness:.1,transparent:!0,opacity:.3+O.retention*.7}),F=new De(S,_);F.position.copy($),F.userData={nodeId:O.id,type:O.type,retention:O.retention},A.set(O.id,F),g.add(F);const j=new Pa({color:new Dt(_t),transparent:!0,opacity:.15+O.retention*.2,blending:sn}),K=new Co(j);K.scale.set(Ft*4,Ft*4,1),K.position.copy($),K.userData={isGlow:!0,nodeId:O.id},g.add(K);const Y=O.label||O.type,Et=k(Y,"#e2e8f0");Et.position.copy($),Et.position.y+=Ft*2+1.5,Et.userData={isLabel:!0,nodeId:O.id,offset:Ft*2+1.5},g.add(Et),E.set(O.id,Et)}),t.edges.forEach(O=>{const ot=b.get(O.source),T=b.get(O.target);if(!ot||!T)return;const lt=[ot,T],tt=new xe().setFromPoints(lt),rt=new Da({color:4868730,transparent:!0,opacity:Math.min(.1+O.weight*.5,.6),blending:sn}),$=new No(tt,rt);$.userData={source:O.source,target:O.target},x.add($)}),a.add(x),a.add(g)}function at(){const Q=new xe,O=new Float32Array(500*3),ot=new Float32Array(500*3);for(let lt=0;lt<500;lt++)O[lt*3]=(Math.random()-.5)*100,O[lt*3+1]=(Math.random()-.5)*100,O[lt*3+2]=(Math.random()-.5)*100,ot[lt*3]=.4+Math.random()*.3,ot[lt*3+1]=.3+Math.random()*.2,ot[lt*3+2]=.8+Math.random()*.2;Q.setAttribute("position",new ve(O,3)),Q.setAttribute("color",new ve(ot,3));const T=new Vs({size:.3,vertexColors:!0,transparent:!0,opacity:.4,blending:sn,sizeAttenuation:!0});p=new Cr(Q,T),a.add(p)}function k(nt,Q){const O=document.createElement("canvas"),ot=O.getContext("2d");O.width=512,O.height=64;const T=nt.length>40?nt.slice(0,37)+"...":nt;ot.clearRect(0,0,O.width,O.height),ot.font="bold 28px -apple-system, BlinkMacSystemFont, sans-serif",ot.textAlign="center",ot.textBaseline="middle",ot.shadowColor="rgba(0, 0, 0, 0.8)",ot.shadowBlur=6,ot.shadowOffsetX=0,ot.shadowOffsetY=2,ot.fillStyle=Q,ot.fillText(T,O.width/2,O.height/2);const lt=new Gh(O);lt.needsUpdate=!0;const tt=new Pa({map:lt,transparent:!0,opacity:0,depthTest:!1,sizeAttenuation:!0}),rt=new Co(tt);return rt.scale.set(12,1.5,1),rt}function ut(){if(N>300)return;N++;const nt=Math.max(.001,1-N/300),Q=500,O=.01,ot=.9,T=Array.from(b.keys());for(let lt=0;lt{const tt=b.get(lt.source),rt=b.get(lt.target);if(!tt||!rt)return;const $=new P().subVectors(rt,tt),_t=$.length()*O*lt.weight*nt,S=$.normalize().multiplyScalar(_t);R.get(lt.source).add(S),R.get(lt.target).sub(S)}),T.forEach(lt=>{const tt=b.get(lt),rt=R.get(lt);rt.sub(tt.clone().multiplyScalar(.001*nt)),rt.multiplyScalar(ot),tt.add(rt);const $=A.get(lt);$&&$.position.copy(tt)}),g.children.forEach(lt=>{if(lt.userData.nodeId){const tt=b.get(lt.userData.nodeId);if(!tt)return;lt.userData.isGlow?lt.position.copy(tt):lt.userData.isLabel&&(lt.position.copy(tt),lt.position.y+=lt.userData.offset)}}),x.children.forEach(lt=>{const tt=lt,rt=b.get(tt.userData.source),$=b.get(tt.userData.target);if(rt&&$){const Ft=tt.geometry.attributes.position;Ft.setXYZ(0,rt.x,rt.y,rt.z),Ft.setXYZ(1,$.x,$.y,$.z),Ft.needsUpdate=!0}})}function xt(){m=requestAnimationFrame(xt);const nt=performance.now()*.001;if(ut(),p){const Q=p.geometry.attributes.position;for(let O=0;O{const ot=t.nodes.find(tt=>tt.id===O);if(!ot)return;const T=1+Math.sin(nt*1.5+t.nodes.indexOf(ot)*.5)*.05*ot.retention;Q.scale.setScalar(T);const lt=Q.material;O===D?lt.emissiveIntensity=1:O===w?lt.emissiveIntensity=.8:lt.emissiveIntensity=.3+ot.retention*.5}),E.forEach((Q,O)=>{const ot=b.get(O);if(!ot)return;const T=o.position.distanceTo(ot),lt=Q.material,tt=O===D||O===w?1:T<40?.9:T<80?.9*(1-(T-40)/40):0;lt.opacity+=(tt-lt.opacity)*.1}),n()?(l.autoRotateSpeed=.1,u.strength=1.5,a.fog=new Zs(656672,.006)):(l.autoRotateSpeed=.3,u.strength=.8),Rt(),it(),l.update(),c.render()}function Rt(){var Q,O,ot,T,lt;if(!e()||e().length<=y)return;const nt=e().slice(y);y=e().length;for(const tt of nt)switch(tt.type){case"MemoryCreated":{const rt=(Q=tt.data)==null?void 0:Q.id,$=rt?b.get(rt):null,Ft=($==null?void 0:$.clone())??new P((Math.random()-.5)*40,(Math.random()-.5)*40,(Math.random()-.5)*40);Vt(Ft,new Dt(1096065)),wt(Ft,new Dt(1096065));break}case"SearchPerformed":{(O=tt.data)==null||O.query,A.forEach((rt,$)=>{M.push({nodeId:$,intensity:.6+Math.random()*.4,color:new Dt(3900150),decay:.02})});break}case"DreamStarted":{A.forEach((rt,$)=>{M.push({nodeId:$,intensity:1,color:new Dt(11032055),decay:.005})});break}case"DreamProgress":{const rt=(ot=tt.data)==null?void 0:ot.memory_id;rt&&A.has(rt)&&M.push({nodeId:rt,intensity:1.5,color:new Dt(12616956),decay:.01});break}case"DreamCompleted":{Vt(new P(0,0,0),new Dt(11032055)),wt(new P(0,0,0),new Dt(11032055));break}case"ConnectionDiscovered":{const rt=tt.data,$=rt.source_id?b.get(rt.source_id):null,Ft=rt.target_id?b.get(rt.target_id):null;$&&Ft&&V($,Ft,new Dt(16096779));break}case"RetentionDecayed":{const rt=(T=tt.data)==null?void 0:T.id;rt&&A.has(rt)&&M.push({nodeId:rt,intensity:.8,color:new Dt(15680580),decay:.03});break}case"MemoryPromoted":{const rt=(lt=tt.data)==null?void 0:lt.id;if(rt&&A.has(rt)){M.push({nodeId:rt,intensity:1.2,color:new Dt(1096065),decay:.01});const $=b.get(rt);$&&wt($,new Dt(1096065))}break}case"ConsolidationCompleted":{A.forEach((rt,$)=>{M.push({nodeId:$,intensity:.4+Math.random()*.3,color:new Dt(16096779),decay:.015})});break}}}function Vt(nt,Q){const ot=new xe,T=new Float32Array(180),lt=new Float32Array(180);for(let $=0;$<60;$++){T[$*3]=nt.x,T[$*3+1]=nt.y,T[$*3+2]=nt.z;const Ft=Math.random()*Math.PI*2,_t=Math.acos(2*Math.random()-1),S=.3+Math.random()*.5;lt[$*3]=Math.sin(_t)*Math.cos(Ft)*S,lt[$*3+1]=Math.sin(_t)*Math.sin(Ft)*S,lt[$*3+2]=Math.cos(_t)*S}ot.setAttribute("position",new ve(T,3)),ot.setAttribute("velocity",new ve(lt,3));const tt=new Vs({color:Q,size:.6,transparent:!0,opacity:1,blending:sn,sizeAttenuation:!0}),rt=new Cr(ot,tt);a.add(rt),W.push({position:nt.clone(),age:0,particles:rt})}function wt(nt,Q){const O=new qa(.1,.5,64),ot=new tr({color:Q,transparent:!0,opacity:.8,side:an,blending:sn}),T=new De(O,ot);T.position.copy(nt),T.lookAt(o.position),a.add(T),H.push({mesh:T,age:0,maxAge:60})}function V(nt,Q,O){const ot=[nt.clone(),Q.clone()],T=new xe().setFromPoints(ot),lt=new Da({color:O,transparent:!0,opacity:1,blending:sn}),tt=new No(T,lt);a.add(tt),C.push({line:tt,intensity:1})}function it(nt){for(let Q=M.length-1;Q>=0;Q--){const O=M[Q];if(O.intensity-=O.decay,O.intensity<=0){M.splice(Q,1);continue}const ot=A.get(O.nodeId);if(ot){const T=ot.material;T.emissive.lerp(O.color,O.intensity*.3),T.emissiveIntensity=Math.max(T.emissiveIntensity,O.intensity)}}for(let Q=W.length-1;Q>=0;Q--){const O=W[Q];if(O.age++,O.age>120){a.remove(O.particles),O.particles.geometry.dispose(),O.particles.material.dispose(),W.splice(Q,1);continue}const ot=O.particles.geometry.attributes.position,T=O.particles.geometry.attributes.velocity;for(let tt=0;tt=0;Q--){const O=H[Q];if(O.age++,O.age>O.maxAge){a.remove(O.mesh),O.mesh.geometry.dispose(),O.mesh.material.dispose(),H.splice(Q,1);continue}const ot=O.age/O.maxAge,T=1+ot*20;O.mesh.scale.setScalar(T),O.mesh.material.opacity=.8*(1-ot),O.mesh.lookAt(o.position)}for(let Q=C.length-1;Q>=0;Q--){const O=C[Q];if(O.intensity-=.015,O.intensity<=0){a.remove(O.line),O.line.geometry.dispose(),O.line.material.dispose(),C.splice(Q,1);continue}O.line.material.opacity=O.intensity}}function Mt(){if(!s)return;const nt=s.clientWidth,Q=s.clientHeight;o.aspect=nt/Q,o.updateProjectionMatrix(),r.setSize(nt,Q),c.setSize(nt,Q)}function ct(nt){const Q=s.getBoundingClientRect();f.x=(nt.clientX-Q.left)/Q.width*2-1,f.y=-((nt.clientY-Q.top)/Q.height)*2+1,d.setFromCamera(f,o);const O=Array.from(A.values()),ot=d.intersectObjects(O);ot.length>0?(D=ot[0].object.userData.nodeId,s.style.cursor="pointer"):(D=null,s.style.cursor="grab")}function Ct(){var nt;if(D){w=D,(nt=t.onSelect)==null||nt.call(t,D);const Q=b.get(D);if(Q){const O=Q.clone();l.target.lerp(O,.5)}}}var Pt=a_();Mc(Pt,nt=>s=nt,()=>s),Qe(i,Pt),Fa()}var l_=nn('
'),c_=nn('
');function h_(i,t){Na(t,!0);let e=Ws(t,"width",3,240),n=Ws(t,"height",3,80);function s(p){return t.stability<=0?0:Math.exp(-p/t.stability)}let r=Hr(()=>{const p=[],h=Math.max(t.stability*3,30),A=4,b=e()-A*2,E=n()-A*2;for(let D=0;D<=50;D++){const w=D/50*h,R=s(w),N=A+D/50*b,y=A+(1-R)*E;p.push(`${D===0?"M":"L"}${N.toFixed(1)},${y.toFixed(1)}`)}return p.join(" ")}),a=Hr(()=>[{label:"Now",days:0,value:t.retention},{label:"1d",days:1,value:s(1)},{label:"7d",days:7,value:s(7)},{label:"30d",days:30,value:s(30)}]);function o(p){return p>.7?"#10b981":p>.4?"#f59e0b":"#ef4444"}var l=c_(),c=qt(l),u=qt(c),d=Kt(u),f=Kt(d),m=Kt(f),g=Kt(m);Sl(),Yt(c);var x=Kt(c,2);kr(x,21,()=>Nt(a),Vr,(p,h)=>{var A=l_(),b=qt(A),E=qt(b);Yt(b);var D=Kt(b,2),w=qt(D);Yt(D),Yt(A),vn((R,N)=>{be(E,`${Nt(h).label??""}:`),yl(D,`color: ${R??""}`),be(w,`${N??""}%`)},[()=>o(Nt(h).value),()=>(Nt(h).value*100).toFixed(0)]),Qe(p,A)}),Yt(x),Yt(l),vn(p=>{Oe(c,"width",e()),Oe(c,"height",n()),Oe(c,"viewBox",`0 0 ${e()??""} ${n()??""}`),Oe(u,"y1",4+(n()-8)*.5),Oe(u,"x2",e()-4),Oe(u,"y2",4+(n()-8)*.5),Oe(d,"y1",4+(n()-8)*.8),Oe(d,"x2",e()-4),Oe(d,"y2",4+(n()-8)*.8),Oe(f,"d",Nt(r)),Oe(m,"d",`${Nt(r)??""} L${e()-4},${n()-4} L4,${n()-4} Z`),Oe(g,"cy",4+(1-t.retention)*(n()-8)),Oe(g,"fill",p)},[()=>o(t.retention)]),Qe(i,l),Fa()}var u_=nn('

Loading memory graph...

'),d_=nn('

Your Mind Awaits

'),f_=nn(' · · ',1),p_=nn(' '),m_=nn('
'),__=nn("
"),g_=nn(`

Memory Detail

Retention Forecast
◬ Explore Connections
`),v_=nn(`
`);function F_(i,t){Na(t,!0);const e=()=>xc(yc,"$eventFeed",n),[n,s]=vc();let r=zn(null),a=zn(null),o=zn(!0),l=zn(""),c=zn(!1),u=zn(""),d=zn(150);Ml(()=>f());async function f(wt,V){We(o,!0),We(l,"");try{We(r,await Hi.graph({max_nodes:Nt(d),depth:3,query:wt||void 0,center_id:V||void 0}),!0)}catch{We(l,"No memories yet. Start using Vestige to populate your graph.")}finally{We(o,!1)}}async function m(){We(c,!0);try{await Hi.dream(),await f()}catch{}finally{We(c,!1)}}async function g(wt){try{We(a,await Hi.memories.get(wt),!0)}catch{We(a,null)}}function x(){Nt(u).trim()&&f(Nt(u))}var p=v_(),h=qt(p);{var A=wt=>{var V=u_();Qe(wt,V)},b=wt=>{var V=d_(),it=qt(V),Mt=Kt(qt(it),4),ct=qt(Mt,!0);Yt(Mt),Yt(it),Yt(V),vn(()=>be(ct,Nt(l))),Qe(wt,V)},E=wt=>{o_(wt,{get nodes(){return Nt(r).nodes},get edges(){return Nt(r).edges},get centerId(){return Nt(r).center_id},get events(){return e()},get isDreaming(){return Nt(c)},onSelect:g})};rs(h,wt=>{Nt(o)?wt(A):Nt(l)?wt(b,1):Nt(r)&&wt(E,2)})}var D=Kt(h,2),w=qt(D),R=qt(w);mc(R);var N=Kt(R,2);Yt(w);var y=Kt(w,2),M=qt(y),C=qt(M);C.value=C.__value=50;var W=Kt(C);W.value=W.__value=100;var H=Kt(W);H.value=H.__value=150;var q=Kt(H);q.value=q.__value=200,Yt(M);var J=Kt(M,2),X=qt(J,!0);Yt(J);var at=Kt(J,2);Yt(y),Yt(D);var k=Kt(D,2),ut=qt(k);{var xt=wt=>{var V=f_(),it=dc(V),Mt=qt(it);Yt(it);var ct=Kt(it,4),Ct=qt(ct);Yt(ct);var Pt=Kt(ct,4),nt=qt(Pt);Yt(Pt),vn(()=>{be(Mt,`${Nt(r).nodeCount??""} nodes`),be(Ct,`${Nt(r).edgeCount??""} edges`),be(nt,`depth ${Nt(r).depth??""}`)}),Qe(wt,V)};rs(ut,wt=>{Nt(r)&&wt(xt)})}Yt(k);var Rt=Kt(k,2);{var Vt=wt=>{var V=g_(),it=qt(V),Mt=Kt(qt(it),2);Yt(it);var ct=Kt(it,2),Ct=qt(ct),Pt=qt(Ct),nt=qt(Pt,!0);Yt(Pt);var Q=Kt(Pt,2);kr(Q,17,()=>Nt(a).tags,Vr,(ht,Ot)=>{var et=p_(),gt=qt(et,!0);Yt(et),vn(()=>be(gt,Nt(Ot))),Qe(ht,et)}),Yt(Ct);var O=Kt(Ct,2),ot=qt(O,!0);Yt(O);var T=Kt(O,2);kr(T,21,()=>[{label:"Retention",value:Nt(a).retentionStrength},{label:"Storage",value:Nt(a).storageStrength},{label:"Retrieval",value:Nt(a).retrievalStrength}],Vr,(ht,Ot)=>{var et=m_(),gt=qt(et),Lt=qt(gt),Bt=qt(Lt,!0);Yt(Lt);var yt=Kt(Lt,2),Zt=qt(yt);Yt(yt),Yt(gt);var kt=Kt(gt,2),se=qt(kt);Yt(kt),Yt(et),vn(L=>{be(Bt,Nt(Ot).label),be(Zt,`${L??""}%`),yl(se,`width: ${Nt(Ot).value*100}%; background: ${Nt(Ot).value>.7?"#10b981":Nt(Ot).value>.4?"#f59e0b":"#ef4444"}`)},[()=>(Nt(Ot).value*100).toFixed(1)]),Qe(ht,et)}),Yt(T);var lt=Kt(T,2),tt=Kt(qt(lt),2);{let ht=Hr(()=>Nt(a).storageStrength*30);h_(tt,{get retention(){return Nt(a).retentionStrength},get stability(){return Nt(ht)}})}Yt(lt);var rt=Kt(lt,2),$=qt(rt),Ft=qt($);Yt($);var _t=Kt($,2),S=qt(_t);Yt(_t);var _=Kt(_t,2);{var F=ht=>{var Ot=__(),et=qt(Ot);Yt(Ot),vn(gt=>be(et,`Accessed: ${gt??""}`),[()=>new Date(Nt(a).lastAccessedAt).toLocaleString()]),Qe(ht,Ot)};rs(_,ht=>{Nt(a).lastAccessedAt&&ht(F)})}var j=Kt(_,2),K=qt(j);Yt(j),Yt(rt);var Y=Kt(rt,2),Et=qt(Y),ft=Kt(Et,2);Yt(Y),Sl(2),Yt(ct),Yt(V),vn((ht,Ot)=>{be(nt,Nt(a).nodeType),be(ot,Nt(a).content),be(Ft,`Created: ${ht??""}`),be(S,`Updated: ${Ot??""}`),be(K,`Reviews: ${Nt(a).reviewCount??0??""}`)},[()=>new Date(Nt(a).createdAt).toLocaleString(),()=>new Date(Nt(a).updatedAt).toLocaleString()]),Tn("click",Mt,()=>We(a,null)),Tn("click",Et,()=>{Nt(a)&&Hi.memories.promote(Nt(a).id)}),Tn("click",ft,()=>{Nt(a)&&Hi.memories.demote(Nt(a).id)}),Qe(wt,V)};rs(Rt,wt=>{Nt(a)&&wt(Vt)})}Yt(p),vn(()=>{J.disabled=Nt(c),_c(J,1,`px-4 py-2 rounded-lg bg-dream/20 border border-dream/40 text-dream-glow text-sm - hover:bg-dream/30 transition-all backdrop-blur-sm disabled:opacity-50 - ${Nt(c)?"glow-dream animate-pulse-glow":""}`),be(X,Nt(c)?"◈ Dreaming...":"◈ Dream")}),Tn("keydown",R,wt=>wt.key==="Enter"&&x()),pc(R,()=>Nt(u),wt=>We(u,wt)),Tn("click",N,x),Tn("change",M,()=>f()),gc(M,()=>Nt(d),wt=>We(d,wt)),Tn("click",J,m),Tn("click",at,()=>f()),Qe(i,p),Fa(),s()}fc(["keydown","click","change"]);export{F_ as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/6.eFd2PZKr.js.br b/apps/dashboard/build/_app/immutable/nodes/6.eFd2PZKr.js.br deleted file mode 100644 index 6bd79fc..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/6.eFd2PZKr.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.eFd2PZKr.js.gz b/apps/dashboard/build/_app/immutable/nodes/6.eFd2PZKr.js.gz deleted file mode 100644 index e7096ec..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/6.eFd2PZKr.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.jU9oGgW9.js b/apps/dashboard/build/_app/immutable/nodes/6.jU9oGgW9.js new file mode 100644 index 0000000..9c0b262 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/6.jU9oGgW9.js @@ -0,0 +1,4113 @@ +var yc=Object.defineProperty;var Ec=(i,t,e)=>t in i?yc(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var ie=(i,t,e)=>Ec(i,typeof t!="symbol"?t+"":t,e);import"../chunks/Bzak7iHL.js";import{o as Tl,a as bl}from"../chunks/CkyfbJUz.js";import{p as sr,a as rr,e as Ut,d as Bt,G as Al,r as Pt,t as on,g as tt,u as ti,f as wl,s as Ge,h as de,c as Tc}from"../chunks/C9Z4nxhR.js";import{s as me,d as Rl,a as Ke}from"../chunks/DP9qWekZ.js";import{i as Ai}from"../chunks/C2oj68pw.js";import{e as qr,i as jr}from"../chunks/kH-DTQyy.js";import{a as Oe,f as Ye,c as bc}from"../chunks/DPfxVJHQ.js";import{s as He,r as Cl}from"../chunks/ZesQ8l8p.js";import{s as Ac}from"../chunks/Co2v30Gm.js";import{s as Pl}from"../chunks/BkopTN9z.js";import{b as Dl}from"../chunks/P9ZHwQBL.js";import{b as Ll}from"../chunks/-jeO_JOJ.js";import{s as wc,a as Rc}from"../chunks/DWr9YED7.js";import{b as Cc}from"../chunks/CR6HhlME.js";import{p as Zs}from"../chunks/Do8TgQ-j.js";import{N as Pc}from"../chunks/CZ45jJaw.js";import{a as Xi}from"../chunks/BcuCGYSa.js";import{e as Dc}from"../chunks/BmeMLq0p.js";/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */const ka="172",Di={ROTATE:0,DOLLY:1,PAN:2},Ri={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Lc=0,co=1,Uc=2,Ul=1,Ic=2,yn=3,zn=0,Be=1,cn=2,Tn=0,Li=1,fn=2,ho=3,uo=4,Nc=5,Kn=100,Fc=101,Oc=102,Bc=103,zc=104,Hc=200,kc=201,Vc=202,Gc=203,Zr=204,Kr=205,Wc=206,Xc=207,Yc=208,qc=209,jc=210,Zc=211,Kc=212,$c=213,Jc=214,$r=0,Jr=1,Qr=2,Ni=3,ta=4,ea=5,na=6,ia=7,Il=0,Qc=1,th=2,On=0,eh=1,nh=2,ih=3,Nl=4,sh=5,rh=6,ah=7,Fl=300,Fi=301,Oi=302,sa=303,ra=304,ar=306,aa=1e3,Jn=1001,oa=1002,Xe=1003,oh=1004,us=1005,un=1006,dr=1007,Qn=1008,wn=1009,Ol=1010,Bl=1011,ss=1012,Va=1013,ei=1014,dn=1015,bn=1016,Ga=1017,Wa=1018,Bi=1020,zl=35902,Hl=1021,kl=1022,rn=1023,Vl=1024,Gl=1025,Ui=1026,zi=1027,Xa=1028,Ya=1029,Wl=1030,qa=1031,ja=1033,ks=33776,Vs=33777,Gs=33778,Ws=33779,la=35840,ca=35841,ha=35842,ua=35843,da=36196,fa=37492,pa=37496,ma=37808,_a=37809,ga=37810,va=37811,xa=37812,Ma=37813,Sa=37814,ya=37815,Ea=37816,Ta=37817,ba=37818,Aa=37819,wa=37820,Ra=37821,Xs=36492,Ca=36494,Pa=36495,Xl=36283,Da=36284,La=36285,Ua=36286,lh=3200,ch=3201,Yl=0,hh=1,Fn="",$e="srgb",Hi="srgb-linear",Ks="linear",se="srgb",oi=7680,fo=519,uh=512,dh=513,fh=514,ql=515,ph=516,mh=517,_h=518,gh=519,Ia=35044,po="300 es",En=2e3,$s=2001;class ii{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const s=this._listeners[t];if(s!==void 0){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const n=this._listeners[t.type];if(n!==void 0){t.target=this;const s=n.slice(0);for(let r=0,a=s.length;r>8&255]+we[i>>16&255]+we[i>>24&255]+"-"+we[t&255]+we[t>>8&255]+"-"+we[t>>16&15|64]+we[t>>24&255]+"-"+we[e&63|128]+we[e>>8&255]+"-"+we[e>>16&255]+we[e>>24&255]+we[n&255]+we[n>>8&255]+we[n>>16&255]+we[n>>24&255]).toLowerCase()}function Gt(i,t,e){return Math.max(t,Math.min(e,i))}function vh(i,t){return(i%t+t)%t}function fr(i,t,e){return(1-e)*i+e*t}function hn(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function re(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const xh={DEG2RAD:Ys};class gt{constructor(t=0,e=0){gt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6],this.y=s[1]*e+s[4]*n+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Gt(this.x,t.x,e.x),this.y=Gt(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=Gt(this.x,t,e),this.y=Gt(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Gt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Gt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*s+t.x,this.y=r*s+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class zt{constructor(t,e,n,s,r,a,o,l,c){zt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,l,c)}set(t,e,n,s,r,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],d=n[7],f=n[2],m=n[5],g=n[8],x=s[0],p=s[3],u=s[6],b=s[1],E=s[4],S=s[7],D=s[2],A=s[5],w=s[8];return r[0]=a*x+o*b+l*D,r[3]=a*p+o*E+l*A,r[6]=a*u+o*S+l*w,r[1]=c*x+h*b+d*D,r[4]=c*p+h*E+d*A,r[7]=c*u+h*S+d*w,r[2]=f*x+m*b+g*D,r[5]=f*p+m*E+g*A,r[8]=f*u+m*S+g*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-n*r*h+n*o*l+s*r*c-s*a*l}invert(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],d=h*a-o*c,f=o*l-h*r,m=c*r-a*l,g=e*d+n*f+s*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/g;return t[0]=d*x,t[1]=(s*c-h*n)*x,t[2]=(o*n-s*a)*x,t[3]=f*x,t[4]=(h*e-s*l)*x,t[5]=(s*r-o*e)*x,t[6]=m*x,t[7]=(n*l-c*e)*x,t[8]=(a*e-n*r)*x,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+t,-s*c,s*l,-s*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(pr.makeScale(t,e)),this}rotate(t){return this.premultiply(pr.makeRotation(-t)),this}translate(t,e){return this.premultiply(pr.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let s=0;s<9;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const pr=new zt;function jl(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function Js(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function Mh(){const i=Js("canvas");return i.style.display="block",i}const mo={};function wi(i){i in mo||(mo[i]=!0,console.warn(i))}function Sh(i,t,e){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(t,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:n()}}setTimeout(r,e)})}function yh(i){const t=i.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function Eh(i){const t=i.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const _o=new zt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),go=new zt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Th(){const i={enabled:!0,workingColorSpace:Hi,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===se&&(s.r=An(s.r),s.g=An(s.g),s.b=An(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===se&&(s.r=Ii(s.r),s.g=Ii(s.g),s.b=Ii(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Fn?Ks:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[Hi]:{primaries:t,whitePoint:n,transfer:Ks,toXYZ:_o,fromXYZ:go,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:$e},outputColorSpaceConfig:{drawingBufferColorSpace:$e}},[$e]:{primaries:t,whitePoint:n,transfer:se,toXYZ:_o,fromXYZ:go,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:$e}}}),i}const $t=Th();function An(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Ii(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let li;class bh{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{li===void 0&&(li=Js("canvas")),li.width=t.width,li.height=t.height;const n=li.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=li}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Js("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const s=n.getImageData(0,0,t.width,t.height),r=s.data;for(let a=0;a0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Fl)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case aa:t.x=t.x-Math.floor(t.x);break;case Jn:t.x=t.x<0?0:1;break;case oa:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case aa:t.y=t.y-Math.floor(t.y);break;case Jn:t.y=t.y<0?0:1;break;case oa:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Ce.DEFAULT_IMAGE=null;Ce.DEFAULT_MAPPING=Fl;Ce.DEFAULT_ANISOTROPY=1;class oe{constructor(t=0,e=0,n=0,s=1){oe.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,s){return this.x=t,this.y=e,this.z=n,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,s,r;const l=t.elements,c=l[0],h=l[4],d=l[8],f=l[1],m=l[5],g=l[9],x=l[2],p=l[6],u=l[10];if(Math.abs(h-f)<.01&&Math.abs(d-x)<.01&&Math.abs(g-p)<.01){if(Math.abs(h+f)<.1&&Math.abs(d+x)<.1&&Math.abs(g+p)<.1&&Math.abs(c+m+u-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const E=(c+1)/2,S=(m+1)/2,D=(u+1)/2,A=(h+f)/4,w=(d+x)/4,N=(g+p)/4;return E>S&&E>D?E<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(E),s=A/n,r=w/n):S>D?S<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(S),n=A/s,r=N/s):D<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(D),n=w/r,s=N/r),this.set(n,s,r,e),this}let b=Math.sqrt((p-g)*(p-g)+(d-x)*(d-x)+(f-h)*(f-h));return Math.abs(b)<.001&&(b=1),this.x=(p-g)/b,this.y=(d-x)/b,this.z=(f-h)/b,this.w=Math.acos((c+m+u-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Gt(this.x,t.x,e.x),this.y=Gt(this.y,t.y,e.y),this.z=Gt(this.z,t.z,e.z),this.w=Gt(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=Gt(this.x,t,e),this.y=Gt(this.y,t,e),this.z=Gt(this.z,t,e),this.w=Gt(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Gt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Rh extends ii{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new oe(0,0,t,e),this.scissorTest=!1,this.viewport=new oe(0,0,t,e);const s={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:un,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new Ce(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o=0?1:-1,E=1-u*u;if(E>Number.EPSILON){const D=Math.sqrt(E),A=Math.atan2(D,u*b);p=Math.sin(p*A)/D,o=Math.sin(o*A)/D}const S=o*b;if(l=l*p+f*S,c=c*p+m*S,h=h*p+g*S,d=d*p+x*S,p===1-o){const D=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=D,c*=D,h*=D,d*=D}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=d}static multiplyQuaternionsFlat(t,e,n,s,r,a){const o=n[s],l=n[s+1],c=n[s+2],h=n[s+3],d=r[a],f=r[a+1],m=r[a+2],g=r[a+3];return t[e]=o*g+h*d+l*m-c*f,t[e+1]=l*g+h*f+c*d-o*m,t[e+2]=c*g+h*m+o*f-l*d,t[e+3]=h*g-o*d-l*f-c*m,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,s){return this._x=t,this._y=e,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(s/2),d=o(r/2),f=l(n/2),m=l(s/2),g=l(r/2);switch(a){case"XYZ":this._x=f*h*d+c*m*g,this._y=c*m*d-f*h*g,this._z=c*h*g+f*m*d,this._w=c*h*d-f*m*g;break;case"YXZ":this._x=f*h*d+c*m*g,this._y=c*m*d-f*h*g,this._z=c*h*g-f*m*d,this._w=c*h*d+f*m*g;break;case"ZXY":this._x=f*h*d-c*m*g,this._y=c*m*d+f*h*g,this._z=c*h*g+f*m*d,this._w=c*h*d-f*m*g;break;case"ZYX":this._x=f*h*d-c*m*g,this._y=c*m*d+f*h*g,this._z=c*h*g-f*m*d,this._w=c*h*d+f*m*g;break;case"YZX":this._x=f*h*d+c*m*g,this._y=c*m*d+f*h*g,this._z=c*h*g-f*m*d,this._w=c*h*d-f*m*g;break;case"XZY":this._x=f*h*d-c*m*g,this._y=c*m*d-f*h*g,this._z=c*h*g+f*m*d,this._w=c*h*d+f*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,s=Math.sin(n);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],s=e[4],r=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],d=e[10],f=n+o+d;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(h-l)*m,this._y=(r-c)*m,this._z=(a-s)*m}else if(n>o&&n>d){const m=2*Math.sqrt(1+n-o-d);this._w=(h-l)/m,this._x=.25*m,this._y=(s+a)/m,this._z=(r+c)/m}else if(o>d){const m=2*Math.sqrt(1+o-n-d);this._w=(r-c)/m,this._x=(s+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-n-o);this._w=(a-s)/m,this._x=(r+c)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Gt(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const s=Math.min(1,e/n);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,s=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=n*h+a*o+s*c-r*l,this._y=s*h+a*l+r*o-n*c,this._z=r*h+a*c+n*l-s*o,this._w=a*h-n*o-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,s=this._y,r=this._z,a=this._w;let o=a*t._w+n*t._x+s*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-e;return this._w=m*a+e*this._w,this._x=m*n+e*this._x,this._y=m*s+e*this._y,this._z=m*r+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),d=Math.sin((1-e)*h)/c,f=Math.sin(e*h)/c;return this._w=a*d+this._w*f,this._x=n*d+this._x*f,this._y=s*d+this._y*f,this._z=r*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class P{constructor(t=0,e=0,n=0){P.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(vo.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(vo.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*s,this.y=r[1]*e+r[4]*n+r[7]*s,this.z=r[2]*e+r[5]*n+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,s=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*s-o*n),h=2*(o*e-r*s),d=2*(r*n-a*e);return this.x=e+l*c+a*d-o*h,this.y=n+l*h+o*c-r*d,this.z=s+l*d+r*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*s,this.y=r[1]*e+r[5]*n+r[9]*s,this.z=r[2]*e+r[6]*n+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Gt(this.x,t.x,e.x),this.y=Gt(this.y,t.y,e.y),this.z=Gt(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=Gt(this.x,t,e),this.y=Gt(this.y,t,e),this.z=Gt(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Gt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,s=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=s*l-r*o,this.y=r*a-n*l,this.z=n*o-s*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return _r.copy(this).projectOnVector(t),this.sub(_r)}reflect(t){return this.sub(_r.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Gt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,s=this.z-t.z;return e*e+n*n+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const s=Math.sin(e)*t;return this.x=s*Math.sin(n),this.y=Math.cos(e)*t,this.z=s*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _r=new P,vo=new ni;class si{constructor(t=new P(1/0,1/0,1/0),e=new P(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,en),en.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Yi),fs.subVectors(this.max,Yi),ci.subVectors(t.a,Yi),hi.subVectors(t.b,Yi),ui.subVectors(t.c,Yi),Rn.subVectors(hi,ci),Cn.subVectors(ui,hi),Gn.subVectors(ci,ui);let e=[0,-Rn.z,Rn.y,0,-Cn.z,Cn.y,0,-Gn.z,Gn.y,Rn.z,0,-Rn.x,Cn.z,0,-Cn.x,Gn.z,0,-Gn.x,-Rn.y,Rn.x,0,-Cn.y,Cn.x,0,-Gn.y,Gn.x,0];return!gr(e,ci,hi,ui,fs)||(e=[1,0,0,0,1,0,0,0,1],!gr(e,ci,hi,ui,fs))?!1:(ps.crossVectors(Rn,Cn),e=[ps.x,ps.y,ps.z],gr(e,ci,hi,ui,fs))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,en).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(en).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(_n[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),_n[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),_n[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),_n[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),_n[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),_n[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),_n[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),_n[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(_n),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const _n=[new P,new P,new P,new P,new P,new P,new P,new P],en=new P,ds=new si,ci=new P,hi=new P,ui=new P,Rn=new P,Cn=new P,Gn=new P,Yi=new P,fs=new P,ps=new P,Wn=new P;function gr(i,t,e,n,s){for(let r=0,a=i.length-3;r<=a;r+=3){Wn.fromArray(i,r);const o=s.x*Math.abs(Wn.x)+s.y*Math.abs(Wn.y)+s.z*Math.abs(Wn.z),l=t.dot(Wn),c=e.dot(Wn),h=n.dot(Wn);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const Ph=new si,qi=new P,vr=new P;class ri{constructor(t=new P,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):Ph.setFromPoints(t).getCenter(n);let s=0;for(let r=0,a=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;qi.subVectors(t,this.center);const e=qi.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),s=(n-this.radius)*.5;this.center.addScaledVector(qi,s/n),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(vr.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(qi.copy(t.center).add(vr)),this.expandByPoint(qi.copy(t.center).sub(vr))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const gn=new P,xr=new P,ms=new P,Pn=new P,Mr=new P,_s=new P,Sr=new P;class rs{constructor(t=new P,e=new P(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,gn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=gn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(gn.copy(this.origin).addScaledVector(this.direction,e),gn.distanceToSquared(t))}distanceSqToSegment(t,e,n,s){xr.copy(t).add(e).multiplyScalar(.5),ms.copy(e).sub(t).normalize(),Pn.copy(this.origin).sub(xr);const r=t.distanceTo(e)*.5,a=-this.direction.dot(ms),o=Pn.dot(this.direction),l=-Pn.dot(ms),c=Pn.lengthSq(),h=Math.abs(1-a*a);let d,f,m,g;if(h>0)if(d=a*l-o,f=a*o-l,g=r*h,d>=0)if(f>=-g)if(f<=g){const x=1/h;d*=x,f*=x,m=d*(d+a*f+2*o)+f*(a*d+f+2*l)+c}else f=r,d=Math.max(0,-(a*f+o)),m=-d*d+f*(f+2*l)+c;else f=-r,d=Math.max(0,-(a*f+o)),m=-d*d+f*(f+2*l)+c;else f<=-g?(d=Math.max(0,-(-a*r+o)),f=d>0?-r:Math.min(Math.max(-r,-l),r),m=-d*d+f*(f+2*l)+c):f<=g?(d=0,f=Math.min(Math.max(-r,-l),r),m=f*(f+2*l)+c):(d=Math.max(0,-(a*r+o)),f=d>0?r:Math.min(Math.max(-r,-l),r),m=-d*d+f*(f+2*l)+c);else f=a>0?-r:r,d=Math.max(0,-(a*f+o)),m=-d*d+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,d),s&&s.copy(xr).addScaledVector(ms,f),m}intersectSphere(t,e){gn.subVectors(t.center,this.origin);const n=gn.dot(this.direction),s=gn.dot(gn)-n*n,r=t.radius*t.radius;if(s>r)return null;const a=Math.sqrt(r-s),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,s,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(n=(t.min.x-f.x)*c,s=(t.max.x-f.x)*c):(n=(t.max.x-f.x)*c,s=(t.min.x-f.x)*c),h>=0?(r=(t.min.y-f.y)*h,a=(t.max.y-f.y)*h):(r=(t.max.y-f.y)*h,a=(t.min.y-f.y)*h),n>a||r>s||((r>n||isNaN(n))&&(n=r),(a=0?(o=(t.min.z-f.z)*d,l=(t.max.z-f.z)*d):(o=(t.max.z-f.z)*d,l=(t.min.z-f.z)*d),n>l||o>s)||((o>n||n!==n)&&(n=o),(l=0?n:s,e)}intersectsBox(t){return this.intersectBox(t,gn)!==null}intersectTriangle(t,e,n,s,r){Mr.subVectors(e,t),_s.subVectors(n,t),Sr.crossVectors(Mr,_s);let a=this.direction.dot(Sr),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Pn.subVectors(this.origin,t);const l=o*this.direction.dot(_s.crossVectors(Pn,_s));if(l<0)return null;const c=o*this.direction.dot(Mr.cross(Pn));if(c<0||l+c>a)return null;const h=-o*Pn.dot(Sr);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ee{constructor(t,e,n,s,r,a,o,l,c,h,d,f,m,g,x,p){ee.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,l,c,h,d,f,m,g,x,p)}set(t,e,n,s,r,a,o,l,c,h,d,f,m,g,x,p){const u=this.elements;return u[0]=t,u[4]=e,u[8]=n,u[12]=s,u[1]=r,u[5]=a,u[9]=o,u[13]=l,u[2]=c,u[6]=h,u[10]=d,u[14]=f,u[3]=m,u[7]=g,u[11]=x,u[15]=p,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new ee().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,s=1/di.setFromMatrixColumn(t,0).length(),r=1/di.setFromMatrixColumn(t,1).length(),a=1/di.setFromMatrixColumn(t,2).length();return e[0]=n[0]*s,e[1]=n[1]*s,e[2]=n[2]*s,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,s=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(s),c=Math.sin(s),h=Math.cos(r),d=Math.sin(r);if(t.order==="XYZ"){const f=a*h,m=a*d,g=o*h,x=o*d;e[0]=l*h,e[4]=-l*d,e[8]=c,e[1]=m+g*c,e[5]=f-x*c,e[9]=-o*l,e[2]=x-f*c,e[6]=g+m*c,e[10]=a*l}else if(t.order==="YXZ"){const f=l*h,m=l*d,g=c*h,x=c*d;e[0]=f+x*o,e[4]=g*o-m,e[8]=a*c,e[1]=a*d,e[5]=a*h,e[9]=-o,e[2]=m*o-g,e[6]=x+f*o,e[10]=a*l}else if(t.order==="ZXY"){const f=l*h,m=l*d,g=c*h,x=c*d;e[0]=f-x*o,e[4]=-a*d,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=x-f*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const f=a*h,m=a*d,g=o*h,x=o*d;e[0]=l*h,e[4]=g*c-m,e[8]=f*c+x,e[1]=l*d,e[5]=x*c+f,e[9]=m*c-g,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const f=a*l,m=a*c,g=o*l,x=o*c;e[0]=l*h,e[4]=x-f*d,e[8]=g*d+m,e[1]=d,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=m*d+g,e[10]=f-x*d}else if(t.order==="XZY"){const f=a*l,m=a*c,g=o*l,x=o*c;e[0]=l*h,e[4]=-d,e[8]=c*h,e[1]=f*d+x,e[5]=a*h,e[9]=m*d-g,e[2]=g*d-m,e[6]=o*h,e[10]=x*d+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Dh,t,Lh)}lookAt(t,e,n){const s=this.elements;return ke.subVectors(t,e),ke.lengthSq()===0&&(ke.z=1),ke.normalize(),Dn.crossVectors(n,ke),Dn.lengthSq()===0&&(Math.abs(n.z)===1?ke.x+=1e-4:ke.z+=1e-4,ke.normalize(),Dn.crossVectors(n,ke)),Dn.normalize(),gs.crossVectors(ke,Dn),s[0]=Dn.x,s[4]=gs.x,s[8]=ke.x,s[1]=Dn.y,s[5]=gs.y,s[9]=ke.y,s[2]=Dn.z,s[6]=gs.z,s[10]=ke.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],d=n[5],f=n[9],m=n[13],g=n[2],x=n[6],p=n[10],u=n[14],b=n[3],E=n[7],S=n[11],D=n[15],A=s[0],w=s[4],N=s[8],y=s[12],M=s[1],C=s[5],W=s[9],z=s[13],V=s[2],K=s[6],G=s[10],$=s[14],H=s[3],nt=s[7],dt=s[11],Mt=s[15];return r[0]=a*A+o*M+l*V+c*H,r[4]=a*w+o*C+l*K+c*nt,r[8]=a*N+o*W+l*G+c*dt,r[12]=a*y+o*z+l*$+c*Mt,r[1]=h*A+d*M+f*V+m*H,r[5]=h*w+d*C+f*K+m*nt,r[9]=h*N+d*W+f*G+m*dt,r[13]=h*y+d*z+f*$+m*Mt,r[2]=g*A+x*M+p*V+u*H,r[6]=g*w+x*C+p*K+u*nt,r[10]=g*N+x*W+p*G+u*dt,r[14]=g*y+x*z+p*$+u*Mt,r[3]=b*A+E*M+S*V+D*H,r[7]=b*w+E*C+S*K+D*nt,r[11]=b*N+E*W+S*G+D*dt,r[15]=b*y+E*z+S*$+D*Mt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],s=t[8],r=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],d=t[6],f=t[10],m=t[14],g=t[3],x=t[7],p=t[11],u=t[15];return g*(+r*l*d-s*c*d-r*o*f+n*c*f+s*o*m-n*l*m)+x*(+e*l*m-e*c*f+r*a*f-s*a*m+s*c*h-r*l*h)+p*(+e*c*d-e*o*m-r*a*d+n*a*m+r*o*h-n*c*h)+u*(-s*o*h-e*l*d+e*o*f+s*a*d-n*a*f+n*l*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],d=t[9],f=t[10],m=t[11],g=t[12],x=t[13],p=t[14],u=t[15],b=d*p*c-x*f*c+x*l*m-o*p*m-d*l*u+o*f*u,E=g*f*c-h*p*c-g*l*m+a*p*m+h*l*u-a*f*u,S=h*x*c-g*d*c+g*o*m-a*x*m-h*o*u+a*d*u,D=g*d*l-h*x*l-g*o*f+a*x*f+h*o*p-a*d*p,A=e*b+n*E+s*S+r*D;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/A;return t[0]=b*w,t[1]=(x*f*r-d*p*r-x*s*m+n*p*m+d*s*u-n*f*u)*w,t[2]=(o*p*r-x*l*r+x*s*c-n*p*c-o*s*u+n*l*u)*w,t[3]=(d*l*r-o*f*r-d*s*c+n*f*c+o*s*m-n*l*m)*w,t[4]=E*w,t[5]=(h*p*r-g*f*r+g*s*m-e*p*m-h*s*u+e*f*u)*w,t[6]=(g*l*r-a*p*r-g*s*c+e*p*c+a*s*u-e*l*u)*w,t[7]=(a*f*r-h*l*r+h*s*c-e*f*c-a*s*m+e*l*m)*w,t[8]=S*w,t[9]=(g*d*r-h*x*r-g*n*m+e*x*m+h*n*u-e*d*u)*w,t[10]=(a*x*r-g*o*r+g*n*c-e*x*c-a*n*u+e*o*u)*w,t[11]=(h*o*r-a*d*r-h*n*c+e*d*c+a*n*m-e*o*m)*w,t[12]=D*w,t[13]=(h*x*s-g*d*s+g*n*f-e*x*f-h*n*p+e*d*p)*w,t[14]=(g*o*s-a*x*s-g*n*l+e*x*l+a*n*p-e*o*p)*w,t[15]=(a*d*s-h*o*s+h*n*l-e*d*l-a*n*f+e*o*f)*w,this}scale(t){const e=this.elements,n=t.x,s=t.y,r=t.z;return e[0]*=n,e[4]*=s,e[8]*=r,e[1]*=n,e[5]*=s,e[9]*=r,e[2]*=n,e[6]*=s,e[10]*=r,e[3]*=n,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,s))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),s=Math.sin(e),r=1-n,a=t.x,o=t.y,l=t.z,c=r*a,h=r*o;return this.set(c*a+n,c*o-s*l,c*l+s*o,0,c*o+s*l,h*o+n,h*l-s*a,0,c*l-s*o,h*l+s*a,r*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,s,r,a){return this.set(1,n,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,n){const s=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,h=a+a,d=o+o,f=r*c,m=r*h,g=r*d,x=a*h,p=a*d,u=o*d,b=l*c,E=l*h,S=l*d,D=n.x,A=n.y,w=n.z;return s[0]=(1-(x+u))*D,s[1]=(m+S)*D,s[2]=(g-E)*D,s[3]=0,s[4]=(m-S)*A,s[5]=(1-(f+u))*A,s[6]=(p+b)*A,s[7]=0,s[8]=(g+E)*w,s[9]=(p-b)*w,s[10]=(1-(f+x))*w,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,n){const s=this.elements;let r=di.set(s[0],s[1],s[2]).length();const a=di.set(s[4],s[5],s[6]).length(),o=di.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],nn.copy(this);const c=1/r,h=1/a,d=1/o;return nn.elements[0]*=c,nn.elements[1]*=c,nn.elements[2]*=c,nn.elements[4]*=h,nn.elements[5]*=h,nn.elements[6]*=h,nn.elements[8]*=d,nn.elements[9]*=d,nn.elements[10]*=d,e.setFromRotationMatrix(nn),n.x=r,n.y=a,n.z=o,this}makePerspective(t,e,n,s,r,a,o=En){const l=this.elements,c=2*r/(e-t),h=2*r/(n-s),d=(e+t)/(e-t),f=(n+s)/(n-s);let m,g;if(o===En)m=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===$s)m=-a/(a-r),g=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,s,r,a,o=En){const l=this.elements,c=1/(e-t),h=1/(n-s),d=1/(a-r),f=(e+t)*c,m=(n+s)*h;let g,x;if(o===En)g=(a+r)*d,x=-2*d;else if(o===$s)g=r*d,x=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=x,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let s=0;s<16;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const di=new P,nn=new ee,Dh=new P(0,0,0),Lh=new P(1,1,1),Dn=new P,gs=new P,ke=new P,xo=new ee,Mo=new ni;class pn{constructor(t=0,e=0,n=0,s=pn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,s=this._order){return this._x=t,this._y=e,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const s=t.elements,r=s[0],a=s[4],o=s[8],l=s[1],c=s[5],h=s[9],d=s[2],f=s[6],m=s[10];switch(e){case"XYZ":this._y=Math.asin(Gt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Gt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(Gt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Gt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Gt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-Gt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return xo.makeRotationFromQuaternion(t),this.setFromRotationMatrix(xo,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Mo.setFromEuler(this),this.setFromQuaternion(Mo,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}pn.DEFAULT_ORDER="XYZ";class Za{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let n=0;n0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){s.children=[];for(let o=0;o0){s.animations=[];for(let o=0;o0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),m.length>0&&(n.animations=m),g.length>0&&(n.nodes=g)}return n.object=s,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,n,s,r){sn.subVectors(s,e),xn.subVectors(n,e),Er.subVectors(t,e);const a=sn.dot(sn),o=sn.dot(xn),l=sn.dot(Er),c=xn.dot(xn),h=xn.dot(Er),d=a*c-o*o;if(d===0)return r.set(0,0,0),null;const f=1/d,m=(c*l-o*h)*f,g=(a*h-o*l)*f;return r.set(1-m-g,g,m)}static containsPoint(t,e,n,s){return this.getBarycoord(t,e,n,s,Mn)===null?!1:Mn.x>=0&&Mn.y>=0&&Mn.x+Mn.y<=1}static getInterpolation(t,e,n,s,r,a,o,l){return this.getBarycoord(t,e,n,s,Mn)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,Mn.x),l.addScaledVector(a,Mn.y),l.addScaledVector(o,Mn.z),l)}static getInterpolatedAttribute(t,e,n,s,r,a){return wr.setScalar(0),Rr.setScalar(0),Cr.setScalar(0),wr.fromBufferAttribute(t,e),Rr.fromBufferAttribute(t,n),Cr.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(wr,r.x),a.addScaledVector(Rr,r.y),a.addScaledVector(Cr,r.z),a}static isFrontFacing(t,e,n,s){return sn.subVectors(n,e),xn.subVectors(t,e),sn.cross(xn).dot(s)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,s){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,n,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return sn.subVectors(this.c,this.b),xn.subVectors(this.a,this.b),sn.cross(xn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Je.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Je.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,s,r){return Je.getInterpolation(t,this.a,this.b,this.c,e,n,s,r)}containsPoint(t){return Je.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Je.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,s=this.b,r=this.c;let a,o;mi.subVectors(s,n),_i.subVectors(r,n),Tr.subVectors(t,n);const l=mi.dot(Tr),c=_i.dot(Tr);if(l<=0&&c<=0)return e.copy(n);br.subVectors(t,s);const h=mi.dot(br),d=_i.dot(br);if(h>=0&&d<=h)return e.copy(s);const f=l*d-h*c;if(f<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(n).addScaledVector(mi,a);Ar.subVectors(t,r);const m=mi.dot(Ar),g=_i.dot(Ar);if(g>=0&&m<=g)return e.copy(r);const x=m*c-l*g;if(x<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(n).addScaledVector(_i,o);const p=h*g-m*d;if(p<=0&&d-h>=0&&m-g>=0)return Ao.subVectors(r,s),o=(d-h)/(d-h+(m-g)),e.copy(s).addScaledVector(Ao,o);const u=1/(p+x+f);return a=x*u,o=f*u,e.copy(n).addScaledVector(mi,a).addScaledVector(_i,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const $l={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},Ln={h:0,s:0,l:0},xs={h:0,s:0,l:0};function Pr(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}class xt{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){const s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=$e){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,$t.toWorkingColorSpace(this,e),this}setRGB(t,e,n,s=$t.workingColorSpace){return this.r=t,this.g=e,this.b=n,$t.toWorkingColorSpace(this,s),this}setHSL(t,e,n,s=$t.workingColorSpace){if(t=vh(t,1),e=Gt(e,0,1),n=Gt(n,0,1),e===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,a=2*n-r;this.r=Pr(a,r,t+1/3),this.g=Pr(a,r,t),this.b=Pr(a,r,t-1/3)}return $t.toWorkingColorSpace(this,s),this}setStyle(t,e=$e){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=$e){const n=$l[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=An(t.r),this.g=An(t.g),this.b=An(t.b),this}copyLinearToSRGB(t){return this.r=Ii(t.r),this.g=Ii(t.g),this.b=Ii(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=$e){return $t.fromWorkingColorSpace(Re.copy(this),t),Math.round(Gt(Re.r*255,0,255))*65536+Math.round(Gt(Re.g*255,0,255))*256+Math.round(Gt(Re.b*255,0,255))}getHexString(t=$e){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=$t.workingColorSpace){$t.fromWorkingColorSpace(Re.copy(this),e);const n=Re.r,s=Re.g,r=Re.b,a=Math.max(n,s,r),o=Math.min(n,s,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const d=a-o;switch(c=h<=.5?d/(a+o):d/(2-a-o),a){case n:l=(s-r)/d+(s0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Li&&(n.blending=this.blending),this.side!==zn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Zr&&(n.blendSrc=this.blendSrc),this.blendDst!==Kr&&(n.blendDst=this.blendDst),this.blendEquation!==Kn&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Ni&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==fo&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==oi&&(n.stencilFail=this.stencilFail),this.stencilZFail!==oi&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==oi&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=s(t.textures),a=s(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const s=e.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class or extends Hn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new xt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pn,this.combine=Il,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const pe=new P,Ms=new gt;class Se{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=Ia,this.updateRanges=[],this.gpuType=dn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new si);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new P(-1/0,-1/0,-1/0),new P(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,s=e.length;n0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const c=n[l];t.data.attributes[l]=c.toJSON(t.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let d=0,f=c.length;d0&&(s[l]=h,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const s=t.attributes;for(const c in s){const h=s[c];this.setAttribute(c,h.clone(e))}const r=t.morphAttributes;for(const c in r){const h=[],d=r[c];for(let f=0,m=d.length;f0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(wo.copy(r).invert(),Xn.copy(t.ray).applyMatrix4(wo),!(n.boundingBox!==null&&Xn.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Xn)))}_computeIntersections(t,e,n){let s;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,d=r.attributes.normal,f=r.groups,m=r.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,x=f.length;ge.far?null:{distance:c,point:As.clone(),object:i}}function ws(i,t,e,n,s,r,a,o,l,c){i.getVertexPosition(o,ys),i.getVertexPosition(l,Es),i.getVertexPosition(c,Ts);const h=zh(i,t,e,n,ys,Es,Ts,Co);if(h){const d=new P;Je.getBarycoord(Co,ys,Es,Ts,d),s&&(h.uv=Je.getInterpolatedAttribute(s,o,l,c,d,new gt)),r&&(h.uv1=Je.getInterpolatedAttribute(r,o,l,c,d,new gt)),a&&(h.normal=Je.getInterpolatedAttribute(a,o,l,c,d,new P),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new P,materialIndex:0};Je.getNormal(ys,Es,Ts,f.normal),h.face=f,h.barycoord=d}return h}class as extends Ee{constructor(t=1,e=1,n=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:s,heightSegments:r,depthSegments:a};const o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],d=[];let f=0,m=0;g("z","y","x",-1,-1,n,e,t,a,r,0),g("z","y","x",1,-1,n,e,-t,a,r,1),g("x","z","y",1,1,t,n,e,s,a,2),g("x","z","y",1,-1,t,n,-e,s,a,3),g("x","y","z",1,-1,t,e,n,s,r,4),g("x","y","z",-1,-1,t,e,-n,s,r,5),this.setIndex(l),this.setAttribute("position",new Pe(c,3)),this.setAttribute("normal",new Pe(h,3)),this.setAttribute("uv",new Pe(d,2));function g(x,p,u,b,E,S,D,A,w,N,y){const M=S/w,C=D/N,W=S/2,z=D/2,V=A/2,K=w+1,G=N+1;let $=0,H=0;const nt=new P;for(let dt=0;dt0?1:-1,h.push(nt.x,nt.y,nt.z),d.push(Ft/w),d.push(1-dt/N),$+=1}}for(let dt=0;dt0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class ec extends be{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ee,this.projectionMatrix=new ee,this.projectionMatrixInverse=new ee,this.coordinateSystem=En}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Un=new P,Po=new gt,Do=new gt;class We extends ec{constructor(t=50,e=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=Na*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Ys*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Na*2*Math.atan(Math.tan(Ys*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Un.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Un.x,Un.y).multiplyScalar(-t/Un.z),Un.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Un.x,Un.y).multiplyScalar(-t/Un.z)}getViewSize(t,e){return this.getViewBounds(t,Po,Do),e.subVectors(Do,Po)}setViewOffset(t,e,n,s,r,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(Ys*.5*this.fov)/this.zoom,n=2*e,s=this.aspect*n,r=-.5*s;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*s/l,e-=a.offsetY*n/c,s*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const vi=-90,xi=1;class Gh extends be{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new We(vi,xi,t,e);s.layers=this.layers,this.add(s);const r=new We(vi,xi,t,e);r.layers=this.layers,this.add(r);const a=new We(vi,xi,t,e);a.layers=this.layers,this.add(a);const o=new We(vi,xi,t,e);o.layers=this.layers,this.add(o);const l=new We(vi,xi,t,e);l.layers=this.layers,this.add(l);const c=new We(vi,xi,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,s,r,a,o,l]=e;for(const c of e)this.remove(c);if(t===En)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===$s)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,h]=this.children,d=t.getRenderTarget(),f=t.getActiveCubeFace(),m=t.getActiveMipmapLevel(),g=t.xr.enabled;t.xr.enabled=!1;const x=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,s),t.render(e,r),t.setRenderTarget(n,1,s),t.render(e,a),t.setRenderTarget(n,2,s),t.render(e,o),t.setRenderTarget(n,3,s),t.render(e,l),t.setRenderTarget(n,4,s),t.render(e,c),n.texture.generateMipmaps=x,t.setRenderTarget(n,5,s),t.render(e,h),t.setRenderTarget(d,f,m),t.xr.enabled=g,n.texture.needsPMREMUpdate=!0}}class nc extends Ce{constructor(t,e,n,s,r,a,o,l,c,h){t=t!==void 0?t:[],e=e!==void 0?e:Fi,super(t,e,n,s,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Wh extends an{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},s=[n,n,n,n,n,n];this.texture=new nc(s,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:un}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},s=new as(5,5,5),r=new Ie({name:"CubemapFromEquirect",uniforms:ki(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Be,blending:Tn});r.uniforms.tEquirect.value=e;const a=new ye(s,r),o=e.minFilter;return e.minFilter===Qn&&(e.minFilter=un),new Gh(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,s){const r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,s);t.setRenderTarget(r)}}class lr{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new xt(t),this.density=e}clone(){return new lr(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Xh extends be{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new pn,this.environmentIntensity=1,this.environmentRotation=new pn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class Yh{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Ia,this.updateRanges=[],this.version=0,this.uuid=Bn()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let s=0,r=this.stride;st.far||e.push({distance:l,point:Ki.clone(),uv:Je.getInterpolation(Ki,Rs,Ji,Cs,Lo,Ur,Uo,new gt),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function Ps(i,t,e,n,s,r){Ei.subVectors(i,e).addScalar(.5).multiply(n),s!==void 0?($i.x=r*Ei.x-s*Ei.y,$i.y=s*Ei.x+r*Ei.y):$i.copy(Ei),i.copy(t),i.x+=$i.x,i.y+=$i.y,i.applyMatrix4(ic)}class qh extends Ce{constructor(t=null,e=1,n=1,s,r,a,o,l,c=Xe,h=Xe,d,f){super(null,a,o,l,c,h,s,r,d,f),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Io extends Se{constructor(t,e,n,s=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const Ti=new ee,No=new ee,Ds=[],Fo=new si,jh=new ee,Qi=new ye,ts=new ri;class Zh extends ye{constructor(t,e,n){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new Io(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||$h.getNormalMatrix(t),s=this.coplanarPoint(Nr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Yn=new ri,Ls=new P;class Ka{constructor(t=new Nn,e=new Nn,n=new Nn,s=new Nn,r=new Nn,a=new Nn){this.planes=[t,e,n,s,r,a]}set(t,e,n,s,r,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(s),o[4].copy(r),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=En){const n=this.planes,s=t.elements,r=s[0],a=s[1],o=s[2],l=s[3],c=s[4],h=s[5],d=s[6],f=s[7],m=s[8],g=s[9],x=s[10],p=s[11],u=s[12],b=s[13],E=s[14],S=s[15];if(n[0].setComponents(l-r,f-c,p-m,S-u).normalize(),n[1].setComponents(l+r,f+c,p+m,S+u).normalize(),n[2].setComponents(l+a,f+h,p+g,S+b).normalize(),n[3].setComponents(l-a,f-h,p-g,S-b).normalize(),n[4].setComponents(l-o,f-d,p-x,S-E).normalize(),e===En)n[5].setComponents(l+o,f+d,p+x,S+E).normalize();else if(e===$s)n[5].setComponents(o,d,x,E).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Yn.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Yn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Yn)}intersectsSprite(t){return Yn.center.set(0,0,0),Yn.radius=.7071067811865476,Yn.applyMatrix4(t.matrixWorld),this.intersectsSphere(Yn)}intersectsSphere(t){const e=this.planes,n=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(n)0?t.max.x:t.min.x,Ls.y=s.normal.y>0?t.max.y:t.min.y,Ls.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(Ls)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class $a extends Hn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new xt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const er=new P,nr=new P,Oo=new ee,es=new rs,Us=new ri,Fr=new P,Bo=new P;class sc extends be{constructor(t=new Ee,e=new $a){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[0];for(let s=1,r=e.count;s0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rn)return;Fr.applyMatrix4(i.matrixWorld);const l=t.ray.origin.distanceTo(Fr);if(!(lt.far))return{distance:l,point:Bo.clone().applyMatrix4(i.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:i}}class ir extends Hn{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new xt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}const zo=new ee,Oa=new rs,Ns=new ri,Fs=new P;class Ba extends be{constructor(t=new Ee,e=new ir){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,s=this.matrixWorld,r=t.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ns.copy(n.boundingSphere),Ns.applyMatrix4(s),Ns.radius+=r,t.ray.intersectsSphere(Ns)===!1)return;zo.copy(s).invert(),Oa.copy(t.ray).applyMatrix4(zo);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,d=n.attributes.position;if(c!==null){const f=Math.max(0,a.start),m=Math.min(c.count,a.start+a.count);for(let g=f,x=m;g0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class Ci extends be{constructor(){super(),this.isGroup=!0,this.type="Group"}}class Jh extends Ce{constructor(t,e,n,s,r,a,o,l,c){super(t,e,n,s,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class rc extends Ce{constructor(t,e,n,s,r,a,o,l,c,h=Ui){if(h!==Ui&&h!==zi)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Ui&&(n=ei),n===void 0&&h===zi&&(n=Bi),super(null,s,r,a,o,l,h,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:Xe,this.minFilter=l!==void 0?l:Xe,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}class os extends Ee{constructor(t=1,e=1,n=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:s};const r=t/2,a=e/2,o=Math.floor(n),l=Math.floor(s),c=o+1,h=l+1,d=t/o,f=e/l,m=[],g=[],x=[],p=[];for(let u=0;u0)&&m.push(E,S,A),(u!==n-1||lm.start-g.start);let f=0;for(let m=1;m 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #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 +#endif`,wu=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,Ru=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Cu=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,Pu=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,Du=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Lu=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,Uu=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,Iu=`#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; +} +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`,Nu=`#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_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #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`,Fu=`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`,Ou=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,Bu=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,zu=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,Hu=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,ku="gl_FragColor = linearToOutputTexel( gl_FragColor );",Vu=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +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 ); +}`,Gu=`#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, envMapRotation * 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`,Wu=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,Xu=`#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`,Yu=`#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`,qu=`#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`,ju=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Zu=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Ku=`#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`,$u=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,Ju=`#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 +}`,Qu=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,td=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,ed=`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`,nd=`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 ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +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`,id=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * 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, envMapRotation * 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`,sd=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,rd=`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`,ad=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,od=`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`,ld=`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_DISPERSION + material.dispersion = dispersion; +#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`,cd=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #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 ); +}`,hd=` +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.shadowIntensity, 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.shadowIntensity, 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.shadowIntensity, 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`,ud=`#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`,dd=`#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`,fd=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,pd=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,md=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,_d=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,gd=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,vd=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,xd=`#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`,Md=`#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`,Sd=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,yd=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,Ed=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,Td=`#if defined( USE_MORPHCOLORS ) + 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`,bd=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Ad=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + 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 ); + } +#endif`,wd=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Rd=`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;`,Cd=`#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`,Pd=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Dd=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Ld=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Ud=`#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`,Id=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,Nd=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,Fd=`#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`,Od=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,Bd=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,zd=`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 float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in 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( const in 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 ); +}`,Hd=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,kd=`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;`,Vd=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,Gd=`#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`,Wd=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,Xd=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,Yd=`#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 shadowIntensity; + 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 shadowIntensity; + 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 shadowIntensity; + 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 shadowIntensity, 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 mix( 1.0, shadow, shadowIntensity ); + } + 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 shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + 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 + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,qd=`#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 shadowIntensity; + 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 shadowIntensity; + 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 shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,jd=`#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`,Zd=`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.shadowIntensity, 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.shadowIntensity, 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.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Kd=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,$d=`#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`,Jd=`#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`,Qd=`#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`,tf=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,ef=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,nf=`#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 CineonToneMapping( 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 ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,rf=`#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.dispersion, 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 dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], 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 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + 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; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + 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`,of=`#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`,lf=`#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`,cf=`#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`,hf=`#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 uf=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,df=`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 +}`,ff=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,pf=`#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; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,mf=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,_f=`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 +}`,gf=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,vf=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #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 ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,xf=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,Mf=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #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 +}`,yf=`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 + #include +}`,Tf=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,bf=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #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 +}`,Af=`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() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #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 +}`,wf=`#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 + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Rf=`#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() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + 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 +}`,Cf=`#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 + #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() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #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 +}`,Df=`#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 + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,Lf=`#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() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,Uf=`#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 + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,If=`#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() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + 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 +}`,Nf=`#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 + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,Ff=`#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_DISPERSION + uniform float dispersion; +#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() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + 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 + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,Bf=`#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() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + 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 +}`,zf=`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 + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,Hf=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,kf=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #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 +}`,Gf=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #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 +}`,Wf=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,kt={alphahash_fragment:uu,alphahash_pars_fragment:du,alphamap_fragment:fu,alphamap_pars_fragment:pu,alphatest_fragment:mu,alphatest_pars_fragment:_u,aomap_fragment:gu,aomap_pars_fragment:vu,batching_pars_vertex:xu,batching_vertex:Mu,begin_vertex:Su,beginnormal_vertex:yu,bsdfs:Eu,iridescence_fragment:Tu,bumpmap_pars_fragment:bu,clipping_planes_fragment:Au,clipping_planes_pars_fragment:wu,clipping_planes_pars_vertex:Ru,clipping_planes_vertex:Cu,color_fragment:Pu,color_pars_fragment:Du,color_pars_vertex:Lu,color_vertex:Uu,common:Iu,cube_uv_reflection_fragment:Nu,defaultnormal_vertex:Fu,displacementmap_pars_vertex:Ou,displacementmap_vertex:Bu,emissivemap_fragment:zu,emissivemap_pars_fragment:Hu,colorspace_fragment:ku,colorspace_pars_fragment:Vu,envmap_fragment:Gu,envmap_common_pars_fragment:Wu,envmap_pars_fragment:Xu,envmap_pars_vertex:Yu,envmap_physical_pars_fragment:id,envmap_vertex:qu,fog_vertex:ju,fog_pars_vertex:Zu,fog_fragment:Ku,fog_pars_fragment:$u,gradientmap_pars_fragment:Ju,lightmap_pars_fragment:Qu,lights_lambert_fragment:td,lights_lambert_pars_fragment:ed,lights_pars_begin:nd,lights_toon_fragment:sd,lights_toon_pars_fragment:rd,lights_phong_fragment:ad,lights_phong_pars_fragment:od,lights_physical_fragment:ld,lights_physical_pars_fragment:cd,lights_fragment_begin:hd,lights_fragment_maps:ud,lights_fragment_end:dd,logdepthbuf_fragment:fd,logdepthbuf_pars_fragment:pd,logdepthbuf_pars_vertex:md,logdepthbuf_vertex:_d,map_fragment:gd,map_pars_fragment:vd,map_particle_fragment:xd,map_particle_pars_fragment:Md,metalnessmap_fragment:Sd,metalnessmap_pars_fragment:yd,morphinstance_vertex:Ed,morphcolor_vertex:Td,morphnormal_vertex:bd,morphtarget_pars_vertex:Ad,morphtarget_vertex:wd,normal_fragment_begin:Rd,normal_fragment_maps:Cd,normal_pars_fragment:Pd,normal_pars_vertex:Dd,normal_vertex:Ld,normalmap_pars_fragment:Ud,clearcoat_normal_fragment_begin:Id,clearcoat_normal_fragment_maps:Nd,clearcoat_pars_fragment:Fd,iridescence_pars_fragment:Od,opaque_fragment:Bd,packing:zd,premultiplied_alpha_fragment:Hd,project_vertex:kd,dithering_fragment:Vd,dithering_pars_fragment:Gd,roughnessmap_fragment:Wd,roughnessmap_pars_fragment:Xd,shadowmap_pars_fragment:Yd,shadowmap_pars_vertex:qd,shadowmap_vertex:jd,shadowmask_pars_fragment:Zd,skinbase_vertex:Kd,skinning_pars_vertex:$d,skinning_vertex:Jd,skinnormal_vertex:Qd,specularmap_fragment:tf,specularmap_pars_fragment:ef,tonemapping_fragment:nf,tonemapping_pars_fragment:sf,transmission_fragment:rf,transmission_pars_fragment:af,uv_pars_fragment:of,uv_pars_vertex:lf,uv_vertex:cf,worldpos_vertex:hf,background_vert:uf,background_frag:df,backgroundCube_vert:ff,backgroundCube_frag:pf,cube_vert:mf,cube_frag:_f,depth_vert:gf,depth_frag:vf,distanceRGBA_vert:xf,distanceRGBA_frag:Mf,equirect_vert:Sf,equirect_frag:yf,linedashed_vert:Ef,linedashed_frag:Tf,meshbasic_vert:bf,meshbasic_frag:Af,meshlambert_vert:wf,meshlambert_frag:Rf,meshmatcap_vert:Cf,meshmatcap_frag:Pf,meshnormal_vert:Df,meshnormal_frag:Lf,meshphong_vert:Uf,meshphong_frag:If,meshphysical_vert:Nf,meshphysical_frag:Ff,meshtoon_vert:Of,meshtoon_frag:Bf,points_vert:zf,points_frag:Hf,shadow_vert:kf,shadow_frag:Vf,sprite_vert:Gf,sprite_frag:Wf},rt={common:{diffuse:{value:new xt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new zt},alphaMap:{value:null},alphaMapTransform:{value:new zt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new zt}},envmap:{envMap:{value:null},envMapRotation:{value:new zt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new zt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new zt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new zt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new zt},normalScale:{value:new gt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new zt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new zt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new zt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new zt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new xt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new xt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new zt},alphaTest:{value:0},uvTransform:{value:new zt}},sprite:{diffuse:{value:new xt(16777215)},opacity:{value:1},center:{value:new gt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new zt},alphaMap:{value:null},alphaMapTransform:{value:new zt},alphaTest:{value:0}}},ln={basic:{uniforms:Ue([rt.common,rt.specularmap,rt.envmap,rt.aomap,rt.lightmap,rt.fog]),vertexShader:kt.meshbasic_vert,fragmentShader:kt.meshbasic_frag},lambert:{uniforms:Ue([rt.common,rt.specularmap,rt.envmap,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.fog,rt.lights,{emissive:{value:new xt(0)}}]),vertexShader:kt.meshlambert_vert,fragmentShader:kt.meshlambert_frag},phong:{uniforms:Ue([rt.common,rt.specularmap,rt.envmap,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.fog,rt.lights,{emissive:{value:new xt(0)},specular:{value:new xt(1118481)},shininess:{value:30}}]),vertexShader:kt.meshphong_vert,fragmentShader:kt.meshphong_frag},standard:{uniforms:Ue([rt.common,rt.envmap,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.roughnessmap,rt.metalnessmap,rt.fog,rt.lights,{emissive:{value:new xt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:kt.meshphysical_vert,fragmentShader:kt.meshphysical_frag},toon:{uniforms:Ue([rt.common,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.gradientmap,rt.fog,rt.lights,{emissive:{value:new xt(0)}}]),vertexShader:kt.meshtoon_vert,fragmentShader:kt.meshtoon_frag},matcap:{uniforms:Ue([rt.common,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.fog,{matcap:{value:null}}]),vertexShader:kt.meshmatcap_vert,fragmentShader:kt.meshmatcap_frag},points:{uniforms:Ue([rt.points,rt.fog]),vertexShader:kt.points_vert,fragmentShader:kt.points_frag},dashed:{uniforms:Ue([rt.common,rt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:kt.linedashed_vert,fragmentShader:kt.linedashed_frag},depth:{uniforms:Ue([rt.common,rt.displacementmap]),vertexShader:kt.depth_vert,fragmentShader:kt.depth_frag},normal:{uniforms:Ue([rt.common,rt.bumpmap,rt.normalmap,rt.displacementmap,{opacity:{value:1}}]),vertexShader:kt.meshnormal_vert,fragmentShader:kt.meshnormal_frag},sprite:{uniforms:Ue([rt.sprite,rt.fog]),vertexShader:kt.sprite_vert,fragmentShader:kt.sprite_frag},background:{uniforms:{uvTransform:{value:new zt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:kt.background_vert,fragmentShader:kt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new zt}},vertexShader:kt.backgroundCube_vert,fragmentShader:kt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:kt.cube_vert,fragmentShader:kt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:kt.equirect_vert,fragmentShader:kt.equirect_frag},distanceRGBA:{uniforms:Ue([rt.common,rt.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:kt.distanceRGBA_vert,fragmentShader:kt.distanceRGBA_frag},shadow:{uniforms:Ue([rt.lights,rt.fog,{color:{value:new xt(0)},opacity:{value:1}}]),vertexShader:kt.shadow_vert,fragmentShader:kt.shadow_frag}};ln.physical={uniforms:Ue([ln.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new zt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new zt},clearcoatNormalScale:{value:new gt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new zt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new zt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new zt},sheen:{value:0},sheenColor:{value:new xt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new zt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new zt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new zt},transmissionSamplerSize:{value:new gt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new zt},attenuationDistance:{value:0},attenuationColor:{value:new xt(0)},specularColor:{value:new xt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new zt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new zt},anisotropyVector:{value:new gt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new zt}}]),vertexShader:kt.meshphysical_vert,fragmentShader:kt.meshphysical_frag};const Os={r:0,b:0,g:0},qn=new pn,Xf=new ee;function Yf(i,t,e,n,s,r,a){const o=new xt(0);let l=r===!0?0:1,c,h,d=null,f=0,m=null;function g(E){let S=E.isScene===!0?E.background:null;return S&&S.isTexture&&(S=(E.backgroundBlurriness>0?e:t).get(S)),S}function x(E){let S=!1;const D=g(E);D===null?u(o,l):D&&D.isColor&&(u(D,1),S=!0);const A=i.xr.getEnvironmentBlendMode();A==="additive"?n.buffers.color.setClear(0,0,0,1,a):A==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||S)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function p(E,S){const D=g(S);D&&(D.isCubeTexture||D.mapping===ar)?(h===void 0&&(h=new ye(new as(1,1,1),new Ie({name:"BackgroundCubeMaterial",uniforms:ki(ln.backgroundCube.uniforms),vertexShader:ln.backgroundCube.vertexShader,fragmentShader:ln.backgroundCube.fragmentShader,side:Be,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(A,w,N){this.matrixWorld.copyPosition(N.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),qn.copy(S.backgroundRotation),qn.x*=-1,qn.y*=-1,qn.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(qn.y*=-1,qn.z*=-1),h.material.uniforms.envMap.value=D,h.material.uniforms.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Xf.makeRotationFromEuler(qn)),h.material.toneMapped=$t.getTransfer(D.colorSpace)!==se,(d!==D||f!==D.version||m!==i.toneMapping)&&(h.material.needsUpdate=!0,d=D,f=D.version,m=i.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):D&&D.isTexture&&(c===void 0&&(c=new ye(new os(2,2),new Ie({name:"BackgroundMaterial",uniforms:ki(ln.background.uniforms),vertexShader:ln.background.vertexShader,fragmentShader:ln.background.fragmentShader,side:zn,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=D,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=$t.getTransfer(D.colorSpace)!==se,D.matrixAutoUpdate===!0&&D.updateMatrix(),c.material.uniforms.uvTransform.value.copy(D.matrix),(d!==D||f!==D.version||m!==i.toneMapping)&&(c.material.needsUpdate=!0,d=D,f=D.version,m=i.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function u(E,S){E.getRGB(Os,tc(i)),n.buffers.color.setClear(Os.r,Os.g,Os.b,S,a)}function b(){h!==void 0&&(h.geometry.dispose(),h.material.dispose()),c!==void 0&&(c.geometry.dispose(),c.material.dispose())}return{getClearColor:function(){return o},setClearColor:function(E,S=1){o.set(E),l=S,u(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,u(o,l)},render:x,addToRenderList:p,dispose:b}}function qf(i,t){const e=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=f(null);let r=s,a=!1;function o(M,C,W,z,V){let K=!1;const G=d(z,W,C);r!==G&&(r=G,c(r.object)),K=m(M,z,W,V),K&&g(M,z,W,V),V!==null&&t.update(V,i.ELEMENT_ARRAY_BUFFER),(K||a)&&(a=!1,S(M,C,W,z),V!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function l(){return i.createVertexArray()}function c(M){return i.bindVertexArray(M)}function h(M){return i.deleteVertexArray(M)}function d(M,C,W){const z=W.wireframe===!0;let V=n[M.id];V===void 0&&(V={},n[M.id]=V);let K=V[C.id];K===void 0&&(K={},V[C.id]=K);let G=K[z];return G===void 0&&(G=f(l()),K[z]=G),G}function f(M){const C=[],W=[],z=[];for(let V=0;V=0){const dt=V[H];let Mt=K[H];if(Mt===void 0&&(H==="instanceMatrix"&&M.instanceMatrix&&(Mt=M.instanceMatrix),H==="instanceColor"&&M.instanceColor&&(Mt=M.instanceColor)),dt===void 0||dt.attribute!==Mt||Mt&&dt.data!==Mt.data)return!0;G++}return r.attributesNum!==G||r.index!==z}function g(M,C,W,z){const V={},K=C.attributes;let G=0;const $=W.getAttributes();for(const H in $)if($[H].location>=0){let dt=K[H];dt===void 0&&(H==="instanceMatrix"&&M.instanceMatrix&&(dt=M.instanceMatrix),H==="instanceColor"&&M.instanceColor&&(dt=M.instanceColor));const Mt={};Mt.attribute=dt,dt&&dt.data&&(Mt.data=dt.data),V[H]=Mt,G++}r.attributes=V,r.attributesNum=G,r.index=z}function x(){const M=r.newAttributes;for(let C=0,W=M.length;C=0){let nt=V[$];if(nt===void 0&&($==="instanceMatrix"&&M.instanceMatrix&&(nt=M.instanceMatrix),$==="instanceColor"&&M.instanceColor&&(nt=M.instanceColor)),nt!==void 0){const dt=nt.normalized,Mt=nt.itemSize,Ft=t.get(nt);if(Ft===void 0)continue;const Yt=Ft.buffer,Y=Ft.type,et=Ft.bytesPerElement,vt=Y===i.INT||Y===i.UNSIGNED_INT||nt.gpuType===Va;if(nt.isInterleavedBufferAttribute){const lt=nt.data,Rt=lt.stride,it=nt.offset;if(lt.isInstancedInterleavedBuffer){for(let Tt=0;Tt0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const d=e.logarithmicDepthBuffer===!0,f=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),m=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),x=i.getParameter(i.MAX_TEXTURE_SIZE),p=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),u=i.getParameter(i.MAX_VERTEX_ATTRIBS),b=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),E=i.getParameter(i.MAX_VARYING_VECTORS),S=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),D=g>0,A=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:m,maxVertexTextures:g,maxTextureSize:x,maxCubemapSize:p,maxAttributes:u,maxVertexUniforms:b,maxVaryings:E,maxFragmentUniforms:S,vertexTextures:D,maxSamples:A}}function Kf(i){const t=this;let e=null,n=0,s=!1,r=!1;const a=new Nn,o=new zt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const m=d.length!==0||f||n!==0||s;return s=f,n=d.length,m},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,f){e=h(d,f,0)},this.setState=function(d,f,m){const g=d.clippingPlanes,x=d.clipIntersection,p=d.clipShadows,u=i.get(d);if(!s||g===null||g.length===0||r&&!p)r?h(null):c();else{const b=r?0:n,E=b*4;let S=u.clippingState||null;l.value=S,S=h(g,f,E,m);for(let D=0;D!==E;++D)S[D]=e[D];u.clippingState=S,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(d,f,m,g){const x=d!==null?d.length:0;let p=null;if(x!==0){if(p=l.value,g!==!0||p===null){const u=m+x*4,b=f.matrixWorldInverse;o.getNormalMatrix(b),(p===null||p.length0){const c=new Wh(l.height);return c.fromEquirectangularTexture(i,a),t.set(a,c),a.addEventListener("dispose",s),e(c.texture,a.mapping)}else return null}}return a}function s(a){const o=a.target;o.removeEventListener("dispose",s);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function r(){t=new WeakMap}return{get:n,dispose:r}}const Pi=4,Ko=[.125,.215,.35,.446,.526,.582],$n=20,zr=new oc,$o=new xt;let Hr=null,kr=0,Vr=0,Gr=!1;const Zn=(1+Math.sqrt(5))/2,bi=1/Zn,Jo=[new P(-Zn,bi,0),new P(Zn,bi,0),new P(-bi,0,Zn),new P(bi,0,Zn),new P(0,Zn,-bi),new P(0,Zn,bi),new P(-1,1,-1),new P(1,1,-1),new P(-1,1,1),new P(1,1,1)];class Qo{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,s=100){Hr=this._renderer.getRenderTarget(),kr=this._renderer.getActiveCubeFace(),Vr=this._renderer.getActiveMipmapLevel(),Gr=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,s,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=nl(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=el(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?E:0,E,E),h.setRenderTarget(s),x&&h.render(g,o),h.render(t,o)}g.geometry.dispose(),g.material.dispose(),h.toneMapping=f,h.autoClear=d,t.background=p}_textureToCubeUV(t,e){const n=this._renderer,s=t.mapping===Fi||t.mapping===Oi;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=nl()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=el());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new ye(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;const l=this._cubeSize;Bs(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(a,zr)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;r$n&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${$n}`);const u=[];let b=0;for(let w=0;w<$n;++w){const N=w/x,y=Math.exp(-N*N/2);u.push(y),w===0?b+=y:wE-Pi?s-E+Pi:0),A=4*(this._cubeSize-S);Bs(e,D,A,3*S,2*S),l.setRenderTarget(e),l.render(d,zr)}}function Jf(i){const t=[],e=[],n=[];let s=i;const r=i-Pi+1+Ko.length;for(let a=0;ai-Pi?l=Ko[a-i+Pi-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,d=1+c,f=[h,h,d,h,d,d,h,h,d,d,h,d],m=6,g=6,x=3,p=2,u=1,b=new Float32Array(x*g*m),E=new Float32Array(p*g*m),S=new Float32Array(u*g*m);for(let A=0;A2?0:-1,y=[w,N,0,w+2/3,N,0,w+2/3,N+1,0,w,N,0,w+2/3,N+1,0,w,N+1,0];b.set(y,x*g*A),E.set(f,p*g*A);const M=[A,A,A,A,A,A];S.set(M,u*g*A)}const D=new Ee;D.setAttribute("position",new Se(b,x)),D.setAttribute("uv",new Se(E,p)),D.setAttribute("faceIndex",new Se(S,u)),t.push(D),s>Pi&&s--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function tl(i,t,e){const n=new an(i,t,e);return n.texture.mapping=ar,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Bs(i,t,e,n,s){i.viewport.set(t,e,n,s),i.scissor.set(t,e,n,s)}function Qf(i,t,e){const n=new Float32Array($n),s=new P(0,1,0);return new Ie({name:"SphericalGaussianBlur",defines:{n:$n,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:to(),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:Tn,depthTest:!1,depthWrite:!1})}function el(){return new Ie({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:to(),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:Tn,depthTest:!1,depthWrite:!1})}function nl(){return new Ie({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:to(),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:Tn,depthTest:!1,depthWrite:!1})}function to(){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 tp(i){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===sa||l===ra,h=l===Fi||l===Oi;if(c||h){let d=t.get(o);const f=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return e===null&&(e=new Qo(i)),d=c?e.fromEquirectangular(o,d):e.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),d.texture;if(d!==void 0)return d.texture;{const m=o.image;return c&&m&&m.height>0||h&&m&&s(m)?(e===null&&(e=new Qo(i)),d=c?e.fromEquirectangular(o):e.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function s(o){let l=0;const c=6;for(let h=0;ht.maxTextureSize&&(D=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);const A=new Float32Array(S*D*4*d),w=new Kl(A,S,D,d);w.type=dn,w.needsUpdate=!0;const N=E*4;for(let M=0;M0)return i;const s=t*e;let r=sl[s];if(r===void 0&&(r=new Float32Array(s),sl[s]=r),t!==0){n.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,i[a].toArray(r,o)}return r}function ve(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e":" "} ${o}: ${e[a]}`)}return n.join(` +`)}const ul=new zt;function tm(i){$t._getMatrix(ul,$t.workingColorSpace,i);const t=`mat3( ${ul.elements.map(e=>e.toFixed(4))} )`;switch($t.getTransfer(i)){case Ks:return[t,"LinearTransferOETF"];case se:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[t,"LinearTransferOETF"]}}function dl(i,t,e){const n=i.getShaderParameter(t,i.COMPILE_STATUS),s=i.getShaderInfoLog(t).trim();if(n&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const a=parseInt(r[1]);return e.toUpperCase()+` + +`+s+` + +`+Qp(i.getShaderSource(t),a)}else return s}function em(i,t){const e=tm(t);return[`vec4 ${i}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(` +`)}function nm(i,t){let e;switch(t){case eh:e="Linear";break;case nh:e="Reinhard";break;case ih:e="Cineon";break;case Nl:e="ACESFilmic";break;case rh:e="AgX";break;case ah:e="Neutral";break;case sh:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+i+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const zs=new P;function im(){$t.getLuminanceCoefficients(zs);const i=zs.x.toFixed(4),t=zs.y.toFixed(4),e=zs.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(` +`)}function sm(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(is).join(` +`)}function rm(i){const t=[];for(const e in i){const n=i[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(` +`)}function am(i,t){const e={},n=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Ha(i){return i.replace(om,cm)}const lm=new Map;function cm(i,t){let e=kt[t];if(e===void 0){const n=lm.get(t);if(n!==void 0)e=kt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return Ha(e)}const hm=/#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 ml(i){return i.replace(hm,um)}function um(i,t,e,n){let s="";for(let r=parseInt(t);r0&&(p+=` +`),u=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g].filter(is).join(` +`),u.length>0&&(u+=` +`)):(p=[_l(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(is).join(` +`),u=[_l(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==On?"#define TONE_MAPPING":"",e.toneMapping!==On?kt.tonemapping_pars_fragment:"",e.toneMapping!==On?nm("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",kt.colorspace_pars_fragment,em("linearToOutputTexel",e.outputColorSpace),im(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`].filter(is).join(` +`)),a=Ha(a),a=fl(a,e),a=pl(a,e),o=Ha(o),o=fl(o,e),o=pl(o,e),a=ml(a),o=ml(o),e.isRawShaderMaterial!==!0&&(b=`#version 300 es +`,p=[m,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+p,u=["#define varying in",e.glslVersion===po?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===po?"":"#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(` +`)+` +`+u);const E=b+p+a,S=b+u+o,D=hl(s,s.VERTEX_SHADER,E),A=hl(s,s.FRAGMENT_SHADER,S);s.attachShader(x,D),s.attachShader(x,A),e.index0AttributeName!==void 0?s.bindAttribLocation(x,0,e.index0AttributeName):e.morphTargets===!0&&s.bindAttribLocation(x,0,"position"),s.linkProgram(x);function w(C){if(i.debug.checkShaderErrors){const W=s.getProgramInfoLog(x).trim(),z=s.getShaderInfoLog(D).trim(),V=s.getShaderInfoLog(A).trim();let K=!0,G=!0;if(s.getProgramParameter(x,s.LINK_STATUS)===!1)if(K=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,x,D,A);else{const $=dl(s,D,"vertex"),H=dl(s,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(x,s.VALIDATE_STATUS)+` + +Material Name: `+C.name+` +Material Type: `+C.type+` + +Program Info Log: `+W+` +`+$+` +`+H)}else W!==""?console.warn("THREE.WebGLProgram: Program Info Log:",W):(z===""||V==="")&&(G=!1);G&&(C.diagnostics={runnable:K,programLog:W,vertexShader:{log:z,prefix:p},fragmentShader:{log:V,prefix:u}})}s.deleteShader(D),s.deleteShader(A),N=new qs(s,x),y=am(s,x)}let N;this.getUniforms=function(){return N===void 0&&w(this),N};let y;this.getAttributes=function(){return y===void 0&&w(this),y};let M=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=s.getProgramParameter(x,$p)),M},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(x),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Jp++,this.cacheKey=t,this.usedTimes=1,this.program=x,this.vertexShader=D,this.fragmentShader=A,this}let vm=0;class xm{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return n===void 0&&(n=new Mm(t),e.set(t,n)),n}}class Mm{constructor(t){this.id=vm++,this.code=t,this.usedTimes=0}}function Sm(i,t,e,n,s,r,a){const o=new Za,l=new xm,c=new Set,h=[],d=s.logarithmicDepthBuffer,f=s.vertexTextures;let m=s.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function x(y){return c.add(y),y===0?"uv":`uv${y}`}function p(y,M,C,W,z){const V=W.fog,K=z.geometry,G=y.isMeshStandardMaterial?W.environment:null,$=(y.isMeshStandardMaterial?e:t).get(y.envMap||G),H=$&&$.mapping===ar?$.image.height:null,nt=g[y.type];y.precision!==null&&(m=s.getMaxPrecision(y.precision),m!==y.precision&&console.warn("THREE.WebGLProgram.getParameters:",y.precision,"not supported, using",m,"instead."));const dt=K.morphAttributes.position||K.morphAttributes.normal||K.morphAttributes.color,Mt=dt!==void 0?dt.length:0;let Ft=0;K.morphAttributes.position!==void 0&&(Ft=1),K.morphAttributes.normal!==void 0&&(Ft=2),K.morphAttributes.color!==void 0&&(Ft=3);let Yt,Y,et,vt;if(nt){const ne=ln[nt];Yt=ne.vertexShader,Y=ne.fragmentShader}else Yt=y.vertexShader,Y=y.fragmentShader,l.update(y),et=l.getVertexShaderID(y),vt=l.getFragmentShaderID(y);const lt=i.getRenderTarget(),Rt=i.state.buffers.depth.getReversed(),it=z.isInstancedMesh===!0,Tt=z.isBatchedMesh===!0,qt=!!y.map,Ht=!!y.matcap,Jt=!!$,R=!!y.aoMap,_e=!!y.lightMap,Vt=!!y.bumpMap,Wt=!!y.normalMap,Et=!!y.displacementMap,le=!!y.emissiveMap,St=!!y.metalnessMap,T=!!y.roughnessMap,_=y.anisotropy>0,F=y.clearcoat>0,q=y.dispersion>0,Z=y.iridescence>0,X=y.sheen>0,yt=y.transmission>0,at=_&&!!y.anisotropyMap,ft=F&&!!y.clearcoatMap,Xt=F&&!!y.clearcoatNormalMap,Q=F&&!!y.clearcoatRoughnessMap,pt=Z&&!!y.iridescenceMap,bt=Z&&!!y.iridescenceThicknessMap,Lt=X&&!!y.sheenColorMap,st=X&&!!y.sheenRoughnessMap,Dt=!!y.specularMap,Ct=!!y.specularColorMap,jt=!!y.specularIntensityMap,L=yt&&!!y.transmissionMap,ot=yt&&!!y.thicknessMap,k=!!y.gradientMap,j=!!y.alphaMap,ct=y.alphaTest>0,ht=!!y.alphaHash,Ot=!!y.extensions;let he=On;y.toneMapped&&(lt===null||lt.isXRRenderTarget===!0)&&(he=i.toneMapping);const Ae={shaderID:nt,shaderType:y.type,shaderName:y.name,vertexShader:Yt,fragmentShader:Y,defines:y.defines,customVertexShaderID:et,customFragmentShaderID:vt,isRawShaderMaterial:y.isRawShaderMaterial===!0,glslVersion:y.glslVersion,precision:m,batching:Tt,batchingColor:Tt&&z._colorsTexture!==null,instancing:it,instancingColor:it&&z.instanceColor!==null,instancingMorph:it&&z.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:lt===null?i.outputColorSpace:lt.isXRRenderTarget===!0?lt.texture.colorSpace:Hi,alphaToCoverage:!!y.alphaToCoverage,map:qt,matcap:Ht,envMap:Jt,envMapMode:Jt&&$.mapping,envMapCubeUVHeight:H,aoMap:R,lightMap:_e,bumpMap:Vt,normalMap:Wt,displacementMap:f&&Et,emissiveMap:le,normalMapObjectSpace:Wt&&y.normalMapType===hh,normalMapTangentSpace:Wt&&y.normalMapType===Yl,metalnessMap:St,roughnessMap:T,anisotropy:_,anisotropyMap:at,clearcoat:F,clearcoatMap:ft,clearcoatNormalMap:Xt,clearcoatRoughnessMap:Q,dispersion:q,iridescence:Z,iridescenceMap:pt,iridescenceThicknessMap:bt,sheen:X,sheenColorMap:Lt,sheenRoughnessMap:st,specularMap:Dt,specularColorMap:Ct,specularIntensityMap:jt,transmission:yt,transmissionMap:L,thicknessMap:ot,gradientMap:k,opaque:y.transparent===!1&&y.blending===Li&&y.alphaToCoverage===!1,alphaMap:j,alphaTest:ct,alphaHash:ht,combine:y.combine,mapUv:qt&&x(y.map.channel),aoMapUv:R&&x(y.aoMap.channel),lightMapUv:_e&&x(y.lightMap.channel),bumpMapUv:Vt&&x(y.bumpMap.channel),normalMapUv:Wt&&x(y.normalMap.channel),displacementMapUv:Et&&x(y.displacementMap.channel),emissiveMapUv:le&&x(y.emissiveMap.channel),metalnessMapUv:St&&x(y.metalnessMap.channel),roughnessMapUv:T&&x(y.roughnessMap.channel),anisotropyMapUv:at&&x(y.anisotropyMap.channel),clearcoatMapUv:ft&&x(y.clearcoatMap.channel),clearcoatNormalMapUv:Xt&&x(y.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Q&&x(y.clearcoatRoughnessMap.channel),iridescenceMapUv:pt&&x(y.iridescenceMap.channel),iridescenceThicknessMapUv:bt&&x(y.iridescenceThicknessMap.channel),sheenColorMapUv:Lt&&x(y.sheenColorMap.channel),sheenRoughnessMapUv:st&&x(y.sheenRoughnessMap.channel),specularMapUv:Dt&&x(y.specularMap.channel),specularColorMapUv:Ct&&x(y.specularColorMap.channel),specularIntensityMapUv:jt&&x(y.specularIntensityMap.channel),transmissionMapUv:L&&x(y.transmissionMap.channel),thicknessMapUv:ot&&x(y.thicknessMap.channel),alphaMapUv:j&&x(y.alphaMap.channel),vertexTangents:!!K.attributes.tangent&&(Wt||_),vertexColors:y.vertexColors,vertexAlphas:y.vertexColors===!0&&!!K.attributes.color&&K.attributes.color.itemSize===4,pointsUvs:z.isPoints===!0&&!!K.attributes.uv&&(qt||j),fog:!!V,useFog:y.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:y.flatShading===!0,sizeAttenuation:y.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:Rt,skinning:z.isSkinnedMesh===!0,morphTargets:K.morphAttributes.position!==void 0,morphNormals:K.morphAttributes.normal!==void 0,morphColors:K.morphAttributes.color!==void 0,morphTargetsCount:Mt,morphTextureStride:Ft,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:y.dithering,shadowMapEnabled:i.shadowMap.enabled&&C.length>0,shadowMapType:i.shadowMap.type,toneMapping:he,decodeVideoTexture:qt&&y.map.isVideoTexture===!0&&$t.getTransfer(y.map.colorSpace)===se,decodeVideoTextureEmissive:le&&y.emissiveMap.isVideoTexture===!0&&$t.getTransfer(y.emissiveMap.colorSpace)===se,premultipliedAlpha:y.premultipliedAlpha,doubleSided:y.side===cn,flipSided:y.side===Be,useDepthPacking:y.depthPacking>=0,depthPacking:y.depthPacking||0,index0AttributeName:y.index0AttributeName,extensionClipCullDistance:Ot&&y.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ot&&y.extensions.multiDraw===!0||Tt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:y.customProgramCacheKey()};return Ae.vertexUv1s=c.has(1),Ae.vertexUv2s=c.has(2),Ae.vertexUv3s=c.has(3),c.clear(),Ae}function u(y){const M=[];if(y.shaderID?M.push(y.shaderID):(M.push(y.customVertexShaderID),M.push(y.customFragmentShaderID)),y.defines!==void 0)for(const C in y.defines)M.push(C),M.push(y.defines[C]);return y.isRawShaderMaterial===!1&&(b(M,y),E(M,y),M.push(i.outputColorSpace)),M.push(y.customProgramCacheKey),M.join()}function b(y,M){y.push(M.precision),y.push(M.outputColorSpace),y.push(M.envMapMode),y.push(M.envMapCubeUVHeight),y.push(M.mapUv),y.push(M.alphaMapUv),y.push(M.lightMapUv),y.push(M.aoMapUv),y.push(M.bumpMapUv),y.push(M.normalMapUv),y.push(M.displacementMapUv),y.push(M.emissiveMapUv),y.push(M.metalnessMapUv),y.push(M.roughnessMapUv),y.push(M.anisotropyMapUv),y.push(M.clearcoatMapUv),y.push(M.clearcoatNormalMapUv),y.push(M.clearcoatRoughnessMapUv),y.push(M.iridescenceMapUv),y.push(M.iridescenceThicknessMapUv),y.push(M.sheenColorMapUv),y.push(M.sheenRoughnessMapUv),y.push(M.specularMapUv),y.push(M.specularColorMapUv),y.push(M.specularIntensityMapUv),y.push(M.transmissionMapUv),y.push(M.thicknessMapUv),y.push(M.combine),y.push(M.fogExp2),y.push(M.sizeAttenuation),y.push(M.morphTargetsCount),y.push(M.morphAttributeCount),y.push(M.numDirLights),y.push(M.numPointLights),y.push(M.numSpotLights),y.push(M.numSpotLightMaps),y.push(M.numHemiLights),y.push(M.numRectAreaLights),y.push(M.numDirLightShadows),y.push(M.numPointLightShadows),y.push(M.numSpotLightShadows),y.push(M.numSpotLightShadowsWithMaps),y.push(M.numLightProbes),y.push(M.shadowMapType),y.push(M.toneMapping),y.push(M.numClippingPlanes),y.push(M.numClipIntersection),y.push(M.depthPacking)}function E(y,M){o.disableAll(),M.supportsVertexTextures&&o.enable(0),M.instancing&&o.enable(1),M.instancingColor&&o.enable(2),M.instancingMorph&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),M.dispersion&&o.enable(20),M.batchingColor&&o.enable(21),y.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.reverseDepthBuffer&&o.enable(4),M.skinning&&o.enable(5),M.morphTargets&&o.enable(6),M.morphNormals&&o.enable(7),M.morphColors&&o.enable(8),M.premultipliedAlpha&&o.enable(9),M.shadowMapEnabled&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.decodeVideoTextureEmissive&&o.enable(20),M.alphaToCoverage&&o.enable(21),y.push(o.mask)}function S(y){const M=g[y.type];let C;if(M){const W=ln[M];C=Qs.clone(W.uniforms)}else C=y.uniforms;return C}function D(y,M){let C;for(let W=0,z=h.length;W0?n.push(u):m.transparent===!0?s.push(u):e.push(u)}function l(d,f,m,g,x,p){const u=a(d,f,m,g,x,p);m.transmission>0?n.unshift(u):m.transparent===!0?s.unshift(u):e.unshift(u)}function c(d,f){e.length>1&&e.sort(d||Em),n.length>1&&n.sort(f||gl),s.length>1&&s.sort(f||gl)}function h(){for(let d=t,f=i.length;d=r.length?(a=new vl,r.push(a)):a=r[s],a}function e(){i=new WeakMap}return{get:t,dispose:e}}function bm(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new P,color:new xt};break;case"SpotLight":e={position:new P,direction:new P,color:new xt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new P,color:new xt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new P,skyColor:new xt,groundColor:new xt};break;case"RectAreaLight":e={color:new xt,position:new P,halfWidth:new P,halfHeight:new P};break}return i[t.id]=e,e}}}function Am(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[t.id]=e,e}}}let wm=0;function Rm(i,t){return(t.castShadow?2:0)-(i.castShadow?2:0)+(t.map?1:0)-(i.map?1:0)}function Cm(i){const t=new bm,e=Am(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new P);const s=new P,r=new ee,a=new ee;function o(c){let h=0,d=0,f=0;for(let y=0;y<9;y++)n.probe[y].set(0,0,0);let m=0,g=0,x=0,p=0,u=0,b=0,E=0,S=0,D=0,A=0,w=0;c.sort(Rm);for(let y=0,M=c.length;y0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=rt.LTC_FLOAT_1,n.rectAreaLTC2=rt.LTC_FLOAT_2):(n.rectAreaLTC1=rt.LTC_HALF_1,n.rectAreaLTC2=rt.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=d,n.ambient[2]=f;const N=n.hash;(N.directionalLength!==m||N.pointLength!==g||N.spotLength!==x||N.rectAreaLength!==p||N.hemiLength!==u||N.numDirectionalShadows!==b||N.numPointShadows!==E||N.numSpotShadows!==S||N.numSpotMaps!==D||N.numLightProbes!==w)&&(n.directional.length=m,n.spot.length=x,n.rectArea.length=p,n.point.length=g,n.hemi.length=u,n.directionalShadow.length=b,n.directionalShadowMap.length=b,n.pointShadow.length=E,n.pointShadowMap.length=E,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=b,n.pointShadowMatrix.length=E,n.spotLightMatrix.length=S+D-A,n.spotLightMap.length=D,n.numSpotLightShadowsWithMaps=A,n.numLightProbes=w,N.directionalLength=m,N.pointLength=g,N.spotLength=x,N.rectAreaLength=p,N.hemiLength=u,N.numDirectionalShadows=b,N.numPointShadows=E,N.numSpotShadows=S,N.numSpotMaps=D,N.numLightProbes=w,n.version=wm++)}function l(c,h){let d=0,f=0,m=0,g=0,x=0;const p=h.matrixWorldInverse;for(let u=0,b=c.length;u=a.length?(o=new xl(i),a.push(o)):o=a[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}const Dm=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,Lm=`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 Um(i,t,e){let n=new Ka;const s=new gt,r=new gt,a=new oe,o=new tu({depthPacking:ch}),l=new eu,c={},h=e.maxTextureSize,d={[zn]:Be,[Be]:zn,[cn]:cn},f=new Ie({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new gt},radius:{value:4}},vertexShader:Dm,fragmentShader:Lm}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const g=new Ee;g.setAttribute("position",new Se(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new ye(g,f),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ul;let u=this.type;this.render=function(A,w,N){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||A.length===0)return;const y=i.getRenderTarget(),M=i.getActiveCubeFace(),C=i.getActiveMipmapLevel(),W=i.state;W.setBlending(Tn),W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const z=u!==yn&&this.type===yn,V=u===yn&&this.type!==yn;for(let K=0,G=A.length;Kh||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/nt.x),s.x=r.x*nt.x,H.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/nt.y),s.y=r.y*nt.y,H.mapSize.y=r.y)),H.map===null||z===!0||V===!0){const Mt=this.type!==yn?{minFilter:Xe,magFilter:Xe}:{};H.map!==null&&H.map.dispose(),H.map=new an(s.x,s.y,Mt),H.map.texture.name=$.name+".shadowMap",H.camera.updateProjectionMatrix()}i.setRenderTarget(H.map),i.clear();const dt=H.getViewportCount();for(let Mt=0;Mt0||w.map&&w.alphaTest>0){const W=M.uuid,z=w.uuid;let V=c[W];V===void 0&&(V={},c[W]=V);let K=V[z];K===void 0&&(K=M.clone(),V[z]=K,w.addEventListener("dispose",D)),M=K}if(M.visible=w.visible,M.wireframe=w.wireframe,y===yn?M.side=w.shadowSide!==null?w.shadowSide:w.side:M.side=w.shadowSide!==null?w.shadowSide:d[w.side],M.alphaMap=w.alphaMap,M.alphaTest=w.alphaTest,M.map=w.map,M.clipShadows=w.clipShadows,M.clippingPlanes=w.clippingPlanes,M.clipIntersection=w.clipIntersection,M.displacementMap=w.displacementMap,M.displacementScale=w.displacementScale,M.displacementBias=w.displacementBias,M.wireframeLinewidth=w.wireframeLinewidth,M.linewidth=w.linewidth,N.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const W=i.properties.get(M);W.light=N}return M}function S(A,w,N,y,M){if(A.visible===!1)return;if(A.layers.test(w.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&M===yn)&&(!A.frustumCulled||n.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,A.matrixWorld);const z=t.update(A),V=A.material;if(Array.isArray(V)){const K=z.groups;for(let G=0,$=K.length;G<$;G++){const H=K[G],nt=V[H.materialIndex];if(nt&&nt.visible){const dt=E(A,nt,y,M);A.onBeforeShadow(i,A,w,N,z,dt,H),i.renderBufferDirect(N,null,z,dt,A,H),A.onAfterShadow(i,A,w,N,z,dt,H)}}}else if(V.visible){const K=E(A,V,y,M);A.onBeforeShadow(i,A,w,N,z,K,null),i.renderBufferDirect(N,null,z,K,A,null),A.onAfterShadow(i,A,w,N,z,K,null)}}const W=A.children;for(let z=0,V=W.length;z=1):H.indexOf("OpenGL ES")!==-1&&($=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),G=$>=2);let nt=null,dt={};const Mt=i.getParameter(i.SCISSOR_BOX),Ft=i.getParameter(i.VIEWPORT),Yt=new oe().fromArray(Mt),Y=new oe().fromArray(Ft);function et(L,ot,k,j){const ct=new Uint8Array(4),ht=i.createTexture();i.bindTexture(L,ht),i.texParameteri(L,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(L,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let Ot=0;Ot"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new gt,h=new WeakMap;let d;const f=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(T,_){return m?new OffscreenCanvas(T,_):Js("canvas")}function x(T,_,F){let q=1;const Z=St(T);if((Z.width>F||Z.height>F)&&(q=F/Math.max(Z.width,Z.height)),q<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){const X=Math.floor(q*Z.width),yt=Math.floor(q*Z.height);d===void 0&&(d=g(X,yt));const at=_?g(X,yt):d;return at.width=X,at.height=yt,at.getContext("2d").drawImage(T,0,0,X,yt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Z.width+"x"+Z.height+") to ("+X+"x"+yt+")."),at}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Z.width+"x"+Z.height+")."),T;return T}function p(T){return T.generateMipmaps}function u(T){i.generateMipmap(T)}function b(T){return T.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:T.isWebGL3DRenderTarget?i.TEXTURE_3D:T.isWebGLArrayRenderTarget||T.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function E(T,_,F,q,Z=!1){if(T!==null){if(i[T]!==void 0)return i[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let X=_;if(_===i.RED&&(F===i.FLOAT&&(X=i.R32F),F===i.HALF_FLOAT&&(X=i.R16F),F===i.UNSIGNED_BYTE&&(X=i.R8)),_===i.RED_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.R8UI),F===i.UNSIGNED_SHORT&&(X=i.R16UI),F===i.UNSIGNED_INT&&(X=i.R32UI),F===i.BYTE&&(X=i.R8I),F===i.SHORT&&(X=i.R16I),F===i.INT&&(X=i.R32I)),_===i.RG&&(F===i.FLOAT&&(X=i.RG32F),F===i.HALF_FLOAT&&(X=i.RG16F),F===i.UNSIGNED_BYTE&&(X=i.RG8)),_===i.RG_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.RG8UI),F===i.UNSIGNED_SHORT&&(X=i.RG16UI),F===i.UNSIGNED_INT&&(X=i.RG32UI),F===i.BYTE&&(X=i.RG8I),F===i.SHORT&&(X=i.RG16I),F===i.INT&&(X=i.RG32I)),_===i.RGB_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.RGB8UI),F===i.UNSIGNED_SHORT&&(X=i.RGB16UI),F===i.UNSIGNED_INT&&(X=i.RGB32UI),F===i.BYTE&&(X=i.RGB8I),F===i.SHORT&&(X=i.RGB16I),F===i.INT&&(X=i.RGB32I)),_===i.RGBA_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.RGBA8UI),F===i.UNSIGNED_SHORT&&(X=i.RGBA16UI),F===i.UNSIGNED_INT&&(X=i.RGBA32UI),F===i.BYTE&&(X=i.RGBA8I),F===i.SHORT&&(X=i.RGBA16I),F===i.INT&&(X=i.RGBA32I)),_===i.RGB&&F===i.UNSIGNED_INT_5_9_9_9_REV&&(X=i.RGB9_E5),_===i.RGBA){const yt=Z?Ks:$t.getTransfer(q);F===i.FLOAT&&(X=i.RGBA32F),F===i.HALF_FLOAT&&(X=i.RGBA16F),F===i.UNSIGNED_BYTE&&(X=yt===se?i.SRGB8_ALPHA8:i.RGBA8),F===i.UNSIGNED_SHORT_4_4_4_4&&(X=i.RGBA4),F===i.UNSIGNED_SHORT_5_5_5_1&&(X=i.RGB5_A1)}return(X===i.R16F||X===i.R32F||X===i.RG16F||X===i.RG32F||X===i.RGBA16F||X===i.RGBA32F)&&t.get("EXT_color_buffer_float"),X}function S(T,_){let F;return T?_===null||_===ei||_===Bi?F=i.DEPTH24_STENCIL8:_===dn?F=i.DEPTH32F_STENCIL8:_===ss&&(F=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):_===null||_===ei||_===Bi?F=i.DEPTH_COMPONENT24:_===dn?F=i.DEPTH_COMPONENT32F:_===ss&&(F=i.DEPTH_COMPONENT16),F}function D(T,_){return p(T)===!0||T.isFramebufferTexture&&T.minFilter!==Xe&&T.minFilter!==un?Math.log2(Math.max(_.width,_.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?_.mipmaps.length:1}function A(T){const _=T.target;_.removeEventListener("dispose",A),N(_),_.isVideoTexture&&h.delete(_)}function w(T){const _=T.target;_.removeEventListener("dispose",w),M(_)}function N(T){const _=n.get(T);if(_.__webglInit===void 0)return;const F=T.source,q=f.get(F);if(q){const Z=q[_.__cacheKey];Z.usedTimes--,Z.usedTimes===0&&y(T),Object.keys(q).length===0&&f.delete(F)}n.remove(T)}function y(T){const _=n.get(T);i.deleteTexture(_.__webglTexture);const F=T.source,q=f.get(F);delete q[_.__cacheKey],a.memory.textures--}function M(T){const _=n.get(T);if(T.depthTexture&&(T.depthTexture.dispose(),n.remove(T.depthTexture)),T.isWebGLCubeRenderTarget)for(let q=0;q<6;q++){if(Array.isArray(_.__webglFramebuffer[q]))for(let Z=0;Z<_.__webglFramebuffer[q].length;Z++)i.deleteFramebuffer(_.__webglFramebuffer[q][Z]);else i.deleteFramebuffer(_.__webglFramebuffer[q]);_.__webglDepthbuffer&&i.deleteRenderbuffer(_.__webglDepthbuffer[q])}else{if(Array.isArray(_.__webglFramebuffer))for(let q=0;q<_.__webglFramebuffer.length;q++)i.deleteFramebuffer(_.__webglFramebuffer[q]);else i.deleteFramebuffer(_.__webglFramebuffer);if(_.__webglDepthbuffer&&i.deleteRenderbuffer(_.__webglDepthbuffer),_.__webglMultisampledFramebuffer&&i.deleteFramebuffer(_.__webglMultisampledFramebuffer),_.__webglColorRenderbuffer)for(let q=0;q<_.__webglColorRenderbuffer.length;q++)_.__webglColorRenderbuffer[q]&&i.deleteRenderbuffer(_.__webglColorRenderbuffer[q]);_.__webglDepthRenderbuffer&&i.deleteRenderbuffer(_.__webglDepthRenderbuffer)}const F=T.textures;for(let q=0,Z=F.length;q=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+s.maxTextures),C+=1,T}function V(T){const _=[];return _.push(T.wrapS),_.push(T.wrapT),_.push(T.wrapR||0),_.push(T.magFilter),_.push(T.minFilter),_.push(T.anisotropy),_.push(T.internalFormat),_.push(T.format),_.push(T.type),_.push(T.generateMipmaps),_.push(T.premultiplyAlpha),_.push(T.flipY),_.push(T.unpackAlignment),_.push(T.colorSpace),_.join()}function K(T,_){const F=n.get(T);if(T.isVideoTexture&&Et(T),T.isRenderTargetTexture===!1&&T.version>0&&F.__version!==T.version){const q=T.image;if(q===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Y(F,T,_);return}}e.bindTexture(i.TEXTURE_2D,F.__webglTexture,i.TEXTURE0+_)}function G(T,_){const F=n.get(T);if(T.version>0&&F.__version!==T.version){Y(F,T,_);return}e.bindTexture(i.TEXTURE_2D_ARRAY,F.__webglTexture,i.TEXTURE0+_)}function $(T,_){const F=n.get(T);if(T.version>0&&F.__version!==T.version){Y(F,T,_);return}e.bindTexture(i.TEXTURE_3D,F.__webglTexture,i.TEXTURE0+_)}function H(T,_){const F=n.get(T);if(T.version>0&&F.__version!==T.version){et(F,T,_);return}e.bindTexture(i.TEXTURE_CUBE_MAP,F.__webglTexture,i.TEXTURE0+_)}const nt={[aa]:i.REPEAT,[Jn]:i.CLAMP_TO_EDGE,[oa]:i.MIRRORED_REPEAT},dt={[Xe]:i.NEAREST,[oh]:i.NEAREST_MIPMAP_NEAREST,[us]:i.NEAREST_MIPMAP_LINEAR,[un]:i.LINEAR,[dr]:i.LINEAR_MIPMAP_NEAREST,[Qn]:i.LINEAR_MIPMAP_LINEAR},Mt={[uh]:i.NEVER,[gh]:i.ALWAYS,[dh]:i.LESS,[ql]:i.LEQUAL,[fh]:i.EQUAL,[_h]:i.GEQUAL,[ph]:i.GREATER,[mh]:i.NOTEQUAL};function Ft(T,_){if(_.type===dn&&t.has("OES_texture_float_linear")===!1&&(_.magFilter===un||_.magFilter===dr||_.magFilter===us||_.magFilter===Qn||_.minFilter===un||_.minFilter===dr||_.minFilter===us||_.minFilter===Qn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(T,i.TEXTURE_WRAP_S,nt[_.wrapS]),i.texParameteri(T,i.TEXTURE_WRAP_T,nt[_.wrapT]),(T===i.TEXTURE_3D||T===i.TEXTURE_2D_ARRAY)&&i.texParameteri(T,i.TEXTURE_WRAP_R,nt[_.wrapR]),i.texParameteri(T,i.TEXTURE_MAG_FILTER,dt[_.magFilter]),i.texParameteri(T,i.TEXTURE_MIN_FILTER,dt[_.minFilter]),_.compareFunction&&(i.texParameteri(T,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(T,i.TEXTURE_COMPARE_FUNC,Mt[_.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(_.magFilter===Xe||_.minFilter!==us&&_.minFilter!==Qn||_.type===dn&&t.has("OES_texture_float_linear")===!1)return;if(_.anisotropy>1||n.get(_).__currentAnisotropy){const F=t.get("EXT_texture_filter_anisotropic");i.texParameterf(T,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(_.anisotropy,s.getMaxAnisotropy())),n.get(_).__currentAnisotropy=_.anisotropy}}}function Yt(T,_){let F=!1;T.__webglInit===void 0&&(T.__webglInit=!0,_.addEventListener("dispose",A));const q=_.source;let Z=f.get(q);Z===void 0&&(Z={},f.set(q,Z));const X=V(_);if(X!==T.__cacheKey){Z[X]===void 0&&(Z[X]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,F=!0),Z[X].usedTimes++;const yt=Z[T.__cacheKey];yt!==void 0&&(Z[T.__cacheKey].usedTimes--,yt.usedTimes===0&&y(_)),T.__cacheKey=X,T.__webglTexture=Z[X].texture}return F}function Y(T,_,F){let q=i.TEXTURE_2D;(_.isDataArrayTexture||_.isCompressedArrayTexture)&&(q=i.TEXTURE_2D_ARRAY),_.isData3DTexture&&(q=i.TEXTURE_3D);const Z=Yt(T,_),X=_.source;e.bindTexture(q,T.__webglTexture,i.TEXTURE0+F);const yt=n.get(X);if(X.version!==yt.__version||Z===!0){e.activeTexture(i.TEXTURE0+F);const at=$t.getPrimaries($t.workingColorSpace),ft=_.colorSpace===Fn?null:$t.getPrimaries(_.colorSpace),Xt=_.colorSpace===Fn||at===ft?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,_.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,_.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Xt);let Q=x(_.image,!1,s.maxTextureSize);Q=le(_,Q);const pt=r.convert(_.format,_.colorSpace),bt=r.convert(_.type);let Lt=E(_.internalFormat,pt,bt,_.colorSpace,_.isVideoTexture);Ft(q,_);let st;const Dt=_.mipmaps,Ct=_.isVideoTexture!==!0,jt=yt.__version===void 0||Z===!0,L=X.dataReady,ot=D(_,Q);if(_.isDepthTexture)Lt=S(_.format===zi,_.type),jt&&(Ct?e.texStorage2D(i.TEXTURE_2D,1,Lt,Q.width,Q.height):e.texImage2D(i.TEXTURE_2D,0,Lt,Q.width,Q.height,0,pt,bt,null));else if(_.isDataTexture)if(Dt.length>0){Ct&&jt&&e.texStorage2D(i.TEXTURE_2D,ot,Lt,Dt[0].width,Dt[0].height);for(let k=0,j=Dt.length;k0){const ct=Zo(st.width,st.height,_.format,_.type);for(const ht of _.layerUpdates){const Ot=st.data.subarray(ht*ct/st.data.BYTES_PER_ELEMENT,(ht+1)*ct/st.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,k,0,0,ht,st.width,st.height,1,pt,Ot)}_.clearLayerUpdates()}else e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,k,0,0,0,st.width,st.height,Q.depth,pt,st.data)}else e.compressedTexImage3D(i.TEXTURE_2D_ARRAY,k,Lt,st.width,st.height,Q.depth,0,st.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Ct?L&&e.texSubImage3D(i.TEXTURE_2D_ARRAY,k,0,0,0,st.width,st.height,Q.depth,pt,bt,st.data):e.texImage3D(i.TEXTURE_2D_ARRAY,k,Lt,st.width,st.height,Q.depth,0,pt,bt,st.data)}else{Ct&&jt&&e.texStorage2D(i.TEXTURE_2D,ot,Lt,Dt[0].width,Dt[0].height);for(let k=0,j=Dt.length;k0){const k=Zo(Q.width,Q.height,_.format,_.type);for(const j of _.layerUpdates){const ct=Q.data.subarray(j*k/Q.data.BYTES_PER_ELEMENT,(j+1)*k/Q.data.BYTES_PER_ELEMENT);e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,j,Q.width,Q.height,1,pt,bt,ct)}_.clearLayerUpdates()}else e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,Q.width,Q.height,Q.depth,pt,bt,Q.data)}else e.texImage3D(i.TEXTURE_2D_ARRAY,0,Lt,Q.width,Q.height,Q.depth,0,pt,bt,Q.data);else if(_.isData3DTexture)Ct?(jt&&e.texStorage3D(i.TEXTURE_3D,ot,Lt,Q.width,Q.height,Q.depth),L&&e.texSubImage3D(i.TEXTURE_3D,0,0,0,0,Q.width,Q.height,Q.depth,pt,bt,Q.data)):e.texImage3D(i.TEXTURE_3D,0,Lt,Q.width,Q.height,Q.depth,0,pt,bt,Q.data);else if(_.isFramebufferTexture){if(jt)if(Ct)e.texStorage2D(i.TEXTURE_2D,ot,Lt,Q.width,Q.height);else{let k=Q.width,j=Q.height;for(let ct=0;ct>=1,j>>=1}}else if(Dt.length>0){if(Ct&&jt){const k=St(Dt[0]);e.texStorage2D(i.TEXTURE_2D,ot,Lt,k.width,k.height)}for(let k=0,j=Dt.length;k0&&ot++;const j=St(pt[0]);e.texStorage2D(i.TEXTURE_CUBE_MAP,ot,Dt,j.width,j.height)}for(let j=0;j<6;j++)if(Q){Ct?L&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,0,0,pt[j].width,pt[j].height,Lt,st,pt[j].data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,Dt,pt[j].width,pt[j].height,0,Lt,st,pt[j].data);for(let ct=0;ct>X),bt=Math.max(1,_.height>>X);Z===i.TEXTURE_3D||Z===i.TEXTURE_2D_ARRAY?e.texImage3D(Z,X,ft,pt,bt,_.depth,0,yt,at,null):e.texImage2D(Z,X,ft,pt,bt,0,yt,at,null)}e.bindFramebuffer(i.FRAMEBUFFER,T),Wt(_)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,q,Z,Q.__webglTexture,0,Vt(_)):(Z===i.TEXTURE_2D||Z>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&Z<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,q,Z,Q.__webglTexture,X),e.bindFramebuffer(i.FRAMEBUFFER,null)}function lt(T,_,F){if(i.bindRenderbuffer(i.RENDERBUFFER,T),_.depthBuffer){const q=_.depthTexture,Z=q&&q.isDepthTexture?q.type:null,X=S(_.stencilBuffer,Z),yt=_.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,at=Vt(_);Wt(_)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,at,X,_.width,_.height):F?i.renderbufferStorageMultisample(i.RENDERBUFFER,at,X,_.width,_.height):i.renderbufferStorage(i.RENDERBUFFER,X,_.width,_.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,yt,i.RENDERBUFFER,T)}else{const q=_.textures;for(let Z=0;Z{delete _.__boundDepthTexture,delete _.__depthDisposeCallback,q.removeEventListener("dispose",Z)};q.addEventListener("dispose",Z),_.__depthDisposeCallback=Z}_.__boundDepthTexture=q}if(T.depthTexture&&!_.__autoAllocateDepthBuffer){if(F)throw new Error("target.depthTexture not supported in Cube render targets");Rt(_.__webglFramebuffer,T)}else if(F){_.__webglDepthbuffer=[];for(let q=0;q<6;q++)if(e.bindFramebuffer(i.FRAMEBUFFER,_.__webglFramebuffer[q]),_.__webglDepthbuffer[q]===void 0)_.__webglDepthbuffer[q]=i.createRenderbuffer(),lt(_.__webglDepthbuffer[q],T,!1);else{const Z=T.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,X=_.__webglDepthbuffer[q];i.bindRenderbuffer(i.RENDERBUFFER,X),i.framebufferRenderbuffer(i.FRAMEBUFFER,Z,i.RENDERBUFFER,X)}}else if(e.bindFramebuffer(i.FRAMEBUFFER,_.__webglFramebuffer),_.__webglDepthbuffer===void 0)_.__webglDepthbuffer=i.createRenderbuffer(),lt(_.__webglDepthbuffer,T,!1);else{const q=T.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Z=_.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,Z),i.framebufferRenderbuffer(i.FRAMEBUFFER,q,i.RENDERBUFFER,Z)}e.bindFramebuffer(i.FRAMEBUFFER,null)}function Tt(T,_,F){const q=n.get(T);_!==void 0&&vt(q.__webglFramebuffer,T,T.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),F!==void 0&&it(T)}function qt(T){const _=T.texture,F=n.get(T),q=n.get(_);T.addEventListener("dispose",w);const Z=T.textures,X=T.isWebGLCubeRenderTarget===!0,yt=Z.length>1;if(yt||(q.__webglTexture===void 0&&(q.__webglTexture=i.createTexture()),q.__version=_.version,a.memory.textures++),X){F.__webglFramebuffer=[];for(let at=0;at<6;at++)if(_.mipmaps&&_.mipmaps.length>0){F.__webglFramebuffer[at]=[];for(let ft=0;ft<_.mipmaps.length;ft++)F.__webglFramebuffer[at][ft]=i.createFramebuffer()}else F.__webglFramebuffer[at]=i.createFramebuffer()}else{if(_.mipmaps&&_.mipmaps.length>0){F.__webglFramebuffer=[];for(let at=0;at<_.mipmaps.length;at++)F.__webglFramebuffer[at]=i.createFramebuffer()}else F.__webglFramebuffer=i.createFramebuffer();if(yt)for(let at=0,ft=Z.length;at0&&Wt(T)===!1){F.__webglMultisampledFramebuffer=i.createFramebuffer(),F.__webglColorRenderbuffer=[],e.bindFramebuffer(i.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let at=0;at0)for(let ft=0;ft<_.mipmaps.length;ft++)vt(F.__webglFramebuffer[at][ft],T,_,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+at,ft);else vt(F.__webglFramebuffer[at],T,_,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+at,0);p(_)&&u(i.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(yt){for(let at=0,ft=Z.length;at0)for(let ft=0;ft<_.mipmaps.length;ft++)vt(F.__webglFramebuffer[ft],T,_,i.COLOR_ATTACHMENT0,at,ft);else vt(F.__webglFramebuffer,T,_,i.COLOR_ATTACHMENT0,at,0);p(_)&&u(at),e.unbindTexture()}T.depthBuffer&&it(T)}function Ht(T){const _=T.textures;for(let F=0,q=_.length;F0){if(Wt(T)===!1){const _=T.textures,F=T.width,q=T.height;let Z=i.COLOR_BUFFER_BIT;const X=T.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,yt=n.get(T),at=_.length>1;if(at)for(let ft=0;ft<_.length;ft++)e.bindFramebuffer(i.FRAMEBUFFER,yt.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+ft,i.RENDERBUFFER,null),e.bindFramebuffer(i.FRAMEBUFFER,yt.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+ft,i.TEXTURE_2D,null,0);e.bindFramebuffer(i.READ_FRAMEBUFFER,yt.__webglMultisampledFramebuffer),e.bindFramebuffer(i.DRAW_FRAMEBUFFER,yt.__webglFramebuffer);for(let ft=0;ft<_.length;ft++){if(T.resolveDepthBuffer&&(T.depthBuffer&&(Z|=i.DEPTH_BUFFER_BIT),T.stencilBuffer&&T.resolveStencilBuffer&&(Z|=i.STENCIL_BUFFER_BIT)),at){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,yt.__webglColorRenderbuffer[ft]);const Xt=n.get(_[ft]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,Xt,0)}i.blitFramebuffer(0,0,F,q,0,0,F,q,Z,i.NEAREST),l===!0&&(Jt.length=0,R.length=0,Jt.push(i.COLOR_ATTACHMENT0+ft),T.depthBuffer&&T.resolveDepthBuffer===!1&&(Jt.push(X),R.push(X),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,R)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,Jt))}if(e.bindFramebuffer(i.READ_FRAMEBUFFER,null),e.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),at)for(let ft=0;ft<_.length;ft++){e.bindFramebuffer(i.FRAMEBUFFER,yt.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+ft,i.RENDERBUFFER,yt.__webglColorRenderbuffer[ft]);const Xt=n.get(_[ft]).__webglTexture;e.bindFramebuffer(i.FRAMEBUFFER,yt.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+ft,i.TEXTURE_2D,Xt,0)}e.bindFramebuffer(i.DRAW_FRAMEBUFFER,yt.__webglMultisampledFramebuffer)}else if(T.depthBuffer&&T.resolveDepthBuffer===!1&&l){const _=T.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[_])}}}function Vt(T){return Math.min(s.maxSamples,T.samples)}function Wt(T){const _=n.get(T);return T.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&_.__useRenderToTexture!==!1}function Et(T){const _=a.render.frame;h.get(T)!==_&&(h.set(T,_),T.update())}function le(T,_){const F=T.colorSpace,q=T.format,Z=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||F!==Hi&&F!==Fn&&($t.getTransfer(F)===se?(q!==rn||Z!==wn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",F)),_}function St(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=z,this.resetTextureUnits=W,this.setTexture2D=K,this.setTexture2DArray=G,this.setTexture3D=$,this.setTextureCube=H,this.rebindTextures=Tt,this.setupRenderTarget=qt,this.updateRenderTargetMipmap=Ht,this.updateMultisampleRenderTarget=_e,this.setupDepthRenderbuffer=it,this.setupFrameBufferTexture=vt,this.useMultisampledRTT=Wt}function Om(i,t){function e(n,s=Fn){let r;const a=$t.getTransfer(s);if(n===wn)return i.UNSIGNED_BYTE;if(n===Ga)return i.UNSIGNED_SHORT_4_4_4_4;if(n===Wa)return i.UNSIGNED_SHORT_5_5_5_1;if(n===zl)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===Ol)return i.BYTE;if(n===Bl)return i.SHORT;if(n===ss)return i.UNSIGNED_SHORT;if(n===Va)return i.INT;if(n===ei)return i.UNSIGNED_INT;if(n===dn)return i.FLOAT;if(n===bn)return i.HALF_FLOAT;if(n===Hl)return i.ALPHA;if(n===kl)return i.RGB;if(n===rn)return i.RGBA;if(n===Vl)return i.LUMINANCE;if(n===Gl)return i.LUMINANCE_ALPHA;if(n===Ui)return i.DEPTH_COMPONENT;if(n===zi)return i.DEPTH_STENCIL;if(n===Xa)return i.RED;if(n===Ya)return i.RED_INTEGER;if(n===Wl)return i.RG;if(n===qa)return i.RG_INTEGER;if(n===ja)return i.RGBA_INTEGER;if(n===ks||n===Vs||n===Gs||n===Ws)if(a===se)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===ks)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Vs)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Gs)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ws)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===ks)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Vs)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Gs)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ws)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===la||n===ca||n===ha||n===ua)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===la)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===ca)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===ha)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ua)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===da||n===fa||n===pa)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(n===da||n===fa)return a===se?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===pa)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===ma||n===_a||n===ga||n===va||n===xa||n===Ma||n===Sa||n===ya||n===Ea||n===Ta||n===ba||n===Aa||n===wa||n===Ra)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(n===ma)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===_a)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===ga)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===va)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===xa)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Ma)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Sa)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===ya)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Ea)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ta)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ba)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Aa)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===wa)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Ra)return a===se?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Xs||n===Ca||n===Pa)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(n===Xs)return a===se?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Ca)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Pa)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Xl||n===Da||n===La||n===Ua)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(n===Xs)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Da)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===La)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Ua)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Bi?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:e}}const Bm={type:"move"};class Xr{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ci,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 Ci,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ci,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let s=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(const x of t.hand.values()){const p=e.getJointPose(x,n),u=this._getHandJoint(c,x);p!==null&&(u.matrix.fromArray(p.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,u.jointRadius=p.radius),u.visible=p!==null}const h=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=h.position.distanceTo(d.position),m=.02,g=.005;c.inputState.pinching&&f>m+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=m-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(s=e.getPose(t.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Bm)))}return o!==null&&(o.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const n=new Ci;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}const zm=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,Hm=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class km{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){const s=new Ce,r=t.properties.get(s);r.__webglTexture=e.texture,(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,n=new Ie({vertexShader:zm,fragmentShader:Hm,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new ye(new os(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Vm extends ii{constructor(t,e){super();const n=this;let s=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,d=null,f=null,m=null,g=null;const x=new km,p=e.getContextAttributes();let u=null,b=null;const E=[],S=[],D=new gt;let A=null;const w=new We;w.viewport=new oe;const N=new We;N.viewport=new oe;const y=[w,N],M=new ru;let C=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let et=E[Y];return et===void 0&&(et=new Xr,E[Y]=et),et.getTargetRaySpace()},this.getControllerGrip=function(Y){let et=E[Y];return et===void 0&&(et=new Xr,E[Y]=et),et.getGripSpace()},this.getHand=function(Y){let et=E[Y];return et===void 0&&(et=new Xr,E[Y]=et),et.getHandSpace()};function z(Y){const et=S.indexOf(Y.inputSource);if(et===-1)return;const vt=E[et];vt!==void 0&&(vt.update(Y.inputSource,Y.frame,c||a),vt.dispatchEvent({type:Y.type,data:Y.inputSource}))}function V(){s.removeEventListener("select",z),s.removeEventListener("selectstart",z),s.removeEventListener("selectend",z),s.removeEventListener("squeeze",z),s.removeEventListener("squeezestart",z),s.removeEventListener("squeezeend",z),s.removeEventListener("end",V),s.removeEventListener("inputsourceschange",K);for(let Y=0;Y=0&&(S[lt]=null,E[lt].disconnect(vt))}for(let et=0;et=S.length){S.push(vt),lt=it;break}else if(S[it]===null){S[it]=vt,lt=it;break}if(lt===-1)break}const Rt=E[lt];Rt&&Rt.connect(vt)}}const G=new P,$=new P;function H(Y,et,vt){G.setFromMatrixPosition(et.matrixWorld),$.setFromMatrixPosition(vt.matrixWorld);const lt=G.distanceTo($),Rt=et.projectionMatrix.elements,it=vt.projectionMatrix.elements,Tt=Rt[14]/(Rt[10]-1),qt=Rt[14]/(Rt[10]+1),Ht=(Rt[9]+1)/Rt[5],Jt=(Rt[9]-1)/Rt[5],R=(Rt[8]-1)/Rt[0],_e=(it[8]+1)/it[0],Vt=Tt*R,Wt=Tt*_e,Et=lt/(-R+_e),le=Et*-R;if(et.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(le),Y.translateZ(Et),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Rt[10]===-1)Y.projectionMatrix.copy(et.projectionMatrix),Y.projectionMatrixInverse.copy(et.projectionMatrixInverse);else{const St=Tt+Et,T=qt+Et,_=Vt-le,F=Wt+(lt-le),q=Ht*qt/T*St,Z=Jt*qt/T*St;Y.projectionMatrix.makePerspective(_,F,q,Z,St,T),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function nt(Y,et){et===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(et.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(s===null)return;let et=Y.near,vt=Y.far;x.texture!==null&&(x.depthNear>0&&(et=x.depthNear),x.depthFar>0&&(vt=x.depthFar)),M.near=N.near=w.near=et,M.far=N.far=w.far=vt,(C!==M.near||W!==M.far)&&(s.updateRenderState({depthNear:M.near,depthFar:M.far}),C=M.near,W=M.far),w.layers.mask=Y.layers.mask|2,N.layers.mask=Y.layers.mask|4,M.layers.mask=w.layers.mask|N.layers.mask;const lt=Y.parent,Rt=M.cameras;nt(M,lt);for(let it=0;it0&&(p.alphaTest.value=u.alphaTest);const b=t.get(u),E=b.envMap,S=b.envMapRotation;E&&(p.envMap.value=E,jn.copy(S),jn.x*=-1,jn.y*=-1,jn.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(jn.y*=-1,jn.z*=-1),p.envMapRotation.value.setFromMatrix4(Gm.makeRotationFromEuler(jn)),p.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=u.reflectivity,p.ior.value=u.ior,p.refractionRatio.value=u.refractionRatio),u.lightMap&&(p.lightMap.value=u.lightMap,p.lightMapIntensity.value=u.lightMapIntensity,e(u.lightMap,p.lightMapTransform)),u.aoMap&&(p.aoMap.value=u.aoMap,p.aoMapIntensity.value=u.aoMapIntensity,e(u.aoMap,p.aoMapTransform))}function a(p,u){p.diffuse.value.copy(u.color),p.opacity.value=u.opacity,u.map&&(p.map.value=u.map,e(u.map,p.mapTransform))}function o(p,u){p.dashSize.value=u.dashSize,p.totalSize.value=u.dashSize+u.gapSize,p.scale.value=u.scale}function l(p,u,b,E){p.diffuse.value.copy(u.color),p.opacity.value=u.opacity,p.size.value=u.size*b,p.scale.value=E*.5,u.map&&(p.map.value=u.map,e(u.map,p.uvTransform)),u.alphaMap&&(p.alphaMap.value=u.alphaMap,e(u.alphaMap,p.alphaMapTransform)),u.alphaTest>0&&(p.alphaTest.value=u.alphaTest)}function c(p,u){p.diffuse.value.copy(u.color),p.opacity.value=u.opacity,p.rotation.value=u.rotation,u.map&&(p.map.value=u.map,e(u.map,p.mapTransform)),u.alphaMap&&(p.alphaMap.value=u.alphaMap,e(u.alphaMap,p.alphaMapTransform)),u.alphaTest>0&&(p.alphaTest.value=u.alphaTest)}function h(p,u){p.specular.value.copy(u.specular),p.shininess.value=Math.max(u.shininess,1e-4)}function d(p,u){u.gradientMap&&(p.gradientMap.value=u.gradientMap)}function f(p,u){p.metalness.value=u.metalness,u.metalnessMap&&(p.metalnessMap.value=u.metalnessMap,e(u.metalnessMap,p.metalnessMapTransform)),p.roughness.value=u.roughness,u.roughnessMap&&(p.roughnessMap.value=u.roughnessMap,e(u.roughnessMap,p.roughnessMapTransform)),u.envMap&&(p.envMapIntensity.value=u.envMapIntensity)}function m(p,u,b){p.ior.value=u.ior,u.sheen>0&&(p.sheenColor.value.copy(u.sheenColor).multiplyScalar(u.sheen),p.sheenRoughness.value=u.sheenRoughness,u.sheenColorMap&&(p.sheenColorMap.value=u.sheenColorMap,e(u.sheenColorMap,p.sheenColorMapTransform)),u.sheenRoughnessMap&&(p.sheenRoughnessMap.value=u.sheenRoughnessMap,e(u.sheenRoughnessMap,p.sheenRoughnessMapTransform))),u.clearcoat>0&&(p.clearcoat.value=u.clearcoat,p.clearcoatRoughness.value=u.clearcoatRoughness,u.clearcoatMap&&(p.clearcoatMap.value=u.clearcoatMap,e(u.clearcoatMap,p.clearcoatMapTransform)),u.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap,e(u.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),u.clearcoatNormalMap&&(p.clearcoatNormalMap.value=u.clearcoatNormalMap,e(u.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),u.side===Be&&p.clearcoatNormalScale.value.negate())),u.dispersion>0&&(p.dispersion.value=u.dispersion),u.iridescence>0&&(p.iridescence.value=u.iridescence,p.iridescenceIOR.value=u.iridescenceIOR,p.iridescenceThicknessMinimum.value=u.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=u.iridescenceThicknessRange[1],u.iridescenceMap&&(p.iridescenceMap.value=u.iridescenceMap,e(u.iridescenceMap,p.iridescenceMapTransform)),u.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=u.iridescenceThicknessMap,e(u.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),u.transmission>0&&(p.transmission.value=u.transmission,p.transmissionSamplerMap.value=b.texture,p.transmissionSamplerSize.value.set(b.width,b.height),u.transmissionMap&&(p.transmissionMap.value=u.transmissionMap,e(u.transmissionMap,p.transmissionMapTransform)),p.thickness.value=u.thickness,u.thicknessMap&&(p.thicknessMap.value=u.thicknessMap,e(u.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=u.attenuationDistance,p.attenuationColor.value.copy(u.attenuationColor)),u.anisotropy>0&&(p.anisotropyVector.value.set(u.anisotropy*Math.cos(u.anisotropyRotation),u.anisotropy*Math.sin(u.anisotropyRotation)),u.anisotropyMap&&(p.anisotropyMap.value=u.anisotropyMap,e(u.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=u.specularIntensity,p.specularColor.value.copy(u.specularColor),u.specularColorMap&&(p.specularColorMap.value=u.specularColorMap,e(u.specularColorMap,p.specularColorMapTransform)),u.specularIntensityMap&&(p.specularIntensityMap.value=u.specularIntensityMap,e(u.specularIntensityMap,p.specularIntensityMapTransform))}function g(p,u){u.matcap&&(p.matcap.value=u.matcap)}function x(p,u){const b=t.get(u).light;p.referencePosition.value.setFromMatrixPosition(b.matrixWorld),p.nearDistance.value=b.shadow.camera.near,p.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function Xm(i,t,e,n){let s={},r={},a=[];const o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,E){const S=E.program;n.uniformBlockBinding(b,S)}function c(b,E){let S=s[b.id];S===void 0&&(g(b),S=h(b),s[b.id]=S,b.addEventListener("dispose",p));const D=E.program;n.updateUBOMapping(b,D);const A=t.render.frame;r[b.id]!==A&&(f(b),r[b.id]=A)}function h(b){const E=d();b.__bindingPointIndex=E;const S=i.createBuffer(),D=b.__size,A=b.usage;return i.bindBuffer(i.UNIFORM_BUFFER,S),i.bufferData(i.UNIFORM_BUFFER,D,A),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,E,S),S}function d(){for(let b=0;b0&&(S+=D-A),b.__size=S,b.__cache={},this}function x(b){const E={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(E.boundary=4,E.storage=4):b.isVector2?(E.boundary=8,E.storage=8):b.isVector3||b.isColor?(E.boundary=16,E.storage=12):b.isVector4?(E.boundary=16,E.storage=16):b.isMatrix3?(E.boundary=48,E.storage=48):b.isMatrix4?(E.boundary=64,E.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),E}function p(b){const E=b.target;E.removeEventListener("dispose",p);const S=a.indexOf(E.__bindingPointIndex);a.splice(S,1),i.deleteBuffer(s[E.id]),delete s[E.id],delete r[E.id]}function u(){for(const b in s)i.deleteBuffer(s[b]);a=[],s={},r={}}return{bind:l,update:c,dispose:u}}class Ym{constructor(t={}){const{canvas:e=Mh(),context:n=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=t;this.isWebGLRenderer=!0;let m;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");m=n.getContextAttributes().alpha}else m=a;const g=new Uint32Array(4),x=new Int32Array(4);let p=null,u=null;const b=[],E=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=$e,this.toneMapping=On,this.toneMappingExposure=1;const S=this;let D=!1,A=0,w=0,N=null,y=-1,M=null;const C=new oe,W=new oe;let z=null;const V=new xt(0);let K=0,G=e.width,$=e.height,H=1,nt=null,dt=null;const Mt=new oe(0,0,G,$),Ft=new oe(0,0,G,$);let Yt=!1;const Y=new Ka;let et=!1,vt=!1;this.transmissionResolutionScale=1;const lt=new ee,Rt=new ee,it=new P,Tt=new oe,qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ht=!1;function Jt(){return N===null?H:1}let R=n;function _e(v,U){return e.getContext(v,U)}try{const v={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${ka}`),e.addEventListener("webglcontextlost",j,!1),e.addEventListener("webglcontextrestored",ct,!1),e.addEventListener("webglcontextcreationerror",ht,!1),R===null){const U="webgl2";if(R=_e(U,v),R===null)throw _e(U)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(v){throw console.error("THREE.WebGLRenderer: "+v.message),v}let Vt,Wt,Et,le,St,T,_,F,q,Z,X,yt,at,ft,Xt,Q,pt,bt,Lt,st,Dt,Ct,jt,L;function ot(){Vt=new ep(R),Vt.init(),Ct=new Om(R,Vt),Wt=new Zf(R,Vt,t,Ct),Et=new Nm(R,Vt),Wt.reverseDepthBuffer&&f&&Et.buffers.depth.setReversed(!0),le=new sp(R),St=new ym,T=new Fm(R,Vt,Et,St,Wt,Ct,le),_=new $f(S),F=new tp(S),q=new hu(R),jt=new qf(R,q),Z=new np(R,q,le,jt),X=new ap(R,Z,q,le),Lt=new rp(R,Wt,T),Q=new Kf(St),yt=new Sm(S,_,F,Vt,Wt,jt,Q),at=new Wm(S,St),ft=new Tm,Xt=new Pm(Vt),bt=new Yf(S,_,F,Et,X,m,l),pt=new Um(S,X,Wt),L=new Xm(R,le,Wt,Et),st=new jf(R,Vt,le),Dt=new ip(R,Vt,le),le.programs=yt.programs,S.capabilities=Wt,S.extensions=Vt,S.properties=St,S.renderLists=ft,S.shadowMap=pt,S.state=Et,S.info=le}ot();const k=new Vm(S,R);this.xr=k,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){const v=Vt.get("WEBGL_lose_context");v&&v.loseContext()},this.forceContextRestore=function(){const v=Vt.get("WEBGL_lose_context");v&&v.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(v){v!==void 0&&(H=v,this.setSize(G,$,!1))},this.getSize=function(v){return v.set(G,$)},this.setSize=function(v,U,O=!0){if(k.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}G=v,$=U,e.width=Math.floor(v*H),e.height=Math.floor(U*H),O===!0&&(e.style.width=v+"px",e.style.height=U+"px"),this.setViewport(0,0,v,U)},this.getDrawingBufferSize=function(v){return v.set(G*H,$*H).floor()},this.setDrawingBufferSize=function(v,U,O){G=v,$=U,H=O,e.width=Math.floor(v*O),e.height=Math.floor(U*O),this.setViewport(0,0,v,U)},this.getCurrentViewport=function(v){return v.copy(C)},this.getViewport=function(v){return v.copy(Mt)},this.setViewport=function(v,U,O,B){v.isVector4?Mt.set(v.x,v.y,v.z,v.w):Mt.set(v,U,O,B),Et.viewport(C.copy(Mt).multiplyScalar(H).round())},this.getScissor=function(v){return v.copy(Ft)},this.setScissor=function(v,U,O,B){v.isVector4?Ft.set(v.x,v.y,v.z,v.w):Ft.set(v,U,O,B),Et.scissor(W.copy(Ft).multiplyScalar(H).round())},this.getScissorTest=function(){return Yt},this.setScissorTest=function(v){Et.setScissorTest(Yt=v)},this.setOpaqueSort=function(v){nt=v},this.setTransparentSort=function(v){dt=v},this.getClearColor=function(v){return v.copy(bt.getClearColor())},this.setClearColor=function(){bt.setClearColor.apply(bt,arguments)},this.getClearAlpha=function(){return bt.getClearAlpha()},this.setClearAlpha=function(){bt.setClearAlpha.apply(bt,arguments)},this.clear=function(v=!0,U=!0,O=!0){let B=0;if(v){let I=!1;if(N!==null){const J=N.texture.format;I=J===ja||J===qa||J===Ya}if(I){const J=N.texture.type,ut=J===wn||J===ei||J===ss||J===Bi||J===Ga||J===Wa,mt=bt.getClearColor(),_t=bt.getClearAlpha(),It=mt.r,Nt=mt.g,At=mt.b;ut?(g[0]=It,g[1]=Nt,g[2]=At,g[3]=_t,R.clearBufferuiv(R.COLOR,0,g)):(x[0]=It,x[1]=Nt,x[2]=At,x[3]=_t,R.clearBufferiv(R.COLOR,0,x))}else B|=R.COLOR_BUFFER_BIT}U&&(B|=R.DEPTH_BUFFER_BIT),O&&(B|=R.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),R.clear(B)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",j,!1),e.removeEventListener("webglcontextrestored",ct,!1),e.removeEventListener("webglcontextcreationerror",ht,!1),bt.dispose(),ft.dispose(),Xt.dispose(),St.dispose(),_.dispose(),F.dispose(),X.dispose(),jt.dispose(),L.dispose(),yt.dispose(),k.dispose(),k.removeEventListener("sessionstart",no),k.removeEventListener("sessionend",io),kn.stop()};function j(v){v.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),D=!0}function ct(){console.log("THREE.WebGLRenderer: Context Restored."),D=!1;const v=le.autoReset,U=pt.enabled,O=pt.autoUpdate,B=pt.needsUpdate,I=pt.type;ot(),le.autoReset=v,pt.enabled=U,pt.autoUpdate=O,pt.needsUpdate=B,pt.type=I}function ht(v){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",v.statusMessage)}function Ot(v){const U=v.target;U.removeEventListener("dispose",Ot),he(U)}function he(v){Ae(v),St.remove(v)}function Ae(v){const U=St.get(v).programs;U!==void 0&&(U.forEach(function(O){yt.releaseProgram(O)}),v.isShaderMaterial&&yt.releaseShaderCache(v))}this.renderBufferDirect=function(v,U,O,B,I,J){U===null&&(U=qt);const ut=I.isMesh&&I.matrixWorld.determinant()<0,mt=_c(v,U,O,B,I);Et.setMaterial(B,ut);let _t=O.index,It=1;if(B.wireframe===!0){if(_t=Z.getWireframeAttribute(O),_t===void 0)return;It=2}const Nt=O.drawRange,At=O.attributes.position;let Zt=Nt.start*It,Qt=(Nt.start+Nt.count)*It;J!==null&&(Zt=Math.max(Zt,J.start*It),Qt=Math.min(Qt,(J.start+J.count)*It)),_t!==null?(Zt=Math.max(Zt,0),Qt=Math.min(Qt,_t.count)):At!=null&&(Zt=Math.max(Zt,0),Qt=Math.min(Qt,At.count));const fe=Qt-Zt;if(fe<0||fe===1/0)return;jt.setup(I,B,mt,O,_t);let ue,Kt=st;if(_t!==null&&(ue=q.get(_t),Kt=Dt,Kt.setIndex(ue)),I.isMesh)B.wireframe===!0?(Et.setLineWidth(B.wireframeLinewidth*Jt()),Kt.setMode(R.LINES)):Kt.setMode(R.TRIANGLES);else if(I.isLine){let wt=B.linewidth;wt===void 0&&(wt=1),Et.setLineWidth(wt*Jt()),I.isLineSegments?Kt.setMode(R.LINES):I.isLineLoop?Kt.setMode(R.LINE_LOOP):Kt.setMode(R.LINE_STRIP)}else I.isPoints?Kt.setMode(R.POINTS):I.isSprite&&Kt.setMode(R.TRIANGLES);if(I.isBatchedMesh)if(I._multiDrawInstances!==null)Kt.renderMultiDrawInstances(I._multiDrawStarts,I._multiDrawCounts,I._multiDrawCount,I._multiDrawInstances);else if(Vt.get("WEBGL_multi_draw"))Kt.renderMultiDraw(I._multiDrawStarts,I._multiDrawCounts,I._multiDrawCount);else{const wt=I._multiDrawStarts,Te=I._multiDrawCounts,te=I._multiDrawCount,tn=_t?q.get(_t).bytesPerElement:1,ai=St.get(B).currentProgram.getUniforms();for(let ze=0;ze{function J(){if(B.forEach(function(ut){St.get(ut).currentProgram.isReady()&&B.delete(ut)}),B.size===0){I(v);return}setTimeout(J,10)}Vt.get("KHR_parallel_shader_compile")!==null?J():setTimeout(J,10)})};let Qe=null;function mn(v){Qe&&Qe(v)}function no(){kn.stop()}function io(){kn.start()}const kn=new lc;kn.setAnimationLoop(mn),typeof self<"u"&&kn.setContext(self),this.setAnimationLoop=function(v){Qe=v,k.setAnimationLoop(v),v===null?kn.stop():kn.start()},k.addEventListener("sessionstart",no),k.addEventListener("sessionend",io),this.render=function(v,U){if(U!==void 0&&U.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(D===!0)return;if(v.matrixWorldAutoUpdate===!0&&v.updateMatrixWorld(),U.parent===null&&U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),k.enabled===!0&&k.isPresenting===!0&&(k.cameraAutoUpdate===!0&&k.updateCamera(U),U=k.getCamera()),v.isScene===!0&&v.onBeforeRender(S,v,U,N),u=Xt.get(v,E.length),u.init(U),E.push(u),Rt.multiplyMatrices(U.projectionMatrix,U.matrixWorldInverse),Y.setFromProjectionMatrix(Rt),vt=this.localClippingEnabled,et=Q.init(this.clippingPlanes,vt),p=ft.get(v,b.length),p.init(),b.push(p),k.enabled===!0&&k.isPresenting===!0){const J=S.xr.getDepthSensingMesh();J!==null&&hr(J,U,-1/0,S.sortObjects)}hr(v,U,0,S.sortObjects),p.finish(),S.sortObjects===!0&&p.sort(nt,dt),Ht=k.enabled===!1||k.isPresenting===!1||k.hasDepthSensing()===!1,Ht&&bt.addToRenderList(p,v),this.info.render.frame++,et===!0&&Q.beginShadows();const O=u.state.shadowsArray;pt.render(O,v,U),et===!0&&Q.endShadows(),this.info.autoReset===!0&&this.info.reset();const B=p.opaque,I=p.transmissive;if(u.setupLights(),U.isArrayCamera){const J=U.cameras;if(I.length>0)for(let ut=0,mt=J.length;ut0&&ro(B,I,v,U),Ht&&bt.render(v),so(p,v,U);N!==null&&w===0&&(T.updateMultisampleRenderTarget(N),T.updateRenderTargetMipmap(N)),v.isScene===!0&&v.onAfterRender(S,v,U),jt.resetDefaultState(),y=-1,M=null,E.pop(),E.length>0?(u=E[E.length-1],et===!0&&Q.setGlobalState(S.clippingPlanes,u.state.camera)):u=null,b.pop(),b.length>0?p=b[b.length-1]:p=null};function hr(v,U,O,B){if(v.visible===!1)return;if(v.layers.test(U.layers)){if(v.isGroup)O=v.renderOrder;else if(v.isLOD)v.autoUpdate===!0&&v.update(U);else if(v.isLight)u.pushLight(v),v.castShadow&&u.pushShadow(v);else if(v.isSprite){if(!v.frustumCulled||Y.intersectsSprite(v)){B&&Tt.setFromMatrixPosition(v.matrixWorld).applyMatrix4(Rt);const ut=X.update(v),mt=v.material;mt.visible&&p.push(v,ut,mt,O,Tt.z,null)}}else if((v.isMesh||v.isLine||v.isPoints)&&(!v.frustumCulled||Y.intersectsObject(v))){const ut=X.update(v),mt=v.material;if(B&&(v.boundingSphere!==void 0?(v.boundingSphere===null&&v.computeBoundingSphere(),Tt.copy(v.boundingSphere.center)):(ut.boundingSphere===null&&ut.computeBoundingSphere(),Tt.copy(ut.boundingSphere.center)),Tt.applyMatrix4(v.matrixWorld).applyMatrix4(Rt)),Array.isArray(mt)){const _t=ut.groups;for(let It=0,Nt=_t.length;It0&&cs(I,U,O),J.length>0&&cs(J,U,O),ut.length>0&&cs(ut,U,O),Et.buffers.depth.setTest(!0),Et.buffers.depth.setMask(!0),Et.buffers.color.setMask(!0),Et.setPolygonOffset(!1)}function ro(v,U,O,B){if((O.isScene===!0?O.overrideMaterial:null)!==null)return;u.state.transmissionRenderTarget[B.id]===void 0&&(u.state.transmissionRenderTarget[B.id]=new an(1,1,{generateMipmaps:!0,type:Vt.has("EXT_color_buffer_half_float")||Vt.has("EXT_color_buffer_float")?bn:wn,minFilter:Qn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:$t.workingColorSpace}));const J=u.state.transmissionRenderTarget[B.id],ut=B.viewport||C;J.setSize(ut.z*S.transmissionResolutionScale,ut.w*S.transmissionResolutionScale);const mt=S.getRenderTarget();S.setRenderTarget(J),S.getClearColor(V),K=S.getClearAlpha(),K<1&&S.setClearColor(16777215,.5),S.clear(),Ht&&bt.render(O);const _t=S.toneMapping;S.toneMapping=On;const It=B.viewport;if(B.viewport!==void 0&&(B.viewport=void 0),u.setupLightsView(B),et===!0&&Q.setGlobalState(S.clippingPlanes,B),cs(v,O,B),T.updateMultisampleRenderTarget(J),T.updateRenderTargetMipmap(J),Vt.has("WEBGL_multisampled_render_to_texture")===!1){let Nt=!1;for(let At=0,Zt=U.length;At0),At=!!O.morphAttributes.position,Zt=!!O.morphAttributes.normal,Qt=!!O.morphAttributes.color;let fe=On;B.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(fe=S.toneMapping);const ue=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,Kt=ue!==void 0?ue.length:0,wt=St.get(B),Te=u.state.lights;if(et===!0&&(vt===!0||v!==M)){const De=v===M&&B.id===y;Q.setState(B,v,De)}let te=!1;B.version===wt.__version?(wt.needsLights&&wt.lightsStateVersion!==Te.state.version||wt.outputColorSpace!==mt||I.isBatchedMesh&&wt.batching===!1||!I.isBatchedMesh&&wt.batching===!0||I.isBatchedMesh&&wt.batchingColor===!0&&I.colorTexture===null||I.isBatchedMesh&&wt.batchingColor===!1&&I.colorTexture!==null||I.isInstancedMesh&&wt.instancing===!1||!I.isInstancedMesh&&wt.instancing===!0||I.isSkinnedMesh&&wt.skinning===!1||!I.isSkinnedMesh&&wt.skinning===!0||I.isInstancedMesh&&wt.instancingColor===!0&&I.instanceColor===null||I.isInstancedMesh&&wt.instancingColor===!1&&I.instanceColor!==null||I.isInstancedMesh&&wt.instancingMorph===!0&&I.morphTexture===null||I.isInstancedMesh&&wt.instancingMorph===!1&&I.morphTexture!==null||wt.envMap!==_t||B.fog===!0&&wt.fog!==J||wt.numClippingPlanes!==void 0&&(wt.numClippingPlanes!==Q.numPlanes||wt.numIntersection!==Q.numIntersection)||wt.vertexAlphas!==It||wt.vertexTangents!==Nt||wt.morphTargets!==At||wt.morphNormals!==Zt||wt.morphColors!==Qt||wt.toneMapping!==fe||wt.morphTargetsCount!==Kt)&&(te=!0):(te=!0,wt.__version=B.version);let tn=wt.currentProgram;te===!0&&(tn=hs(B,U,I));let ai=!1,ze=!1,Wi=!1;const ce=tn.getUniforms(),qe=wt.uniforms;if(Et.useProgram(tn.program)&&(ai=!0,ze=!0,Wi=!0),B.id!==y&&(y=B.id,ze=!0),ai||M!==v){Et.buffers.depth.getReversed()?(lt.copy(v.projectionMatrix),yh(lt),Eh(lt),ce.setValue(R,"projectionMatrix",lt)):ce.setValue(R,"projectionMatrix",v.projectionMatrix),ce.setValue(R,"viewMatrix",v.matrixWorldInverse);const Ne=ce.map.cameraPosition;Ne!==void 0&&Ne.setValue(R,it.setFromMatrixPosition(v.matrixWorld)),Wt.logarithmicDepthBuffer&&ce.setValue(R,"logDepthBufFC",2/(Math.log(v.far+1)/Math.LN2)),(B.isMeshPhongMaterial||B.isMeshToonMaterial||B.isMeshLambertMaterial||B.isMeshBasicMaterial||B.isMeshStandardMaterial||B.isShaderMaterial)&&ce.setValue(R,"isOrthographic",v.isOrthographicCamera===!0),M!==v&&(M=v,ze=!0,Wi=!0)}if(I.isSkinnedMesh){ce.setOptional(R,I,"bindMatrix"),ce.setOptional(R,I,"bindMatrixInverse");const De=I.skeleton;De&&(De.boneTexture===null&&De.computeBoneTexture(),ce.setValue(R,"boneTexture",De.boneTexture,T))}I.isBatchedMesh&&(ce.setOptional(R,I,"batchingTexture"),ce.setValue(R,"batchingTexture",I._matricesTexture,T),ce.setOptional(R,I,"batchingIdTexture"),ce.setValue(R,"batchingIdTexture",I._indirectTexture,T),ce.setOptional(R,I,"batchingColorTexture"),I._colorsTexture!==null&&ce.setValue(R,"batchingColorTexture",I._colorsTexture,T));const je=O.morphAttributes;if((je.position!==void 0||je.normal!==void 0||je.color!==void 0)&&Lt.update(I,O,tn),(ze||wt.receiveShadow!==I.receiveShadow)&&(wt.receiveShadow=I.receiveShadow,ce.setValue(R,"receiveShadow",I.receiveShadow)),B.isMeshGouraudMaterial&&B.envMap!==null&&(qe.envMap.value=_t,qe.flipEnvMap.value=_t.isCubeTexture&&_t.isRenderTargetTexture===!1?-1:1),B.isMeshStandardMaterial&&B.envMap===null&&U.environment!==null&&(qe.envMapIntensity.value=U.environmentIntensity),ze&&(ce.setValue(R,"toneMappingExposure",S.toneMappingExposure),wt.needsLights&&gc(qe,Wi),J&&B.fog===!0&&at.refreshFogUniforms(qe,J),at.refreshMaterialUniforms(qe,B,H,$,u.state.transmissionRenderTarget[v.id]),qs.upload(R,oo(wt),qe,T)),B.isShaderMaterial&&B.uniformsNeedUpdate===!0&&(qs.upload(R,oo(wt),qe,T),B.uniformsNeedUpdate=!1),B.isSpriteMaterial&&ce.setValue(R,"center",I.center),ce.setValue(R,"modelViewMatrix",I.modelViewMatrix),ce.setValue(R,"normalMatrix",I.normalMatrix),ce.setValue(R,"modelMatrix",I.matrixWorld),B.isShaderMaterial||B.isRawShaderMaterial){const De=B.uniformsGroups;for(let Ne=0,ur=De.length;Ne0&&T.useMultisampledRTT(v)===!1?I=St.get(v).__webglMultisampledFramebuffer:Array.isArray(Nt)?I=Nt[O]:I=Nt,C.copy(v.viewport),W.copy(v.scissor),z=v.scissorTest}else C.copy(Mt).multiplyScalar(H).floor(),W.copy(Ft).multiplyScalar(H).floor(),z=Yt;if(O!==0&&(I=xc),Et.bindFramebuffer(R.FRAMEBUFFER,I)&&B&&Et.drawBuffers(v,I),Et.viewport(C),Et.scissor(W),Et.setScissorTest(z),J){const _t=St.get(v.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_CUBE_MAP_POSITIVE_X+U,_t.__webglTexture,O)}else if(ut){const _t=St.get(v.texture),It=U;R.framebufferTextureLayer(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,_t.__webglTexture,O,It)}else if(v!==null&&O!==0){const _t=St.get(v.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,_t.__webglTexture,O)}y=-1},this.readRenderTargetPixels=function(v,U,O,B,I,J,ut){if(!(v&&v.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let mt=St.get(v).__webglFramebuffer;if(v.isWebGLCubeRenderTarget&&ut!==void 0&&(mt=mt[ut]),mt){Et.bindFramebuffer(R.FRAMEBUFFER,mt);try{const _t=v.texture,It=_t.format,Nt=_t.type;if(!Wt.textureFormatReadable(It)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Wt.textureTypeReadable(Nt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}U>=0&&U<=v.width-B&&O>=0&&O<=v.height-I&&R.readPixels(U,O,B,I,Ct.convert(It),Ct.convert(Nt),J)}finally{const _t=N!==null?St.get(N).__webglFramebuffer:null;Et.bindFramebuffer(R.FRAMEBUFFER,_t)}}},this.readRenderTargetPixelsAsync=async function(v,U,O,B,I,J,ut){if(!(v&&v.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let mt=St.get(v).__webglFramebuffer;if(v.isWebGLCubeRenderTarget&&ut!==void 0&&(mt=mt[ut]),mt){const _t=v.texture,It=_t.format,Nt=_t.type;if(!Wt.textureFormatReadable(It))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Wt.textureTypeReadable(Nt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(U>=0&&U<=v.width-B&&O>=0&&O<=v.height-I){Et.bindFramebuffer(R.FRAMEBUFFER,mt);const At=R.createBuffer();R.bindBuffer(R.PIXEL_PACK_BUFFER,At),R.bufferData(R.PIXEL_PACK_BUFFER,J.byteLength,R.STREAM_READ),R.readPixels(U,O,B,I,Ct.convert(It),Ct.convert(Nt),0);const Zt=N!==null?St.get(N).__webglFramebuffer:null;Et.bindFramebuffer(R.FRAMEBUFFER,Zt);const Qt=R.fenceSync(R.SYNC_GPU_COMMANDS_COMPLETE,0);return R.flush(),await Sh(R,Qt,4),R.bindBuffer(R.PIXEL_PACK_BUFFER,At),R.getBufferSubData(R.PIXEL_PACK_BUFFER,0,J),R.deleteBuffer(At),R.deleteSync(Qt),J}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(v,U=null,O=0){v.isTexture!==!0&&(wi("WebGLRenderer: copyFramebufferToTexture function signature has changed."),U=arguments[0]||null,v=arguments[1]);const B=Math.pow(2,-O),I=Math.floor(v.image.width*B),J=Math.floor(v.image.height*B),ut=U!==null?U.x:0,mt=U!==null?U.y:0;T.setTexture2D(v,0),R.copyTexSubImage2D(R.TEXTURE_2D,O,0,0,ut,mt,I,J),Et.unbindTexture()};const Mc=R.createFramebuffer(),Sc=R.createFramebuffer();this.copyTextureToTexture=function(v,U,O=null,B=null,I=0,J=null){v.isTexture!==!0&&(wi("WebGLRenderer: copyTextureToTexture function signature has changed."),B=arguments[0]||null,v=arguments[1],U=arguments[2],J=arguments[3]||0,O=null),J===null&&(I!==0?(wi("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),J=I,I=0):J=0);let ut,mt,_t,It,Nt,At,Zt,Qt,fe;const ue=v.isCompressedTexture?v.mipmaps[J]:v.image;if(O!==null)ut=O.max.x-O.min.x,mt=O.max.y-O.min.y,_t=O.isBox3?O.max.z-O.min.z:1,It=O.min.x,Nt=O.min.y,At=O.isBox3?O.min.z:0;else{const je=Math.pow(2,-I);ut=Math.floor(ue.width*je),mt=Math.floor(ue.height*je),v.isDataArrayTexture?_t=ue.depth:v.isData3DTexture?_t=Math.floor(ue.depth*je):_t=1,It=0,Nt=0,At=0}B!==null?(Zt=B.x,Qt=B.y,fe=B.z):(Zt=0,Qt=0,fe=0);const Kt=Ct.convert(U.format),wt=Ct.convert(U.type);let Te;U.isData3DTexture?(T.setTexture3D(U,0),Te=R.TEXTURE_3D):U.isDataArrayTexture||U.isCompressedArrayTexture?(T.setTexture2DArray(U,0),Te=R.TEXTURE_2D_ARRAY):(T.setTexture2D(U,0),Te=R.TEXTURE_2D),R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,U.flipY),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),R.pixelStorei(R.UNPACK_ALIGNMENT,U.unpackAlignment);const te=R.getParameter(R.UNPACK_ROW_LENGTH),tn=R.getParameter(R.UNPACK_IMAGE_HEIGHT),ai=R.getParameter(R.UNPACK_SKIP_PIXELS),ze=R.getParameter(R.UNPACK_SKIP_ROWS),Wi=R.getParameter(R.UNPACK_SKIP_IMAGES);R.pixelStorei(R.UNPACK_ROW_LENGTH,ue.width),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,ue.height),R.pixelStorei(R.UNPACK_SKIP_PIXELS,It),R.pixelStorei(R.UNPACK_SKIP_ROWS,Nt),R.pixelStorei(R.UNPACK_SKIP_IMAGES,At);const ce=v.isDataArrayTexture||v.isData3DTexture,qe=U.isDataArrayTexture||U.isData3DTexture;if(v.isDepthTexture){const je=St.get(v),De=St.get(U),Ne=St.get(je.__renderTarget),ur=St.get(De.__renderTarget);Et.bindFramebuffer(R.READ_FRAMEBUFFER,Ne.__webglFramebuffer),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,ur.__webglFramebuffer);for(let Vn=0;Vn<_t;Vn++)ce&&(R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,St.get(v).__webglTexture,I,At+Vn),R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,St.get(U).__webglTexture,J,fe+Vn)),R.blitFramebuffer(It,Nt,ut,mt,Zt,Qt,ut,mt,R.DEPTH_BUFFER_BIT,R.NEAREST);Et.bindFramebuffer(R.READ_FRAMEBUFFER,null),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else if(I!==0||v.isRenderTargetTexture||St.has(v)){const je=St.get(v),De=St.get(U);Et.bindFramebuffer(R.READ_FRAMEBUFFER,Mc),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,Sc);for(let Ne=0;Ne<_t;Ne++)ce?R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,je.__webglTexture,I,At+Ne):R.framebufferTexture2D(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,je.__webglTexture,I),qe?R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,De.__webglTexture,J,fe+Ne):R.framebufferTexture2D(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,De.__webglTexture,J),I!==0?R.blitFramebuffer(It,Nt,ut,mt,Zt,Qt,ut,mt,R.COLOR_BUFFER_BIT,R.NEAREST):qe?R.copyTexSubImage3D(Te,J,Zt,Qt,fe+Ne,It,Nt,ut,mt):R.copyTexSubImage2D(Te,J,Zt,Qt,It,Nt,ut,mt);Et.bindFramebuffer(R.READ_FRAMEBUFFER,null),Et.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else qe?v.isDataTexture||v.isData3DTexture?R.texSubImage3D(Te,J,Zt,Qt,fe,ut,mt,_t,Kt,wt,ue.data):U.isCompressedArrayTexture?R.compressedTexSubImage3D(Te,J,Zt,Qt,fe,ut,mt,_t,Kt,ue.data):R.texSubImage3D(Te,J,Zt,Qt,fe,ut,mt,_t,Kt,wt,ue):v.isDataTexture?R.texSubImage2D(R.TEXTURE_2D,J,Zt,Qt,ut,mt,Kt,wt,ue.data):v.isCompressedTexture?R.compressedTexSubImage2D(R.TEXTURE_2D,J,Zt,Qt,ue.width,ue.height,Kt,ue.data):R.texSubImage2D(R.TEXTURE_2D,J,Zt,Qt,ut,mt,Kt,wt,ue);R.pixelStorei(R.UNPACK_ROW_LENGTH,te),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,tn),R.pixelStorei(R.UNPACK_SKIP_PIXELS,ai),R.pixelStorei(R.UNPACK_SKIP_ROWS,ze),R.pixelStorei(R.UNPACK_SKIP_IMAGES,Wi),J===0&&U.generateMipmaps&&R.generateMipmap(Te),Et.unbindTexture()},this.copyTextureToTexture3D=function(v,U,O=null,B=null,I=0){return v.isTexture!==!0&&(wi("WebGLRenderer: copyTextureToTexture3D function signature has changed."),O=arguments[0]||null,B=arguments[1]||null,v=arguments[2],U=arguments[3],I=arguments[4]||0),wi('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(v,U,O,B,I)},this.initRenderTarget=function(v){St.get(v).__webglFramebuffer===void 0&&T.setupRenderTarget(v)},this.initTexture=function(v){v.isCubeTexture?T.setTextureCube(v,0):v.isData3DTexture?T.setTexture3D(v,0):v.isDataArrayTexture||v.isCompressedArrayTexture?T.setTexture2DArray(v,0):T.setTexture2D(v,0),Et.unbindTexture()},this.resetState=function(){A=0,w=0,N=null,Et.reset(),jt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return En}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorspace=$t._getDrawingBufferColorSpace(t),e.unpackColorSpace=$t._getUnpackColorSpace()}}const Ml={type:"change"},eo={type:"start"},fc={type:"end"},Hs=new rs,Sl=new Nn,qm=Math.cos(70*xh.DEG2RAD),ge=new P,Fe=2*Math.PI,ae={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Yr=1e-6;class jm extends lu{constructor(t,e=null){super(t,e),this.state=ae.NONE,this.enabled=!0,this.target=new P,this.cursor=new P,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Di.ROTATE,MIDDLE:Di.DOLLY,RIGHT:Di.PAN},this.touches={ONE:Ri.ROTATE,TWO:Ri.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new P,this._lastQuaternion=new ni,this._lastTargetPosition=new P,this._quat=new ni().setFromUnitVectors(t.up,new P(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new jo,this._sphericalDelta=new jo,this._scale=1,this._panOffset=new P,this._rotateStart=new gt,this._rotateEnd=new gt,this._rotateDelta=new gt,this._panStart=new gt,this._panEnd=new gt,this._panDelta=new gt,this._dollyStart=new gt,this._dollyEnd=new gt,this._dollyDelta=new gt,this._dollyDirection=new P,this._mouse=new gt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Km.bind(this),this._onPointerDown=Zm.bind(this),this._onPointerUp=$m.bind(this),this._onContextMenu=s_.bind(this),this._onMouseWheel=t_.bind(this),this._onKeyDown=e_.bind(this),this._onTouchStart=n_.bind(this),this._onTouchMove=i_.bind(this),this._onMouseDown=Jm.bind(this),this._onMouseMove=Qm.bind(this),this._interceptControlDown=r_.bind(this),this._interceptControlUp=a_.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Ml),this.update(),this.state=ae.NONE}update(t=null){const e=this.object.position;ge.copy(e).sub(this.target),ge.applyQuaternion(this._quat),this._spherical.setFromVector3(ge),this.autoRotate&&this.state===ae.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(n)&&isFinite(s)&&(n<-Math.PI?n+=Fe:n>Math.PI&&(n-=Fe),s<-Math.PI?s+=Fe:s>Math.PI&&(s-=Fe),n<=s?this._spherical.theta=Math.max(n,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+s)/2?Math.max(n,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(ge.setFromSpherical(this._spherical),ge.applyQuaternion(this._quatInverse),e.copy(this.target).add(ge),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=ge.length();a=this._clampDistance(o*this._scale);const l=o-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),r=!!l}else if(this.object.isOrthographicCamera){const o=new P(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=l!==this.object.zoom;const c=new P(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(o),this.object.updateMatrixWorld(),a=ge.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(Hs.origin.copy(this.object.position),Hs.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Hs.direction))Yr||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Yr||this._lastTargetPosition.distanceToSquared(this.target)>Yr?(this.dispatchEvent(Ml),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Fe/60*this.autoRotateSpeed*t:Fe/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){ge.setFromMatrixColumn(e,0),ge.multiplyScalar(-t),this._panOffset.add(ge)}_panUp(t,e){this.screenSpacePanning===!0?ge.setFromMatrixColumn(e,1):(ge.setFromMatrixColumn(e,0),ge.crossVectors(this.object.up,ge)),ge.multiplyScalar(t),this._panOffset.add(ge)}_pan(t,e){const n=this.domElement;if(this.object.isPerspectiveCamera){const s=this.object.position;ge.copy(s).sub(this.target);let r=ge.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/n.clientHeight,this.object.matrix),this._panUp(2*e*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),s=t-n.left,r=e-n.top,a=n.width,o=n.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Fe*this._rotateDelta.x/e.clientHeight),this._rotateUp(Fe*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Fe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Fe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Fe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Fe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(n,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(n,s)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Fe*this._rotateDelta.x/e.clientHeight),this._rotateUp(Fe*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(n,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e + varying vec2 vUv; + uniform sampler2D colorTexture; + uniform vec2 invSize; + uniform vec2 direction; + uniform float gaussianCoefficients[KERNEL_RADIUS]; + + void main() { + float weightSum = gaussianCoefficients[0]; + vec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum; + for( int i = 1; i < KERNEL_RADIUS; i ++ ) { + float x = float(i); + float w = gaussianCoefficients[i]; + vec2 uvOffset = direction * invSize * x; + vec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb; + vec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb; + diffuseSum += (sample1 + sample2) * w; + weightSum += 2.0 * w; + } + gl_FragColor = vec4(diffuseSum/weightSum, 1.0); + }`})}getCompositeMaterial(t){return new Ie({defines:{NUM_MIPS:t},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv; + void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + }`,fragmentShader:`varying vec2 vUv; + uniform sampler2D blurTexture1; + uniform sampler2D blurTexture2; + uniform sampler2D blurTexture3; + uniform sampler2D blurTexture4; + uniform sampler2D blurTexture5; + uniform float bloomStrength; + uniform float bloomRadius; + uniform float bloomFactors[NUM_MIPS]; + uniform vec3 bloomTintColors[NUM_MIPS]; + + float lerpBloomFactor(const in float factor) { + float mirrorFactor = 1.2 - factor; + return mix(factor, mirrorFactor, bloomRadius); + } + + void main() { + gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + + lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + + lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + + lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + + lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) ); + }`})}}Vi.BlurDirectionX=new gt(1,0);Vi.BlurDirectionY=new gt(0,1);function p_(i){const t=new Xh;t.fog=new lr(328976,.008);const e=new We(60,i.clientWidth/i.clientHeight,.1,2e3);e.position.set(0,30,80);const n=new Ym({antialias:!0,alpha:!0,powerPreference:"high-performance"});n.setSize(i.clientWidth,i.clientHeight),n.setPixelRatio(Math.min(window.devicePixelRatio,2)),n.toneMapping=Nl,n.toneMappingExposure=1.2,i.appendChild(n.domElement);const s=new jm(e,n.domElement);s.enableDamping=!0,s.dampingFactor=.05,s.rotateSpeed=.5,s.zoomSpeed=.8,s.minDistance=10,s.maxDistance=500,s.autoRotate=!0,s.autoRotateSpeed=.3;const r=new u_(n);r.addPass(new d_(t,e));const a=new Vi(new gt(i.clientWidth,i.clientHeight),.8,.4,.85);r.addPass(a);const o=new su(1710650,.5);t.add(o);const l=new Wo(6514417,1.5,200);l.position.set(50,50,50),t.add(l);const c=new Wo(11032055,1,200);c.position.set(-50,-30,-50),t.add(c);const h=new ou;h.params.Points={threshold:2};const d=new gt;return{scene:t,camera:e,renderer:n,controls:s,composer:r,bloomPass:a,raycaster:h,mouse:d,lights:{ambient:o,point1:l,point2:c}}}function m_(i,t){const e=t.clientWidth,n=t.clientHeight;i.camera.aspect=e/n,i.camera.updateProjectionMatrix(),i.renderer.setSize(e,n),i.composer.setSize(e,n)}function __(i){i.scene.traverse(t=>{var e;(t instanceof ye||t instanceof Zh)&&((e=t.geometry)==null||e.dispose(),Array.isArray(t.material)?t.material.forEach(n=>n.dispose()):t.material&&t.material.dispose())}),i.renderer.dispose(),i.composer.dispose()}class g_{constructor(t){ie(this,"positions");ie(this,"velocities");ie(this,"running",!0);ie(this,"step",0);ie(this,"repulsionStrength",500);ie(this,"attractionStrength",.01);ie(this,"dampening",.9);ie(this,"maxSteps",300);this.positions=t,this.velocities=new Map;for(const e of t.keys())this.velocities.set(e,new P)}tick(t){if(!this.running||this.step>this.maxSteps)return;this.step++;const e=Math.max(.001,1-this.step/this.maxSteps),n=Array.from(this.positions.keys());for(let s=0;s40?t.slice(0,37)+"...":t;s.clearRect(0,0,n.width,n.height),s.font="bold 28px -apple-system, BlinkMacSystemFont, sans-serif",s.textAlign="center",s.textBaseline="middle",s.shadowColor="rgba(0, 0, 0, 0.8)",s.shadowBlur=6,s.shadowOffsetX=0,s.shadowOffsetY=2,s.fillStyle=e,s.fillText(r,n.width/2,n.height/2);const a=new Jh(n);a.needsUpdate=!0;const o=new Fa({map:a,transparent:!0,opacity:0,depthTest:!1,sizeAttenuation:!0}),l=new Ir(o);return l.scale.set(12,1.5,1),l}updatePositions(){this.group.children.forEach(t=>{if(t.userData.nodeId){const e=this.positions.get(t.userData.nodeId);if(!e)return;t.userData.isGlow?t.position.copy(e):t.userData.isLabel?(t.position.copy(e),t.position.y+=t.userData.offset):t instanceof ye&&t.position.copy(e)}})}animate(t,e,n){this.meshMap.forEach((s,r)=>{const a=e.find(c=>c.id===r);if(!a)return;const o=1+Math.sin(t*1.5+e.indexOf(a)*.5)*.15*a.retention;s.scale.setScalar(o);const l=s.material;if(r===this.hoveredNode)l.emissiveIntensity=1;else if(r===this.selectedNode)l.emissiveIntensity=.8;else{const h=.3+a.retention*.5+Math.sin(t*(.8+a.retention*.7))*.1*a.retention;l.emissiveIntensity=h}}),this.labelSprites.forEach((s,r)=>{const a=this.positions.get(r);if(!a)return;const o=n.position.distanceTo(a),l=s.material,c=r===this.hoveredNode||r===this.selectedNode?1:o<40?.9:o<80?.9*(1-(o-40)/40):0;l.opacity+=(c-l.opacity)*.1})}getMeshes(){return Array.from(this.meshMap.values())}dispose(){this.group.traverse(t=>{var e,n,s,r,a;t instanceof ye?((e=t.geometry)==null||e.dispose(),(n=t.material)==null||n.dispose()):t instanceof Ir&&((r=(s=t.material)==null?void 0:s.map)==null||r.dispose(),(a=t.material)==null||a.dispose())})}}class x_{constructor(){ie(this,"group");this.group=new Ci}createEdges(t,e){for(const n of t){const s=e.get(n.source),r=e.get(n.target);if(!s||!r)continue;const a=[s,r],o=new Ee().setFromPoints(a),l=new $a({color:4868730,transparent:!0,opacity:Math.min(.1+n.weight*.5,.6),blending:fn}),c=new sc(o,l);c.userData={source:n.source,target:n.target},this.group.add(c)}}updatePositions(t){this.group.children.forEach(e=>{const n=e,s=t.get(n.userData.source),r=t.get(n.userData.target);if(s&&r){const a=n.geometry.attributes.position;a.setXYZ(0,s.x,s.y,s.z),a.setXYZ(1,r.x,r.y,r.z),a.needsUpdate=!0}})}dispose(){this.group.children.forEach(t=>{var n,s;const e=t;(n=e.geometry)==null||n.dispose(),(s=e.material)==null||s.dispose()})}}class M_{constructor(t){ie(this,"starField");ie(this,"neuralParticles");this.starField=this.createStarField(),this.neuralParticles=this.createNeuralParticles(),t.add(this.starField),t.add(this.neuralParticles)}createStarField(){const e=new Ee,n=new Float32Array(3e3*3),s=new Float32Array(3e3);for(let a=0;a<3e3;a++)n[a*3]=(Math.random()-.5)*1e3,n[a*3+1]=(Math.random()-.5)*1e3,n[a*3+2]=(Math.random()-.5)*1e3,s[a]=Math.random()*1.5;e.setAttribute("position",new Se(n,3)),e.setAttribute("size",new Se(s,1));const r=new ir({color:6514417,size:.5,transparent:!0,opacity:.4,sizeAttenuation:!0,blending:fn});return new Ba(e,r)}createNeuralParticles(){const e=new Ee,n=new Float32Array(500*3),s=new Float32Array(500*3);for(let a=0;a<500;a++)n[a*3]=(Math.random()-.5)*100,n[a*3+1]=(Math.random()-.5)*100,n[a*3+2]=(Math.random()-.5)*100,s[a*3]=.4+Math.random()*.3,s[a*3+1]=.3+Math.random()*.2,s[a*3+2]=.8+Math.random()*.2;e.setAttribute("position",new Se(n,3)),e.setAttribute("color",new Se(s,3));const r=new ir({size:.3,vertexColors:!0,transparent:!0,opacity:.4,blending:fn,sizeAttenuation:!0});return new Ba(e,r)}animate(t){this.starField.rotation.y+=1e-4,this.starField.rotation.x+=5e-5;const e=this.neuralParticles.geometry.attributes.position;for(let n=0;n=0;n--){const s=this.pulseEffects[n];if(s.intensity-=s.decay,s.intensity<=0){this.pulseEffects.splice(n,1);continue}const r=t.get(s.nodeId);if(r){const a=r.material;a.emissive.lerp(s.color,s.intensity*.3),a.emissiveIntensity=Math.max(a.emissiveIntensity,s.intensity)}}for(let n=this.spawnBursts.length-1;n>=0;n--){const s=this.spawnBursts[n];if(s.age++,s.age>120){this.scene.remove(s.particles),s.particles.geometry.dispose(),s.particles.material.dispose(),this.spawnBursts.splice(n,1);continue}const r=s.particles.geometry.attributes.position,a=s.particles.geometry.attributes.velocity;for(let l=0;l=0;n--){const s=this.shockwaves[n];if(s.age++,s.age>s.maxAge){this.scene.remove(s.mesh),s.mesh.geometry.dispose(),s.mesh.material.dispose(),this.shockwaves.splice(n,1);continue}const r=s.age/s.maxAge;s.mesh.scale.setScalar(1+r*20),s.mesh.material.opacity=.8*(1-r),s.mesh.lookAt(e.position)}for(let n=this.connectionFlashes.length-1;n>=0;n--){const s=this.connectionFlashes[n];if(s.intensity-=.015,s.intensity<=0){this.scene.remove(s.line),s.line.geometry.dispose(),s.line.material.dispose(),this.connectionFlashes.splice(n,1);continue}s.line.material.opacity=s.intensity}}dispose(){for(const t of this.spawnBursts)this.scene.remove(t.particles),t.particles.geometry.dispose(),t.particles.material.dispose();for(const t of this.shockwaves)this.scene.remove(t.mesh),t.mesh.geometry.dispose(),t.mesh.material.dispose();for(const t of this.connectionFlashes)this.scene.remove(t.line),t.line.geometry.dispose(),t.line.material.dispose();this.pulseEffects=[],this.spawnBursts=[],this.shockwaves=[],this.connectionFlashes=[]}}const Sn={bloomStrength:.8,rotateSpeed:.3,fogColor:328976,fogDensity:.008,nebulaIntensity:0,chromaticIntensity:.002,vignetteRadius:.9,breatheAmplitude:1},In={bloomStrength:1.8,rotateSpeed:.08,fogColor:656672,fogDensity:.006,nebulaIntensity:1,chromaticIntensity:.005,vignetteRadius:.7,breatheAmplitude:2};class y_{constructor(){ie(this,"active",!1);ie(this,"transition",0);ie(this,"transitionSpeed",.008);ie(this,"current");ie(this,"auroraHue",0);this.current={...Sn}}setActive(t){this.active=t}update(t,e,n,s,r){const a=this.active?1:0;this.transition+=(a-this.transition)*this.transitionSpeed*60*(1/60),this.transition=Math.max(0,Math.min(1,this.transition));const o=this.transition;this.current.bloomStrength=this.lerp(Sn.bloomStrength,In.bloomStrength,o),this.current.rotateSpeed=this.lerp(Sn.rotateSpeed,In.rotateSpeed,o),this.current.fogDensity=this.lerp(Sn.fogDensity,In.fogDensity,o),this.current.nebulaIntensity=this.lerp(Sn.nebulaIntensity,In.nebulaIntensity,o),this.current.chromaticIntensity=this.lerp(Sn.chromaticIntensity,In.chromaticIntensity,o),this.current.vignetteRadius=this.lerp(Sn.vignetteRadius,In.vignetteRadius,o),this.current.breatheAmplitude=this.lerp(Sn.breatheAmplitude,In.breatheAmplitude,o),e.strength=this.current.bloomStrength,n.autoRotateSpeed=this.current.rotateSpeed;const l=new xt(Sn.fogColor),c=new xt(In.fogColor),h=l.clone().lerp(c,o);if(t.fog=new lr(h,this.current.fogDensity),o>.01){this.auroraHue=r*.1%1;const d=new xt().setHSL(.75+this.auroraHue*.15,.8,.5),f=new xt().setHSL(.55+this.auroraHue*.2,.7,.4);s.point1.color.lerp(d,o*.3),s.point2.color.lerp(f,o*.3)}else s.point1.color.set(6514417),s.point2.color.set(11032055)}lerp(t,e,n){return t+(e-t)*n}}function E_(i,t,e,n,s){var r,a,o,l;switch(i.type){case"MemoryCreated":{const c=(r=i.data)==null?void 0:r.id,h=c?e.get(c):null,d=(h==null?void 0:h.clone())??new P((Math.random()-.5)*40,(Math.random()-.5)*40,(Math.random()-.5)*40);t.createSpawnBurst(d,new xt(65489)),t.createShockwave(d,new xt(65489),s);break}case"SearchPerformed":{n.forEach((c,h)=>{t.addPulse(h,.6+Math.random()*.4,new xt(8490232),.02)});break}case"DreamStarted":{n.forEach((c,h)=>{t.addPulse(h,1,new xt(11032055),.005)});break}case"DreamProgress":{const c=(a=i.data)==null?void 0:a.memory_id;c&&n.has(c)&&t.addPulse(c,1.5,new xt(12616956),.01);break}case"DreamCompleted":{t.createSpawnBurst(new P(0,0,0),new xt(11032055)),t.createShockwave(new P(0,0,0),new xt(11032055),s);break}case"ConnectionDiscovered":{const c=i.data,h=c.source_id?e.get(c.source_id):null,d=c.target_id?e.get(c.target_id):null;h&&d&&t.createConnectionFlash(h,d,new xt(54527));break}case"RetentionDecayed":{const c=(o=i.data)==null?void 0:o.id;c&&n.has(c)&&t.addPulse(c,.8,new xt(16729943),.03);break}case"MemoryPromoted":{const c=(l=i.data)==null?void 0:l.id;if(c&&n.has(c)){t.addPulse(c,1.2,new xt(65416),.01);const h=e.get(c);h&&t.createShockwave(h,new xt(65416),s)}break}case"ConsolidationCompleted":{n.forEach((c,h)=>{t.addPulse(h,.4+Math.random()*.3,new xt(16758784),.015)});break}case"ActivationSpread":{const c=i.data;if(c.source_id&&c.target_ids){const h=e.get(c.source_id);if(h)for(const d of c.target_ids){const f=e.get(d);f&&t.createConnectionFlash(h,f,new xt(1370310))}}break}}}const T_=` +varying vec2 vUv; +void main() { + vUv = uv; + gl_Position = vec4(position, 1.0); +} +`,b_=` +precision highp float; + +uniform float uTime; +uniform vec2 uResolution; +uniform float uDreamIntensity; + +varying vec2 vUv; + +// Simplex-style hash +vec3 hash33(vec3 p3) { + p3 = fract(p3 * vec3(0.1031, 0.1030, 0.0973)); + p3 += dot(p3, p3.yxz + 33.33); + return fract((p3.xxy + p3.yxx) * p3.zyx); +} + +// 3D value noise +float noise(vec3 p) { + vec3 i = floor(p); + vec3 f = fract(p); + f = f * f * (3.0 - 2.0 * f); + + float n = i.x + i.y * 157.0 + 113.0 * i.z; + + vec4 v1 = fract(sin(vec4(n + 0.0, n + 1.0, n + 157.0, n + 158.0)) * 43758.5453); + vec4 v2 = fract(sin(vec4(n + 113.0, n + 114.0, n + 270.0, n + 271.0)) * 43758.5453); + + vec4 a = mix(v1, v2, f.z); + vec2 b = mix(a.xy, a.zw, f.y); + return mix(b.x, b.y, f.x); +} + +// FBM with 5 octaves +float fbm(vec3 p) { + float value = 0.0; + float amplitude = 0.5; + float frequency = 1.0; + for (int i = 0; i < 5; i++) { + value += amplitude * noise(p * frequency); + frequency *= 2.0; + amplitude *= 0.5; + } + return value; +} + +// IQ cosine palette +vec3 palette(float t, vec3 a, vec3 b, vec3 c, vec3 d) { + return a + b * cos(6.28318 * (c * t + d)); +} + +void main() { + vec2 uv = (gl_FragCoord.xy - 0.5 * uResolution.xy) / min(uResolution.x, uResolution.y); + float t = uTime * 0.05; + + // Domain warping: fbm(p + fbm(p + fbm(p))) + vec3 p = vec3(uv * 2.0, t); + + float warp1 = fbm(p); + float warp2 = fbm(p + warp1 * 3.0 + vec3(1.7, 9.2, t * 0.3)); + float warp3 = fbm(p + warp2 * 2.5 + vec3(8.3, 2.8, t * 0.2)); + + // Final noise value + float f = fbm(p + warp3 * 2.0); + + // Color: cosmic palette that shifts during dream mode + vec3 normalA = vec3(0.02, 0.01, 0.05); + vec3 normalB = vec3(0.03, 0.02, 0.08); + vec3 normalC = vec3(1.0, 1.0, 1.0); + vec3 normalD = vec3(0.70, 0.55, 0.80); + + vec3 dreamA = vec3(0.05, 0.01, 0.08); + vec3 dreamB = vec3(0.06, 0.03, 0.12); + vec3 dreamC = vec3(1.0, 0.8, 1.0); + vec3 dreamD = vec3(0.80, 0.40, 0.90); + + vec3 a = mix(normalA, dreamA, uDreamIntensity); + vec3 b = mix(normalB, dreamB, uDreamIntensity); + vec3 c = mix(normalC, dreamC, uDreamIntensity); + vec3 d = mix(normalD, dreamD, uDreamIntensity); + + vec3 color = palette(f + warp2 * 0.5, a, b, c, d); + + // Add subtle star-like highlights + float stars = smoothstep(0.97, 1.0, noise(vec3(uv * 50.0, t * 0.1))); + color += stars * 0.15; + + // Intensity modulation + float intensity = 0.15 + 0.1 * uDreamIntensity; + color *= intensity; + + // Vignette + float dist = length(uv); + color *= smoothstep(1.5, 0.3, dist); + + gl_FragColor = vec4(color, 1.0); +} +`;function A_(i){const t=new os(2,2),e=new Ie({vertexShader:T_,fragmentShader:b_,uniforms:{uTime:{value:0},uResolution:{value:new gt(window.innerWidth,window.innerHeight)},uDreamIntensity:{value:0}},depthWrite:!1,depthTest:!1,transparent:!1}),n=new ye(t,e);return n.frustumCulled=!1,n.renderOrder=-1e3,i.add(n),{mesh:n,material:e}}function w_(i,t,e,n,s){i.uniforms.uTime.value=t,i.uniforms.uDreamIntensity.value=e,i.uniforms.uResolution.value.set(n,s)}const R_={uniforms:{tDiffuse:{value:null},uIntensity:{value:.002}},vertexShader:` + varying vec2 vUv; + void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } + `,fragmentShader:` + uniform sampler2D tDiffuse; + uniform float uIntensity; + varying vec2 vUv; + + void main() { + vec2 center = vec2(0.5); + vec2 dir = vUv - center; + float dist = length(dir); + + float rOffset = uIntensity * dist; + float gOffset = 0.0; + float bOffset = -uIntensity * dist; + + vec2 rUv = vUv + dir * rOffset; + vec2 gUv = vUv + dir * gOffset; + vec2 bUv = vUv + dir * bOffset; + + float r = texture2D(tDiffuse, rUv).r; + float g = texture2D(tDiffuse, gUv).g; + float b = texture2D(tDiffuse, bUv).b; + + gl_FragColor = vec4(r, g, b, 1.0); + } + `},C_={uniforms:{tDiffuse:{value:null},uTime:{value:0},uIntensity:{value:.04}},vertexShader:` + varying vec2 vUv; + void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } + `,fragmentShader:` + uniform sampler2D tDiffuse; + uniform float uTime; + uniform float uIntensity; + varying vec2 vUv; + + float rand(vec2 co) { + return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453); + } + + void main() { + vec4 color = texture2D(tDiffuse, vUv); + float grain = rand(vUv + vec2(uTime)) * 2.0 - 1.0; + color.rgb += grain * uIntensity; + gl_FragColor = color; + } + `},P_={uniforms:{tDiffuse:{value:null},uRadius:{value:.9},uSoftness:{value:.5}},vertexShader:` + varying vec2 vUv; + void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } + `,fragmentShader:` + uniform sampler2D tDiffuse; + uniform float uRadius; + uniform float uSoftness; + varying vec2 vUv; + + void main() { + vec4 color = texture2D(tDiffuse, vUv); + vec2 center = vec2(0.5); + float dist = distance(vUv, center) * 1.414; + float vignette = smoothstep(uRadius, uRadius - uSoftness, dist); + color.rgb *= vignette; + gl_FragColor = color; + } + `};function D_(i){const t=new js(R_),e=new js(C_),n=new js(P_);return i.addPass(t),i.addPass(e),i.addPass(n),{chromatic:t,grain:e,vignette:n}}function L_(i,t,e){i.chromatic.uniforms.uIntensity.value=.002+(.005-.002)*e,i.grain.uniforms.uTime.value=t,i.grain.uniforms.uIntensity.value=.04+e*.02;const r=.9,a=.7;i.vignette.uniforms.uRadius.value=r+(a-r)*e}var U_=Ye('
');function I_(i,t){sr(t,!0);let e=Zs(t,"events",19,()=>[]),n=Zs(t,"isDreaming",3,!1),s,r,a,o,l,c,h,d,f,m,g,x=0;Tl(()=>{r=p_(s),m=A_(r.scene).material,g=D_(r.composer),c=new M_(r.scene),o=new v_,l=new x_,h=new S_(r.scene),f=new y_;const w=o.createNodes(t.nodes);l.createEdges(t.edges,w),d=new g_(w),r.scene.add(l.group),r.scene.add(o.group),p(),window.addEventListener("resize",b),s.addEventListener("pointermove",E),s.addEventListener("click",S)}),bl(()=>{cancelAnimationFrame(a),window.removeEventListener("resize",b),s==null||s.removeEventListener("pointermove",E),s==null||s.removeEventListener("click",S),h==null||h.dispose(),c==null||c.dispose(),o==null||o.dispose(),l==null||l.dispose(),r&&__(r)});function p(){a=requestAnimationFrame(p);const A=performance.now()*.001;d.tick(t.edges),o.updatePositions(),l.updatePositions(o.positions),c.animate(A),o.animate(A,t.nodes,r.camera),f.setActive(n()),f.update(r.scene,r.bloomPass,r.controls,r.lights,A),w_(m,A,f.current.nebulaIntensity,s.clientWidth,s.clientHeight),L_(g,A,f.current.nebulaIntensity),u(),h.update(o.meshMap,r.camera),r.controls.update(),r.composer.render()}function u(){if(!e()||e().length<=x)return;const A=e().slice(x);x=e().length;for(const w of A)E_(w,h,o.positions,o.meshMap,r.camera)}function b(){!s||!r||m_(r,s)}function E(A){const w=s.getBoundingClientRect();r.mouse.x=(A.clientX-w.left)/w.width*2-1,r.mouse.y=-((A.clientY-w.top)/w.height)*2+1,r.raycaster.setFromCamera(r.mouse,r.camera);const N=r.raycaster.intersectObjects(o.getMeshes());N.length>0?(o.hoveredNode=N[0].object.userData.nodeId,s.style.cursor="pointer"):(o.hoveredNode=null,s.style.cursor="grab")}function S(){var A;if(o.hoveredNode){o.selectedNode=o.hoveredNode,(A=t.onSelect)==null||A.call(t,o.hoveredNode);const w=o.positions.get(o.hoveredNode);w&&r.controls.target.lerp(w.clone(),.5)}}var D=U_();Cc(D,A=>s=A,()=>s),Oe(i,D),rr()}var N_=Ye('
'),F_=Ye('
');function O_(i,t){sr(t,!0);let e=Zs(t,"width",3,240),n=Zs(t,"height",3,80);function s(p){return t.stability<=0?0:Math.exp(-p/t.stability)}let r=ti(()=>{const p=[],u=Math.max(t.stability*3,30),b=4,E=e()-b*2,S=n()-b*2;for(let D=0;D<=50;D++){const A=D/50*u,w=s(A),N=b+D/50*E,y=b+(1-w)*S;p.push(`${D===0?"M":"L"}${N.toFixed(1)},${y.toFixed(1)}`)}return p.join(" ")}),a=ti(()=>[{label:"Now",days:0,value:t.retention},{label:"1d",days:1,value:s(1)},{label:"7d",days:7,value:s(7)},{label:"30d",days:30,value:s(30)}]);function o(p){return p>.7?"#10b981":p>.4?"#f59e0b":"#ef4444"}var l=F_(),c=Ut(l),h=Ut(c),d=Bt(h),f=Bt(d),m=Bt(f),g=Bt(m);Al(),Pt(c);var x=Bt(c,2);qr(x,21,()=>tt(a),jr,(p,u)=>{var b=N_(),E=Ut(b),S=Ut(E);Pt(E);var D=Bt(E,2),A=Ut(D);Pt(D),Pt(b),on((w,N)=>{me(S,`${tt(u).label??""}:`),Pl(D,`color: ${w??""}`),me(A,`${N??""}%`)},[()=>o(tt(u).value),()=>(tt(u).value*100).toFixed(0)]),Oe(p,b)}),Pt(x),Pt(l),on(p=>{He(c,"width",e()),He(c,"height",n()),He(c,"viewBox",`0 0 ${e()??""} ${n()??""}`),He(h,"y1",4+(n()-8)*.5),He(h,"x2",e()-4),He(h,"y2",4+(n()-8)*.5),He(d,"y1",4+(n()-8)*.8),He(d,"x2",e()-4),He(d,"y2",4+(n()-8)*.8),He(f,"d",tt(r)),He(m,"d",`${tt(r)??""} L${e()-4},${n()-4} L4,${n()-4} Z`),He(g,"cy",4+(1-t.retention)*(n()-8)),He(g,"fill",p)},[()=>o(t.retention)]),Oe(i,l),rr()}function El(i,t,e){const n=e.getTime(),s=new Set,r=new Map,a=i.filter(l=>{const c=new Date(l.createdAt).getTime();if(c<=n){s.add(l.id);const h=n-c,d=1440*60*1e3,f=hs.has(l.source)&&s.has(l.target));return{visibleNodes:a,visibleEdges:o,nodeOpacities:r}}function B_(i){if(i.length===0){const n=new Date;return{oldest:n,newest:n}}let t=1/0,e=-1/0;for(const n of i){const s=new Date(n.createdAt).getTime();se&&(e=s)}return{oldest:new Date(t),newest:new Date(e)}}var z_=Ye(`
`),H_=Ye('');function k_(i,t){sr(t,!0);let e=Ge(!1),n=Ge(!1),s=Ge(1),r=Ge(100),a,o=0,l=ti(()=>B_(t.nodes)),c=ti(()=>{const E=tt(l).oldest.getTime(),D=tt(l).newest.getTime()-E||1;return new Date(E+tt(r)/100*D)});function h(E){return E.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function d(){de(e,!tt(e)),t.onToggle(tt(e)),tt(e)&&(de(r,100),t.onDateChange(tt(c)))}function f(){de(n,!tt(n)),tt(n)?(de(r,0),o=performance.now(),m()):cancelAnimationFrame(a)}function m(){a=requestAnimationFrame(E=>{const S=(E-o)/1e3;o=E;const D=tt(l).oldest.getTime(),w=(tt(l).newest.getTime()-D)/(1440*60*1e3)||1,N=tt(s)/w*100;if(de(r,Math.min(100,tt(r)+N*S),!0),t.onDateChange(tt(c)),tt(r)>=100){de(n,!1);return}m()})}function g(){t.onDateChange(tt(c))}bl(()=>{cancelAnimationFrame(a)});var x=bc(),p=wl(x);{var u=E=>{var S=z_(),D=Ut(S),A=Ut(D),w=Ut(A),N=Ut(w),y=Ut(N,!0);Pt(N);var M=Bt(N,2),C=Ut(M);C.value=C.__value=1;var W=Bt(C);W.value=W.__value=7;var z=Bt(W);z.value=z.__value=30,Pt(M),Pt(w);var V=Bt(w,2),K=Ut(V,!0);Pt(V);var G=Bt(V,2);Pt(A);var $=Bt(A,2);Cl($);var H=Bt($,2),nt=Ut(H),dt=Ut(nt,!0);Pt(nt);var Mt=Bt(nt,2),Ft=Ut(Mt,!0);Pt(Mt),Pt(H),Pt(D),Pt(S),on((Yt,Y,et)=>{me(y,tt(n)?"⏸":"▶"),me(K,Yt),me(dt,Y),me(Ft,et)},[()=>h(tt(c)),()=>h(tt(l).oldest),()=>h(tt(l).newest)]),Ke("click",N,f),Ll(M,()=>tt(s),Yt=>de(s,Yt)),Ke("click",G,d),Ke("input",$,g),Dl($,()=>tt(r),Yt=>de(r,Yt)),Oe(E,S)},b=E=>{var S=H_();Ke("click",S,d),Oe(E,S)};Ai(p,E=>{tt(e)?E(u):E(b,!1)})}Oe(i,x),rr()}Rl(["click","input"]);var V_=Ye('

Loading memory graph...

'),G_=Ye('

Your Mind Awaits

'),W_=Ye(' · · ',1),X_=Ye(' '),Y_=Ye('
'),q_=Ye("
"),j_=Ye(`

Memory Detail

Retention Forecast
◬ Explore Connections
`),Z_=Ye(`
`);function mg(i,t){sr(t,!0);const e=()=>Rc(Dc,"$eventFeed",n),[n,s]=wc();let r=Ge(null),a=Ge(null),o=Ge(!0),l=Ge(""),c=Ge(!1),h=Ge(""),d=Ge(150),f=Ge(!1),m=Ge(Tc(new Date)),g=ti(()=>tt(r)?tt(f)?El(tt(r).nodes,tt(r).edges,tt(m)).visibleNodes:tt(r).nodes:[]),x=ti(()=>tt(r)?tt(f)?El(tt(r).nodes,tt(r).edges,tt(m)).visibleEdges:tt(r).edges:[]);Tl(()=>p());async function p(it,Tt){de(o,!0),de(l,"");try{de(r,await Xi.graph({max_nodes:tt(d),depth:3,query:it||void 0,center_id:Tt||void 0}),!0)}catch{de(l,"No memories yet. Start using Vestige to populate your graph.")}finally{de(o,!1)}}async function u(){de(c,!0);try{await Xi.dream(),await p()}catch{}finally{de(c,!1)}}async function b(it){try{de(a,await Xi.memories.get(it),!0)}catch{de(a,null)}}function E(){tt(h).trim()&&p(tt(h))}var S=Z_(),D=Ut(S);{var A=it=>{var Tt=V_();Oe(it,Tt)},w=it=>{var Tt=G_(),qt=Ut(Tt),Ht=Bt(Ut(qt),4),Jt=Ut(Ht,!0);Pt(Ht),Pt(qt),Pt(Tt),on(()=>me(Jt,tt(l))),Oe(it,Tt)},N=it=>{I_(it,{get nodes(){return tt(g)},get edges(){return tt(x)},get centerId(){return tt(r).center_id},get events(){return e()},get isDreaming(){return tt(c)},onSelect:b})};Ai(D,it=>{tt(o)?it(A):tt(l)?it(w,1):tt(r)&&it(N,2)})}var y=Bt(D,2),M=Ut(y),C=Ut(M);Cl(C);var W=Bt(C,2);Pt(M);var z=Bt(M,2),V=Ut(z),K=Ut(V);K.value=K.__value=50;var G=Bt(K);G.value=G.__value=100;var $=Bt(G);$.value=$.__value=150;var H=Bt($);H.value=H.__value=200,Pt(V);var nt=Bt(V,2),dt=Ut(nt,!0);Pt(nt);var Mt=Bt(nt,2);Pt(z),Pt(y);var Ft=Bt(y,2),Yt=Ut(Ft);{var Y=it=>{var Tt=W_(),qt=wl(Tt),Ht=Ut(qt);Pt(qt);var Jt=Bt(qt,4),R=Ut(Jt);Pt(Jt);var _e=Bt(Jt,4),Vt=Ut(_e);Pt(_e),on(()=>{me(Ht,`${tt(g).length??""} nodes`),me(R,`${tt(x).length??""} edges`),me(Vt,`depth ${tt(r).depth??""}`)}),Oe(it,Tt)};Ai(Yt,it=>{tt(r)&&it(Y)})}Pt(Ft);var et=Bt(Ft,2);{var vt=it=>{k_(it,{get nodes(){return tt(r).nodes},onDateChange:Tt=>{de(m,Tt,!0)},onToggle:Tt=>{de(f,Tt,!0)}})};Ai(et,it=>{tt(r)&&it(vt)})}var lt=Bt(et,2);{var Rt=it=>{var Tt=j_(),qt=Ut(Tt),Ht=Bt(Ut(qt),2);Pt(qt);var Jt=Bt(qt,2),R=Ut(Jt),_e=Ut(R),Vt=Ut(_e,!0);Pt(_e);var Wt=Bt(_e,2);qr(Wt,17,()=>tt(a).tags,jr,(st,Dt)=>{var Ct=X_(),jt=Ut(Ct,!0);Pt(Ct),on(()=>me(jt,tt(Dt))),Oe(st,Ct)}),Pt(R);var Et=Bt(R,2),le=Ut(Et,!0);Pt(Et);var St=Bt(Et,2);qr(St,21,()=>[{label:"Retention",value:tt(a).retentionStrength},{label:"Storage",value:tt(a).storageStrength},{label:"Retrieval",value:tt(a).retrievalStrength}],jr,(st,Dt)=>{var Ct=Y_(),jt=Ut(Ct),L=Ut(jt),ot=Ut(L,!0);Pt(L);var k=Bt(L,2),j=Ut(k);Pt(k),Pt(jt);var ct=Bt(jt,2),ht=Ut(ct);Pt(ct),Pt(Ct),on(Ot=>{me(ot,tt(Dt).label),me(j,`${Ot??""}%`),Pl(ht,`width: ${tt(Dt).value*100}%; background: ${tt(Dt).value>.7?"#10b981":tt(Dt).value>.4?"#f59e0b":"#ef4444"}`)},[()=>(tt(Dt).value*100).toFixed(1)]),Oe(st,Ct)}),Pt(St);var T=Bt(St,2),_=Bt(Ut(T),2);{let st=ti(()=>tt(a).storageStrength*30);O_(_,{get retention(){return tt(a).retentionStrength},get stability(){return tt(st)}})}Pt(T);var F=Bt(T,2),q=Ut(F),Z=Ut(q);Pt(q);var X=Bt(q,2),yt=Ut(X);Pt(X);var at=Bt(X,2);{var ft=st=>{var Dt=q_(),Ct=Ut(Dt);Pt(Dt),on(jt=>me(Ct,`Accessed: ${jt??""}`),[()=>new Date(tt(a).lastAccessedAt).toLocaleString()]),Oe(st,Dt)};Ai(at,st=>{tt(a).lastAccessedAt&&st(ft)})}var Xt=Bt(at,2),Q=Ut(Xt);Pt(Xt),Pt(F);var pt=Bt(F,2),bt=Ut(pt),Lt=Bt(bt,2);Pt(pt),Al(2),Pt(Jt),Pt(Tt),on((st,Dt)=>{me(Vt,tt(a).nodeType),me(le,tt(a).content),me(Z,`Created: ${st??""}`),me(yt,`Updated: ${Dt??""}`),me(Q,`Reviews: ${tt(a).reviewCount??0??""}`)},[()=>new Date(tt(a).createdAt).toLocaleString(),()=>new Date(tt(a).updatedAt).toLocaleString()]),Ke("click",Ht,()=>de(a,null)),Ke("click",bt,()=>{tt(a)&&Xi.memories.promote(tt(a).id)}),Ke("click",Lt,()=>{tt(a)&&Xi.memories.demote(tt(a).id)}),Oe(it,Tt)};Ai(lt,it=>{tt(a)&&it(Rt)})}Pt(S),on(()=>{nt.disabled=tt(c),Ac(nt,1,`px-4 py-2 rounded-xl bg-dream/20 border border-dream/40 text-dream-glow text-sm + hover:bg-dream/30 transition-all backdrop-blur-sm disabled:opacity-50 + ${tt(c)?"glow-dream animate-pulse-glow":""}`),me(dt,tt(c)?"◈ Dreaming...":"◈ Dream")}),Ke("keydown",C,it=>it.key==="Enter"&&E()),Dl(C,()=>tt(h),it=>de(h,it)),Ke("click",W,E),Ke("change",V,()=>p()),Ll(V,()=>tt(d),it=>de(d,it)),Ke("click",nt,u),Ke("click",Mt,()=>p()),Oe(i,S),rr(),s()}Rl(["keydown","click","change"]);export{mg as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/6.jU9oGgW9.js.br b/apps/dashboard/build/_app/immutable/nodes/6.jU9oGgW9.js.br new file mode 100644 index 0000000..1a158b1 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/6.jU9oGgW9.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.jU9oGgW9.js.gz b/apps/dashboard/build/_app/immutable/nodes/6.jU9oGgW9.js.gz new file mode 100644 index 0000000..faff6ea Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/6.jU9oGgW9.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.B8i7WFBk.js b/apps/dashboard/build/_app/immutable/nodes/7.B8i7WFBk.js deleted file mode 100644 index 200e4ab..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/7.B8i7WFBk.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as ue}from"../chunks/BycUxjt3.js";import{p as fe,s as T,c as Q,t as u,a as ge,e as d,d as r,h as $,g as e,r as t,G as be}from"../chunks/DEYVqDYQ.js";import{d as ye,s as o,a as he}from"../chunks/ZM2C7QQX.js";import{i as R}from"../chunks/CpubbTHs.js";import{e as U,i as D}from"../chunks/CiJhRXcr.js";import{a as l,f as n}from"../chunks/D5-kFxsM.js";import{s as q}from"../chunks/zt9hmg4X.js";import{a as Z}from"../chunks/BcuCGYSa.js";var we=n(""),Re=n('
'),Ne=n('
'),Se=n('

Use "Remind me..." in conversation to create intentions.

'),ke=n(' '),Oe=n(' '),$e=n('

'),ze=n('
'),Ce=n('

No predictions yet. Use Vestige more to train the predictive model.

'),Ie=n(" "),Pe=n(' '),Te=n('

'),Ue=n('
'),De=n('

Intentions & Predictions

Prospective Memory

"Remember to do X when Y happens"

Predicted Needs

What you might need next
');function We(ee,te){fe(te,!0);let z=T(Q([])),j=T(Q([])),A=T(!0),N=T("active");const ae={active:"text-synapse-glow bg-synapse/10 border-synapse/30",fulfilled:"text-recall bg-recall/10 border-recall/30",cancelled:"text-dim bg-surface border-subtle/30",snoozed:"text-dream-glow bg-dream/10 border-dream/30"},re={critical:"text-decay",high:"text-amber-400",normal:"text-dim",low:"text-muted"},se={time:"⏰",context:"◎",event:"⚡"};ue(async()=>{await B()});async function B(){$(A,!0);try{const[s,i]=await Promise.all([Z.intentions(e(N)),Z.predict()]);$(z,s.intentions||[],!0),$(j,i.predictions||[],!0)}catch{}finally{$(A,!1)}}async function ie(s){$(N,s,!0),await B()}function F(s){if(!s)return"";try{return new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}var G=De(),L=r(G),H=d(r(L),2),de=r(H);t(H),t(L);var M=d(L,2),Y=d(r(M),2);U(Y,20,()=>["active","fulfilled","snoozed","cancelled","all"],D,(s,i)=>{var v=we(),a=r(v,!0);t(v),u(p=>{q(v,1,`px-3 py-1.5 rounded-lg text-xs transition ${e(N)===i?"bg-synapse/20 text-synapse-glow border border-synapse/40":"bg-surface/40 text-dim border border-subtle/20 hover:border-subtle/40"}`),o(a,p)},[()=>i.charAt(0).toUpperCase()+i.slice(1)]),he("click",v,()=>ie(i)),l(s,v)}),t(Y);var oe=d(Y,2);{var ve=s=>{var i=Ne();U(i,20,()=>Array(4),D,(v,a)=>{var p=Re();l(v,p)}),t(i),l(s,i)},le=s=>{var i=Se(),v=d(r(i),2),a=r(v);t(v),be(2),t(i),u(()=>o(a,`No ${e(N)==="all"?"":e(N)+" "}intentions.`)),l(s,i)},ne=s=>{var i=ze();U(i,21,()=>e(z),D,(v,a)=>{var p=$e(),g=r(p),b=r(g),C=r(b,!0);t(b);var f=d(b,2),S=r(f),I=r(S,!0);t(S);var y=d(S,2),h=r(y),P=r(h,!0);t(h);var w=d(h,2),E=r(w);t(w);var k=d(w,2),x=r(k);t(k);var c=d(k,2);{var O=m=>{var _=ke(),W=r(_);t(_),u(X=>o(W,`deadline: ${X??""}`),[()=>F(e(a).deadline)]),l(m,_)};R(c,m=>{e(a).deadline&&m(O)})}var V=d(c,2);{var me=m=>{var _=Oe(),W=r(_);t(_),u(X=>o(W,`snoozed until ${X??""}`),[()=>F(e(a).snoozed_until)]),l(m,_)};R(V,m=>{e(a).snoozed_until&&m(me)})}t(y),t(f);var K=d(f,2),_e=r(K,!0);t(K),t(g),t(p),u((m,_)=>{o(C,se[e(a).trigger_type]||"◇"),o(I,e(a).content),q(h,1,`px-2 py-0.5 text-[10px] rounded border ${(ae[e(a).status]||"text-dim bg-surface border-subtle/30")??""}`),o(P,e(a).status),q(w,1,`text-[10px] ${(re[e(a).priority]||"text-muted")??""}`),o(E,`${e(a).priority??""} priority`),o(x,`${e(a).trigger_type??""}: ${m??""}`),o(_e,_)},[()=>e(a).trigger_value.length>40?e(a).trigger_value.slice(0,37)+"...":e(a).trigger_value,()=>F(e(a).created_at)]),l(v,p)}),t(i),l(s,i)};R(oe,s=>{e(A)?s(ve):e(z).length===0?s(le,1):s(ne,!1)})}t(M);var J=d(M,2),ce=d(r(J),2);{var pe=s=>{var i=Ce();l(s,i)},xe=s=>{var i=Ue();U(i,21,()=>e(j),D,(v,a,p)=>{var g=Te(),b=r(g);b.textContent=p+1;var C=d(b,2),f=r(C),S=r(f,!0);t(f);var I=d(f,2),y=r(I),h=r(y,!0);t(y);var P=d(y,2);{var w=x=>{var c=Ie(),O=r(c);t(c),u(V=>o(O,`${V??""}% retention`),[()=>(Number(e(a).retention)*100).toFixed(0)]),l(x,c)};R(P,x=>{e(a).retention&&x(w)})}var E=d(P,2);{var k=x=>{var c=Pe(),O=r(c);t(c),u(()=>o(O,`${e(a).predictedNeed??""} need`)),l(x,c)};R(E,x=>{e(a).predictedNeed&&x(k)})}t(I),t(C),t(g),u(()=>{o(S,e(a).content),o(h,e(a).nodeType)}),l(v,g)}),t(i),l(s,i)};R(ce,s=>{e(j).length===0?s(pe):s(xe,!1)})}t(J),t(G),u(()=>o(de,`${e(z).length??""} intentions`)),l(ee,G),ge()}ye(["click"]);export{We as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/7.B8i7WFBk.js.br b/apps/dashboard/build/_app/immutable/nodes/7.B8i7WFBk.js.br deleted file mode 100644 index 83358ed..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/7.B8i7WFBk.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.B8i7WFBk.js.gz b/apps/dashboard/build/_app/immutable/nodes/7.B8i7WFBk.js.gz deleted file mode 100644 index 1c6d2ca..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/7.B8i7WFBk.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js b/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js new file mode 100644 index 0000000..82325de --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{o as ut}from"../chunks/CkyfbJUz.js";import{p as gt,s as T,c as Q,t as u,a as ft,d,e as s,h as $,g as t,r as e,G as ht}from"../chunks/C9Z4nxhR.js";import{d as bt,s as l,a as yt}from"../chunks/DP9qWekZ.js";import{i as R}from"../chunks/C2oj68pw.js";import{e as U,i as D}from"../chunks/kH-DTQyy.js";import{a as o,f as n}from"../chunks/DPfxVJHQ.js";import{s as q}from"../chunks/Co2v30Gm.js";import{a as Z}from"../chunks/BcuCGYSa.js";var wt=n(""),Rt=n('
'),Nt=n('
'),St=n('

Use "Remind me..." in conversation to create intentions.

'),kt=n(' '),Ot=n(' '),$t=n('

'),zt=n('
'),Ct=n('

No predictions yet. Use Vestige more to train the predictive model.

'),It=n(" "),Pt=n(' '),Tt=n('

'),Ut=n('
'),Dt=n('

Intentions & Predictions

Prospective Memory

"Remember to do X when Y happens"

Predicted Needs

What you might need next
');function Wt(tt,et){gt(et,!0);let z=T(Q([])),j=T(Q([])),A=T(!0),N=T("active");const at={active:"text-synapse-glow bg-synapse/10 border-synapse/30",fulfilled:"text-recall bg-recall/10 border-recall/30",cancelled:"text-dim bg-white/[0.03] border-subtle/20",snoozed:"text-dream-glow bg-dream/10 border-dream/30"},st={critical:"text-decay",high:"text-amber-400",normal:"text-dim",low:"text-muted"},rt={time:"⏰",context:"◎",event:"⚡"};ut(async()=>{await B()});async function B(){$(A,!0);try{const[r,i]=await Promise.all([Z.intentions(t(N)),Z.predict()]);$(z,r.intentions||[],!0),$(j,i.predictions||[],!0)}catch{}finally{$(A,!1)}}async function it(r){$(N,r,!0),await B()}function F(r){if(!r)return"";try{return new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return r}}var G=Dt(),L=s(G),H=d(s(L),2),dt=s(H);e(H),e(L);var M=d(L,2),Y=d(s(M),2);U(Y,20,()=>["active","fulfilled","snoozed","cancelled","all"],D,(r,i)=>{var v=wt(),a=s(v,!0);e(v),u(x=>{q(v,1,`px-3 py-1.5 rounded-xl text-xs transition ${t(N)===i?"bg-synapse/20 text-synapse-glow border border-synapse/40":"glass-subtle text-dim hover:bg-white/[0.03]"}`),l(a,x)},[()=>i.charAt(0).toUpperCase()+i.slice(1)]),yt("click",v,()=>it(i)),o(r,v)}),e(Y);var lt=d(Y,2);{var vt=r=>{var i=Nt();U(i,20,()=>Array(4),D,(v,a)=>{var x=Rt();o(v,x)}),e(i),o(r,i)},ot=r=>{var i=St(),v=d(s(i),2),a=s(v);e(v),ht(2),e(i),u(()=>l(a,`No ${t(N)==="all"?"":t(N)+" "}intentions.`)),o(r,i)},nt=r=>{var i=zt();U(i,21,()=>t(z),D,(v,a)=>{var x=$t(),f=s(x),h=s(f),C=s(h,!0);e(h);var g=d(h,2),S=s(g),I=s(S,!0);e(S);var b=d(S,2),y=s(b),P=s(y,!0);e(y);var w=d(y,2),E=s(w);e(w);var k=d(w,2),c=s(k);e(k);var p=d(k,2);{var O=m=>{var _=kt(),W=s(_);e(_),u(X=>l(W,`deadline: ${X??""}`),[()=>F(t(a).deadline)]),o(m,_)};R(p,m=>{t(a).deadline&&m(O)})}var V=d(p,2);{var mt=m=>{var _=Ot(),W=s(_);e(_),u(X=>l(W,`snoozed until ${X??""}`),[()=>F(t(a).snoozed_until)]),o(m,_)};R(V,m=>{t(a).snoozed_until&&m(mt)})}e(b),e(g);var K=d(g,2),_t=s(K,!0);e(K),e(f),e(x),u((m,_)=>{l(C,rt[t(a).trigger_type]||"◇"),l(I,t(a).content),q(y,1,`px-2 py-0.5 text-[10px] rounded-lg border ${(at[t(a).status]||"text-dim bg-white/[0.03] border-subtle/20")??""}`),l(P,t(a).status),q(w,1,`text-[10px] ${(st[t(a).priority]||"text-muted")??""}`),l(E,`${t(a).priority??""} priority`),l(c,`${t(a).trigger_type??""}: ${m??""}`),l(_t,_)},[()=>t(a).trigger_value.length>40?t(a).trigger_value.slice(0,37)+"...":t(a).trigger_value,()=>F(t(a).created_at)]),o(v,x)}),e(i),o(r,i)};R(lt,r=>{t(A)?r(vt):t(z).length===0?r(ot,1):r(nt,!1)})}e(M);var J=d(M,2),pt=d(s(J),2);{var xt=r=>{var i=Ct();o(r,i)},ct=r=>{var i=Ut();U(i,21,()=>t(j),D,(v,a,x)=>{var f=Tt(),h=s(f);h.textContent=x+1;var C=d(h,2),g=s(C),S=s(g,!0);e(g);var I=d(g,2),b=s(I),y=s(b,!0);e(b);var P=d(b,2);{var w=c=>{var p=It(),O=s(p);e(p),u(V=>l(O,`${V??""}% retention`),[()=>(Number(t(a).retention)*100).toFixed(0)]),o(c,p)};R(P,c=>{t(a).retention&&c(w)})}var E=d(P,2);{var k=c=>{var p=Pt(),O=s(p);e(p),u(()=>l(O,`${t(a).predictedNeed??""} need`)),o(c,p)};R(E,c=>{t(a).predictedNeed&&c(k)})}e(I),e(C),e(f),u(()=>{l(S,t(a).content),l(y,t(a).nodeType)}),o(v,f)}),e(i),o(r,i)};R(pt,r=>{t(j).length===0?r(xt):r(ct,!1)})}e(J),e(G),u(()=>l(dt,`${t(z).length??""} intentions`)),o(tt,G),ft()}bt(["click"]);export{Wt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.br b/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.br new file mode 100644 index 0000000..5467de2 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.gz b/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.gz new file mode 100644 index 0000000..5057033 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js b/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js new file mode 100644 index 0000000..6bbf26e --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js @@ -0,0 +1,4 @@ +import"../chunks/Bzak7iHL.js";import{o as qe}from"../chunks/CkyfbJUz.js";import{p as Be,s as b,c as Qe,t as E,g as e,a as Ye,d as t,e as s,h as u,r as a}from"../chunks/C9Z4nxhR.js";import{d as ze,a as p,s as v}from"../chunks/DP9qWekZ.js";import{i as ce}from"../chunks/C2oj68pw.js";import{e as Z,i as ue}from"../chunks/kH-DTQyy.js";import{a as _,f as g}from"../chunks/DPfxVJHQ.js";import{r as xe}from"../chunks/ZesQ8l8p.js";import{s as Ge}from"../chunks/Co2v30Gm.js";import{s as _e}from"../chunks/BkopTN9z.js";import{b as fe}from"../chunks/P9ZHwQBL.js";import{b as He}from"../chunks/-jeO_JOJ.js";import{a as f}from"../chunks/BcuCGYSa.js";import{N as Ie}from"../chunks/CZ45jJaw.js";var Je=g('
'),Ke=g('
'),Ue=g(' '),Ve=g('

Promote Demote Delete
'),We=g(''),Xe=g('
'),Ze=g(`

Memories

Min retention:
`);function xt(ge,me){Be(me,!0);let k=b(Qe([])),P=b(""),S=b(""),be="",h=b(0),F=b(!0),T=b(null),ee;qe(()=>m());async function m(){u(F,!0);try{const i={};e(P)&&(i.q=e(P)),e(S)&&(i.node_type=e(S)),e(h)>0&&(i.min_retention=String(e(h)));const c=await f.memories.list(i);u(k,c.memories,!0)}catch{u(k,[],!0)}finally{u(F,!1)}}function he(){clearTimeout(ee),ee=setTimeout(m,300)}function ye(i){return i>.7?"#10b981":i>.4?"#f59e0b":"#ef4444"}var M=Ze(),A=s(M),te=t(s(A),2),we=s(te);a(te),a(A);var C=t(A,2),$=s(C);xe($);var y=t($,2),N=s(y);N.value=N.__value="";var O=t(N);O.value=O.__value="fact";var R=t(O);R.value=R.__value="concept";var j=t(R);j.value=j.__value="event";var L=t(j);L.value=L.__value="person";var q=t(L);q.value=q.__value="place";var B=t(q);B.value=B.__value="note";var Q=t(B);Q.value=Q.__value="pattern";var ae=t(Q);ae.value=ae.__value="decision",a(y);var se=t(y,2),D=t(s(se),2);xe(D);var ie=t(D,2),ke=s(ie);a(ie),a(se),a(C);var Pe=t(C,2);{var Se=i=>{var c=Ke();Z(c,20,()=>Array(8),ue,(w,o)=>{var x=Je();_(w,x)}),a(c),_(i,c)},Te=i=>{var c=Xe();Z(c,21,()=>e(k),w=>w.id,(w,o)=>{var x=We(),Y=s(x),z=s(Y),G=s(z),oe=s(G),H=t(oe,2),$e=s(H,!0);a(H);var De=t(H,2);Z(De,17,()=>e(o).tags.slice(0,3),ue,(n,l)=>{var d=Ue(),J=s(d,!0);a(d),E(()=>v(J,e(l))),_(n,d)}),a(G);var re=t(G,2),Ee=s(re,!0);a(re),a(z);var ne=t(z,2),I=s(ne),Fe=s(I);a(I);var le=t(I,2),Me=s(le);a(le),a(ne),a(Y);var Ae=t(Y,2);{var Ce=n=>{var l=Ve(),d=s(l),J=s(d,!0);a(d);var K=t(d,2),U=s(K),Ne=s(U);a(U);var V=t(U,2),Oe=s(V);a(V);var de=t(V,2),Re=s(de);a(de),a(K);var pe=t(K,2),W=s(pe),X=t(W,2),ve=t(X,2);a(pe),a(l),E((r,je,Le)=>{v(J,e(o).content),v(Ne,`Storage: ${r??""}%`),v(Oe,`Retrieval: ${je??""}%`),v(Re,`Created: ${Le??""}`)},[()=>(e(o).storageStrength*100).toFixed(1),()=>(e(o).retrievalStrength*100).toFixed(1),()=>new Date(e(o).createdAt).toLocaleDateString()]),p("click",W,r=>{r.stopPropagation(),f.memories.promote(e(o).id)}),p("keydown",W,r=>{r.key==="Enter"&&(r.stopPropagation(),f.memories.promote(e(o).id))}),p("click",X,r=>{r.stopPropagation(),f.memories.demote(e(o).id)}),p("keydown",X,r=>{r.key==="Enter"&&(r.stopPropagation(),f.memories.demote(e(o).id))}),p("click",ve,async r=>{r.stopPropagation(),await f.memories.delete(e(o).id),m()}),p("keydown",ve,async r=>{r.key==="Enter"&&(r.stopPropagation(),await f.memories.delete(e(o).id),m())}),_(n,l)};ce(Ae,n=>{var l;((l=e(T))==null?void 0:l.id)===e(o).id&&n(Ce)})}a(x),E((n,l)=>{var d;Ge(x,1,`text-left p-4 glass-subtle rounded-xl hover:bg-white/[0.04] + transition-all duration-200 group + ${((d=e(T))==null?void 0:d.id)===e(o).id?"!border-synapse/40 glow-synapse":""}`),_e(oe,`background: ${(Ie[e(o).nodeType]||"#8B95A5")??""}`),v($e,e(o).nodeType),v(Ee,e(o).content),_e(Fe,`width: ${e(o).retentionStrength*100}%; background: ${n??""}`),v(Me,`${l??""}%`)},[()=>ye(e(o).retentionStrength),()=>(e(o).retentionStrength*100).toFixed(0)]),p("click",x,()=>{var n;return u(T,((n=e(T))==null?void 0:n.id)===e(o).id?null:e(o),!0)}),_(w,x)}),a(c),_(i,c)};ce(Pe,i=>{e(F)?i(Se):i(Te,!1)})}a(M),E(i=>{v(we,`${e(k).length??""} results`),v(ke,`${i??""}%`)},[()=>(e(h)*100).toFixed(0)]),p("input",$,he),fe($,()=>e(P),i=>u(P,i)),p("change",y,m),He(y,()=>e(S),i=>u(S,i)),p("change",D,m),fe(D,()=>e(h),i=>u(h,i)),_(ge,M),Ye()}ze(["input","change","click","keydown"]);export{xt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.br b/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.br new file mode 100644 index 0000000..28cfe5e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.gz b/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.gz new file mode 100644 index 0000000..8b7d58d Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.yF23YJzi.js b/apps/dashboard/build/_app/immutable/nodes/8.yF23YJzi.js deleted file mode 100644 index a2bdb9f..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/8.yF23YJzi.js +++ /dev/null @@ -1,4 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as qe}from"../chunks/BycUxjt3.js";import{p as Qe,s as b,c as Ye,t as E,g as e,a as ze,d as o,e as t,h as u,r as a}from"../chunks/DEYVqDYQ.js";import{d as Be,a as p,s as v}from"../chunks/ZM2C7QQX.js";import{i as ce}from"../chunks/CpubbTHs.js";import{e as Z,i as ue}from"../chunks/CiJhRXcr.js";import{a as x,f as g}from"../chunks/D5-kFxsM.js";import{b as _e,r as xe}from"../chunks/Bew31VOg.js";import{s as Ge}from"../chunks/zt9hmg4X.js";import{s as fe}from"../chunks/B9t3YtL9.js";import{b as He}from"../chunks/DNwVrE-V.js";import{a as f}from"../chunks/BcuCGYSa.js";import{N as Ie}from"../chunks/Dwpy08gq.js";var Je=g('
'),Ke=g('
'),Ue=g(' '),Ve=g('

Promote Demote Delete
'),We=g(''),Xe=g('
'),Ze=g(`

Memories

Min retention:
`);function ut(ge,me){Qe(me,!0);let k=b(Ye([])),P=b(""),S=b(""),be="",h=b(0),F=b(!0),T=b(null),ee;qe(()=>m());async function m(){u(F,!0);try{const r={};e(P)&&(r.q=e(P)),e(S)&&(r.node_type=e(S)),e(h)>0&&(r.min_retention=String(e(h)));const c=await f.memories.list(r);u(k,c.memories,!0)}catch{u(k,[],!0)}finally{u(F,!1)}}function he(){clearTimeout(ee),ee=setTimeout(m,300)}function ye(r){return r>.7?"#10b981":r>.4?"#f59e0b":"#ef4444"}var M=Ze(),C=o(M),te=t(o(C),2),we=o(te);a(te),a(C);var A=t(C,2),$=o(A);xe($);var y=t($,2),N=o(y);N.value=N.__value="";var O=t(N);O.value=O.__value="fact";var R=t(O);R.value=R.__value="concept";var j=t(R);j.value=j.__value="event";var L=t(j);L.value=L.__value="person";var q=t(L);q.value=q.__value="place";var Q=t(q);Q.value=Q.__value="note";var Y=t(Q);Y.value=Y.__value="pattern";var ae=t(Y);ae.value=ae.__value="decision",a(y);var oe=t(y,2),D=t(o(oe),2);xe(D);var re=t(D,2),ke=o(re);a(re),a(oe),a(A);var Pe=t(A,2);{var Se=r=>{var c=Ke();Z(c,20,()=>Array(8),ue,(w,s)=>{var _=Je();x(w,_)}),a(c),x(r,c)},Te=r=>{var c=Xe();Z(c,21,()=>e(k),w=>w.id,(w,s)=>{var _=We(),z=o(_),B=o(z),G=o(B),se=o(G),H=t(se,2),$e=o(H,!0);a(H);var De=t(H,2);Z(De,17,()=>e(s).tags.slice(0,3),ue,(n,d)=>{var l=Ue(),J=o(l,!0);a(l),E(()=>v(J,e(d))),x(n,l)}),a(G);var ie=t(G,2),Ee=o(ie,!0);a(ie),a(B);var ne=t(B,2),I=o(ne),Fe=o(I);a(I);var de=t(I,2),Me=o(de);a(de),a(ne),a(z);var Ce=t(z,2);{var Ae=n=>{var d=Ve(),l=o(d),J=o(l,!0);a(l);var K=t(l,2),U=o(K),Ne=o(U);a(U);var V=t(U,2),Oe=o(V);a(V);var le=t(V,2),Re=o(le);a(le),a(K);var pe=t(K,2),W=o(pe),X=t(W,2),ve=t(X,2);a(pe),a(d),E((i,je,Le)=>{v(J,e(s).content),v(Ne,`Storage: ${i??""}%`),v(Oe,`Retrieval: ${je??""}%`),v(Re,`Created: ${Le??""}`)},[()=>(e(s).storageStrength*100).toFixed(1),()=>(e(s).retrievalStrength*100).toFixed(1),()=>new Date(e(s).createdAt).toLocaleDateString()]),p("click",W,i=>{i.stopPropagation(),f.memories.promote(e(s).id)}),p("keydown",W,i=>{i.key==="Enter"&&(i.stopPropagation(),f.memories.promote(e(s).id))}),p("click",X,i=>{i.stopPropagation(),f.memories.demote(e(s).id)}),p("keydown",X,i=>{i.key==="Enter"&&(i.stopPropagation(),f.memories.demote(e(s).id))}),p("click",ve,async i=>{i.stopPropagation(),await f.memories.delete(e(s).id),m()}),p("keydown",ve,async i=>{i.key==="Enter"&&(i.stopPropagation(),await f.memories.delete(e(s).id),m())}),x(n,d)};ce(Ce,n=>{var d;((d=e(T))==null?void 0:d.id)===e(s).id&&n(Ae)})}a(_),E((n,d)=>{var l;Ge(_,1,`text-left p-4 bg-surface/50 border border-subtle/20 rounded-lg hover:border-synapse/30 - hover:bg-surface transition-all duration-200 group - ${((l=e(T))==null?void 0:l.id)===e(s).id?"border-synapse/50 glow-synapse":""}`),fe(se,`background: ${(Ie[e(s).nodeType]||"#6b7280")??""}`),v($e,e(s).nodeType),v(Ee,e(s).content),fe(Fe,`width: ${e(s).retentionStrength*100}%; background: ${n??""}`),v(Me,`${d??""}%`)},[()=>ye(e(s).retentionStrength),()=>(e(s).retentionStrength*100).toFixed(0)]),p("click",_,()=>{var n;return u(T,((n=e(T))==null?void 0:n.id)===e(s).id?null:e(s),!0)}),x(w,_)}),a(c),x(r,c)};ce(Pe,r=>{e(F)?r(Se):r(Te,!1)})}a(M),E(r=>{v(we,`${e(k).length??""} results`),v(ke,`${r??""}%`)},[()=>(e(h)*100).toFixed(0)]),p("input",$,he),_e($,()=>e(P),r=>u(P,r)),p("change",y,m),He(y,()=>e(S),r=>u(S,r)),p("change",D,m),_e(D,()=>e(h),r=>u(h,r)),x(ge,M),ze()}Be(["input","change","click","keydown"]);export{ut as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/8.yF23YJzi.js.br b/apps/dashboard/build/_app/immutable/nodes/8.yF23YJzi.js.br deleted file mode 100644 index 79a5eef..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/8.yF23YJzi.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.yF23YJzi.js.gz b/apps/dashboard/build/_app/immutable/nodes/8.yF23YJzi.js.gz deleted file mode 100644 index f78552a..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/8.yF23YJzi.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js b/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js new file mode 100644 index 0000000..6b5d886 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js @@ -0,0 +1,2 @@ +import"../chunks/Bzak7iHL.js";import{o as ze}from"../chunks/CkyfbJUz.js";import{p as Je,t as w,a as We,d as r,e as t,g as s,s as S,h as m,r as e,G as b,f as Be,u as j}from"../chunks/C9Z4nxhR.js";import{d as He,a as X,s as p}from"../chunks/DP9qWekZ.js";import{i as u}from"../chunks/C2oj68pw.js";import{e as Z,i as ee}from"../chunks/kH-DTQyy.js";import{a as v,f as l,t as ue}from"../chunks/DPfxVJHQ.js";import{s as ge}from"../chunks/Co2v30Gm.js";import{s as fe}from"../chunks/BkopTN9z.js";import{s as Le,a as te}from"../chunks/DWr9YED7.js";import{a as T}from"../chunks/BcuCGYSa.js";import{m as Ue,a as Ye,i as qe}from"../chunks/BmeMLq0p.js";var Qe=l(' Running...',1),Xe=l('
Processed
'),Ze=l('
Decayed
'),et=l('
Embedded
'),tt=l('
'),st=l(' Dreaming...',1),at=l('
'),it=l('
Insights Discovered:
',1),dt=l('
Connections found:
'),rt=l('
Memories replayed:
'),ot=l('
'),nt=l('
'),vt=l('
'),lt=l('

Retention Distribution

'),ct=l('
'),xt=l(`

Settings & System

Memories
Avg Retention
WebSocket
v2.1
Vestige

Cognitive Operations

FSRS-6 Consolidation
Apply spaced-repetition decay, regenerate embeddings, run maintenance
Memory Dream Cycle
Replay memories, discover hidden connections, synthesize insights

Keyboard Shortcuts

About

V
Vestige v2.1 "Nuclear Dashboard"
Your AI's long-term memory system
29 cognitive modules
FSRS-6 spaced repetition
Nomic Embed v1.5 (256d)
Jina Reranker v1 Turbo
USearch HNSW (20x FAISS)
Local-first, zero cloud
Built with Rust + Axum + SvelteKit 2 + Svelte 5 + Three.js + Tailwind CSS 4
`);function Ct(_e,be){Je(be,!0);const ye=()=>te(Ue,"$memoryCount",I),P=()=>te(Ye,"$avgRetention",I),se=()=>te(qe,"$isConnected",I),[I,he]=Le();let E=S(!1),A=S(!1),y=S(null),g=S(null),we=S(null),$=S(null),ae=S(!0),Se=S(null);ze(()=>{N()});async function N(){m(ae,!0);try{const[a,o,c]=await Promise.all([T.stats().catch(()=>null),T.health().catch(()=>null),T.retentionDistribution().catch(()=>null)]);m(we,a,!0),m(Se,o,!0),m($,c,!0)}finally{m(ae,!1)}}async function ke(){m(E,!0),m(y,null);try{m(y,await T.consolidate(),!0),await N()}catch{}finally{m(E,!1)}}async function Ce(){m(A,!0),m(g,null);try{m(g,await T.dream(),!0),await N()}catch{}finally{m(A,!1)}}var K=xt(),V=t(K),Re=r(t(V),2);e(V);var z=r(V,2),J=t(z),ie=t(J),$e=t(ie,!0);e(ie),b(2),e(J);var W=r(J,2),B=t(W),Ae=t(B);e(B),b(2),e(W);var de=r(W,2),re=t(de),oe=t(re),ne=r(oe,2),De=t(ne,!0);e(ne),e(re),b(2),e(de),b(2),e(z);var H=r(z,2),L=r(t(H),2),U=t(L),O=r(t(U),2),Ge=t(O);{var Me=a=>{var o=Qe();b(),v(a,o)},Fe=a=>{var o=ue("Consolidate");v(a,o)};u(Ge,a=>{s(E)?a(Me):a(Fe,!1)})}e(O),e(U);var je=r(U,2);{var Te=a=>{var o=tt(),c=t(o),f=t(c);{var k=d=>{var i=Xe(),n=t(i),x=t(n,!0);e(n),b(2),e(i),w(()=>p(x,s(y).nodesProcessed)),v(d,i)};u(f,d=>{s(y).nodesProcessed!==void 0&&d(k)})}var _=r(f,2);{var h=d=>{var i=Ze(),n=t(i),x=t(n,!0);e(n),b(2),e(i),w(()=>p(x,s(y).decayApplied)),v(d,i)};u(_,d=>{s(y).decayApplied!==void 0&&d(h)})}var C=r(_,2);{var G=d=>{var i=et(),n=t(i),x=t(n,!0);e(n),b(2),e(i),w(()=>p(x,s(y).embeddingsGenerated)),v(d,i)};u(C,d=>{s(y).embeddingsGenerated!==void 0&&d(G)})}e(c),e(o),v(a,o)};u(je,a=>{s(y)&&a(Te)})}e(L);var ve=r(L,2),Y=t(ve),D=r(t(Y),2),Ee=t(D);{var Ne=a=>{var o=st();b(),v(a,o)},Oe=a=>{var o=ue("Dream");v(a,o)};u(Ee,a=>{s(A)?a(Ne):a(Oe,!1)})}e(D),e(Y);var Pe=r(Y,2);{var Ie=a=>{var o=ot(),c=t(o);{var f=d=>{var i=it(),n=r(Be(i),2);Z(n,17,()=>s(g).insights,ee,(x,M)=>{var R=at(),F=t(R,!0);e(R),w(q=>p(F,q),[()=>typeof s(M)=="string"?s(M):JSON.stringify(s(M))]),v(x,R)}),v(d,i)},k=j(()=>s(g).insights&&Array.isArray(s(g).insights));u(c,d=>{s(k)&&d(f)})}var _=r(c,2);{var h=d=>{var i=dt(),n=r(t(i)),x=t(n,!0);e(n),e(i),w(()=>p(x,s(g).connections_found)),v(d,i)};u(_,d=>{s(g).connections_found!==void 0&&d(h)})}var C=r(_,2);{var G=d=>{var i=rt(),n=r(t(i)),x=t(n,!0);e(n),e(i),w(()=>p(x,s(g).memories_replayed)),v(d,i)};u(C,d=>{s(g).memories_replayed!==void 0&&d(G)})}e(o),v(a,o)};u(Pe,a=>{s(g)&&a(Ie)})}e(ve),e(H);var le=r(H,2);{var Ke=a=>{var o=lt(),c=r(t(o),2),f=t(c);{var k=h=>{var C=vt();Z(C,21,()=>s($).distribution,ee,(G,d,i)=>{const n=j(()=>Math.max(...s($).distribution.map(Q=>Q.count),1)),x=j(()=>s(d).count/s(n)*100),M=j(()=>i<2?"#ef4444":i<4?"#f59e0b":i<7?"#6366f1":"#10b981");var R=nt(),F=t(R),q=t(F,!0);e(F);var pe=r(F,2),Ve=r(pe,2);Ve.textContent=`${i*10}%`,e(R),w(Q=>{p(q,s(d).count),fe(pe,`height: ${Q??""}%; background: ${s(M)??""}; opacity: 0.7`)},[()=>Math.max(s(x),2)]),v(G,R)}),e(C),v(h,C)},_=j(()=>s($).distribution&&Array.isArray(s($).distribution));u(f,h=>{s(_)&&h(k)})}e(c),e(o),v(a,o)};u(le,a=>{s($)&&a(Ke)})}var ce=r(le,2),xe=r(t(ce),2),me=t(xe);Z(me,20,()=>[{key:"⌘ K",desc:"Command palette"},{key:"/",desc:"Focus search"},{key:"G",desc:"Go to Graph"},{key:"M",desc:"Go to Memories"},{key:"T",desc:"Go to Timeline"},{key:"F",desc:"Go to Feed"},{key:"E",desc:"Go to Explore"},{key:"S",desc:"Go to Stats"}],ee,(a,o)=>{var c=ct(),f=t(c),k=t(f,!0);e(f);var _=r(f,2),h=t(_,!0);e(_),e(c),w(()=>{p(k,o.key),p(h,o.desc)}),v(a,c)}),e(me),e(xe),e(ce),b(2),e(K),w(a=>{p($e,ye()),fe(B,`color: ${P()>.7?"#10b981":P()>.4?"#f59e0b":"#ef4444"}`),p(Ae,`${a??""}%`),ge(oe,1,`w-2.5 h-2.5 rounded-full ${se()?"bg-recall animate-pulse-glow":"bg-decay"}`),p(De,se()?"Online":"Offline"),O.disabled=s(E),D.disabled=s(A),ge(D,1,`px-4 py-2 bg-dream/20 border border-dream/40 text-dream-glow text-sm rounded-xl hover:bg-dream/30 transition disabled:opacity-50 flex items-center gap-2 + ${s(A)?"glow-dream animate-pulse-glow":""}`)},[()=>(P()*100).toFixed(1)]),X("click",Re,N),X("click",O,ke),X("click",D,Ce),v(_e,K),We(),he()}He(["click"]);export{Ct as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.br b/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.br new file mode 100644 index 0000000..76953f8 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.gz b/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.gz new file mode 100644 index 0000000..1aab59f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.DHKRJT48.js b/apps/dashboard/build/_app/immutable/nodes/9.DHKRJT48.js deleted file mode 100644 index bff3e1b..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/9.DHKRJT48.js +++ /dev/null @@ -1,2 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as ze}from"../chunks/BycUxjt3.js";import{p as Je,t as w,a as Le,g as s,d as t,e as d,s as S,h as m,r as e,G as _,f as We,u as j}from"../chunks/DEYVqDYQ.js";import{d as Be,a as X,s as u}from"../chunks/ZM2C7QQX.js";import{i as p}from"../chunks/CpubbTHs.js";import{e as Z,i as ee}from"../chunks/CiJhRXcr.js";import{a as v,f as l,t as pe}from"../chunks/D5-kFxsM.js";import{s as be}from"../chunks/zt9hmg4X.js";import{s as ge}from"../chunks/B9t3YtL9.js";import{s as He,a as te}from"../chunks/DUZi1B8N.js";import{a as T}from"../chunks/BcuCGYSa.js";import{m as Ue,a as Ye,i as qe}from"../chunks/DmEsXEQB.js";var Qe=l(' Running...',1),Xe=l('
Processed
'),Ze=l('
Decayed
'),et=l('
Embedded
'),tt=l('
'),st=l(' Dreaming...',1),at=l('
'),rt=l('
Insights Discovered:
',1),it=l('
Connections found:
'),dt=l('
Memories replayed:
'),ot=l('
'),nt=l('
'),vt=l('
'),lt=l('

Retention Distribution

'),ct=l('
'),xt=l(`

Settings & System

Memories
Avg Retention
WebSocket
v2.0
Vestige

Cognitive Operations

FSRS-6 Consolidation
Apply spaced-repetition decay, regenerate embeddings, run maintenance
Memory Dream Cycle
Replay memories, discover hidden connections, synthesize insights

Keyboard Shortcuts

About

V
Vestige v2.0 "Cognitive Leap"
Your AI's long-term memory system
29 cognitive modules
FSRS-6 spaced repetition
Nomic Embed v1.5 (256d)
Jina Reranker v1 Turbo
USearch HNSW (20x FAISS)
Local-first, zero cloud
Built with Rust + Axum + SvelteKit 2 + Svelte 5 + Three.js + Tailwind CSS 4
`);function Ct(fe,_e){Je(_e,!0);const ye=()=>te(Ue,"$memoryCount",K),I=()=>te(Ye,"$avgRetention",K),se=()=>te(qe,"$isConnected",K),[K,he]=He();let E=S(!1),A=S(!1),y=S(null),b=S(null),we=S(null),$=S(null),ae=S(!0),Se=S(null);ze(()=>{O()});async function O(){m(ae,!0);try{const[a,o,c]=await Promise.all([T.stats().catch(()=>null),T.health().catch(()=>null),T.retentionDistribution().catch(()=>null)]);m(we,a,!0),m(Se,o,!0),m($,c,!0)}finally{m(ae,!1)}}async function ke(){m(E,!0),m(y,null);try{m(y,await T.consolidate(),!0),await O()}catch{}finally{m(E,!1)}}async function Ce(){m(A,!0),m(b,null);try{m(b,await T.dream(),!0),await O()}catch{}finally{m(A,!1)}}var N=xt(),V=t(N),Re=d(t(V),2);e(V);var z=d(V,2),J=t(z),re=t(J),$e=t(re,!0);e(re),_(2),e(J);var L=d(J,2),W=t(L),Ae=t(W);e(W),_(2),e(L);var ie=d(L,2),de=t(ie),oe=t(de),ne=d(oe,2),Ge=t(ne,!0);e(ne),e(de),_(2),e(ie),_(2),e(z);var B=d(z,2),H=d(t(B),2),U=t(H),P=d(t(U),2),De=t(P);{var Me=a=>{var o=Qe();_(),v(a,o)},Fe=a=>{var o=pe("Consolidate");v(a,o)};p(De,a=>{s(E)?a(Me):a(Fe,!1)})}e(P),e(U);var je=d(U,2);{var Te=a=>{var o=tt(),c=t(o),g=t(c);{var k=i=>{var r=Xe(),n=t(r),x=t(n,!0);e(n),_(2),e(r),w(()=>u(x,s(y).nodesProcessed)),v(i,r)};p(g,i=>{s(y).nodesProcessed!==void 0&&i(k)})}var f=d(g,2);{var h=i=>{var r=Ze(),n=t(r),x=t(n,!0);e(n),_(2),e(r),w(()=>u(x,s(y).decayApplied)),v(i,r)};p(f,i=>{s(y).decayApplied!==void 0&&i(h)})}var C=d(f,2);{var D=i=>{var r=et(),n=t(r),x=t(n,!0);e(n),_(2),e(r),w(()=>u(x,s(y).embeddingsGenerated)),v(i,r)};p(C,i=>{s(y).embeddingsGenerated!==void 0&&i(D)})}e(c),e(o),v(a,o)};p(je,a=>{s(y)&&a(Te)})}e(H);var ve=d(H,2),Y=t(ve),G=d(t(Y),2),Ee=t(G);{var Oe=a=>{var o=st();_(),v(a,o)},Pe=a=>{var o=pe("Dream");v(a,o)};p(Ee,a=>{s(A)?a(Oe):a(Pe,!1)})}e(G),e(Y);var Ie=d(Y,2);{var Ke=a=>{var o=ot(),c=t(o);{var g=i=>{var r=rt(),n=d(We(r),2);Z(n,17,()=>s(b).insights,ee,(x,M)=>{var R=at(),F=t(R,!0);e(R),w(q=>u(F,q),[()=>typeof s(M)=="string"?s(M):JSON.stringify(s(M))]),v(x,R)}),v(i,r)},k=j(()=>s(b).insights&&Array.isArray(s(b).insights));p(c,i=>{s(k)&&i(g)})}var f=d(c,2);{var h=i=>{var r=it(),n=d(t(r)),x=t(n,!0);e(n),e(r),w(()=>u(x,s(b).connections_found)),v(i,r)};p(f,i=>{s(b).connections_found!==void 0&&i(h)})}var C=d(f,2);{var D=i=>{var r=dt(),n=d(t(r)),x=t(n,!0);e(n),e(r),w(()=>u(x,s(b).memories_replayed)),v(i,r)};p(C,i=>{s(b).memories_replayed!==void 0&&i(D)})}e(o),v(a,o)};p(Ie,a=>{s(b)&&a(Ke)})}e(ve),e(B);var le=d(B,2);{var Ne=a=>{var o=lt(),c=d(t(o),2),g=t(c);{var k=h=>{var C=vt();Z(C,21,()=>s($).distribution,ee,(D,i,r)=>{const n=j(()=>Math.max(...s($).distribution.map(Q=>Q.count),1)),x=j(()=>s(i).count/s(n)*100),M=j(()=>r<2?"#ef4444":r<4?"#f59e0b":r<7?"#6366f1":"#10b981");var R=nt(),F=t(R),q=t(F,!0);e(F);var ue=d(F,2),Ve=d(ue,2);Ve.textContent=`${r*10}%`,e(R),w(Q=>{u(q,s(i).count),ge(ue,`height: ${Q??""}%; background: ${s(M)??""}; opacity: 0.7`)},[()=>Math.max(s(x),2)]),v(D,R)}),e(C),v(h,C)},f=j(()=>s($).distribution&&Array.isArray(s($).distribution));p(g,h=>{s(f)&&h(k)})}e(c),e(o),v(a,o)};p(le,a=>{s($)&&a(Ne)})}var ce=d(le,2),xe=d(t(ce),2),me=t(xe);Z(me,20,()=>[{key:"⌘ K",desc:"Command palette"},{key:"/",desc:"Focus search"},{key:"G",desc:"Go to Graph"},{key:"M",desc:"Go to Memories"},{key:"T",desc:"Go to Timeline"},{key:"F",desc:"Go to Feed"},{key:"E",desc:"Go to Explore"},{key:"S",desc:"Go to Stats"}],ee,(a,o)=>{var c=ct(),g=t(c),k=t(g,!0);e(g);var f=d(g,2),h=t(f,!0);e(f),e(c),w(()=>{u(k,o.key),u(h,o.desc)}),v(a,c)}),e(me),e(xe),e(ce),_(2),e(N),w(a=>{u($e,ye()),ge(W,`color: ${I()>.7?"#10b981":I()>.4?"#f59e0b":"#ef4444"}`),u(Ae,`${a??""}%`),be(oe,1,`w-2.5 h-2.5 rounded-full ${se()?"bg-recall animate-pulse-glow":"bg-decay"}`),u(Ge,se()?"Online":"Offline"),P.disabled=s(E),G.disabled=s(A),be(G,1,`px-4 py-2 bg-dream/20 border border-dream/40 text-dream-glow text-sm rounded-lg hover:bg-dream/30 transition disabled:opacity-50 flex items-center gap-2 - ${s(A)?"glow-dream animate-pulse-glow":""}`)},[()=>(I()*100).toFixed(1)]),X("click",Re,O),X("click",P,ke),X("click",G,Ce),v(fe,N),Le(),he()}Be(["click"]);export{Ct as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/9.DHKRJT48.js.br b/apps/dashboard/build/_app/immutable/nodes/9.DHKRJT48.js.br deleted file mode 100644 index 217f75f..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/9.DHKRJT48.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.DHKRJT48.js.gz b/apps/dashboard/build/_app/immutable/nodes/9.DHKRJT48.js.gz deleted file mode 100644 index affe24c..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/9.DHKRJT48.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/version.json b/apps/dashboard/build/_app/version.json index 90aa5b4..7b3cd2d 100644 --- a/apps/dashboard/build/_app/version.json +++ b/apps/dashboard/build/_app/version.json @@ -1 +1 @@ -{"version":"1771796675335"} \ No newline at end of file +{"version":"1772420685161"} \ No newline at end of file diff --git a/apps/dashboard/build/_app/version.json.br b/apps/dashboard/build/_app/version.json.br index 486c63f..e509b67 100644 Binary files a/apps/dashboard/build/_app/version.json.br and b/apps/dashboard/build/_app/version.json.br differ diff --git a/apps/dashboard/build/_app/version.json.gz b/apps/dashboard/build/_app/version.json.gz index 23e9cc5..8405b55 100644 Binary files a/apps/dashboard/build/_app/version.json.gz and b/apps/dashboard/build/_app/version.json.gz differ diff --git a/apps/dashboard/build/index.html b/apps/dashboard/build/index.html index 4a57042..ba24d23 100644 --- a/apps/dashboard/build/index.html +++ b/apps/dashboard/build/index.html @@ -11,20 +11,20 @@ - - - - - - - - + + + + + + + + - - - - - + + + + + Vestige @@ -32,7 +32,7 @@
+ +
+
+ Cognitive Search Pipeline + {#if showResult} + {resultCount} results in {durationMs}ms + {/if} +
+ + +
+ {#each stages as stage, i} + {@const isActive = i <= activeStage} + {@const isCurrent = i === activeStage && animating} + + +
+
+ {stage.icon} +
+ + {stage.name} + +
+ + + {#if i < stages.length - 1} +
+
+ {/if} + {/each} +
+ + +
+ {#if animating || showResult} +
+ {/if} +
+ + + {#if showResult} +
+
+ + Pipeline complete: {resultCount} memories surfaced from {stages.length}-stage cognitive cascade + +
+ {/if} +
+ + diff --git a/apps/dashboard/src/lib/components/TimeSlider.svelte b/apps/dashboard/src/lib/components/TimeSlider.svelte new file mode 100644 index 0000000..6d96318 --- /dev/null +++ b/apps/dashboard/src/lib/components/TimeSlider.svelte @@ -0,0 +1,144 @@ + + +{#if enabled} +
+
+
+
+ + + +
+ + {formatDate(currentDate)} + + +
+ + + +
+ {formatDate(dateRange.oldest)} + {formatDate(dateRange.newest)} +
+
+
+{:else} + +{/if} diff --git a/apps/dashboard/src/lib/graph/dream-mode.ts b/apps/dashboard/src/lib/graph/dream-mode.ts new file mode 100644 index 0000000..cd999ab --- /dev/null +++ b/apps/dashboard/src/lib/graph/dream-mode.ts @@ -0,0 +1,102 @@ +import * as THREE from 'three'; +import type { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js'; +import type { OrbitControls } from 'three/addons/controls/OrbitControls.js'; + +export interface DreamConfig { + bloomStrength: number; + rotateSpeed: number; + fogColor: number; + fogDensity: number; + nebulaIntensity: number; + chromaticIntensity: number; + vignetteRadius: number; + breatheAmplitude: number; +} + +const NORMAL_CONFIG: DreamConfig = { + bloomStrength: 0.8, + rotateSpeed: 0.3, + fogColor: 0x050510, + fogDensity: 0.008, + nebulaIntensity: 0, + chromaticIntensity: 0.002, + vignetteRadius: 0.9, + breatheAmplitude: 1.0, +}; + +const DREAM_CONFIG: DreamConfig = { + bloomStrength: 1.8, + rotateSpeed: 0.08, + fogColor: 0x0a0520, + fogDensity: 0.006, + nebulaIntensity: 1.0, + chromaticIntensity: 0.005, + vignetteRadius: 0.7, + breatheAmplitude: 2.0, +}; + +export class DreamMode { + active = false; + private transition = 0; // 0 = normal, 1 = dream + private transitionSpeed = 0.008; // ~2 seconds at 60fps + current: DreamConfig; + private auroraHue = 0; + + constructor() { + this.current = { ...NORMAL_CONFIG }; + } + + setActive(active: boolean) { + this.active = active; + } + + update( + scene: THREE.Scene, + bloomPass: UnrealBloomPass, + controls: OrbitControls, + lights: { point1: THREE.PointLight; point2: THREE.PointLight }, + _time: number + ) { + // Smooth transition + const target = this.active ? 1 : 0; + this.transition += (target - this.transition) * this.transitionSpeed * 60 * (1 / 60); + this.transition = Math.max(0, Math.min(1, this.transition)); + + const t = this.transition; + + // Lerp all config values + this.current.bloomStrength = this.lerp(NORMAL_CONFIG.bloomStrength, DREAM_CONFIG.bloomStrength, t); + this.current.rotateSpeed = this.lerp(NORMAL_CONFIG.rotateSpeed, DREAM_CONFIG.rotateSpeed, t); + this.current.fogDensity = this.lerp(NORMAL_CONFIG.fogDensity, DREAM_CONFIG.fogDensity, t); + this.current.nebulaIntensity = this.lerp(NORMAL_CONFIG.nebulaIntensity, DREAM_CONFIG.nebulaIntensity, t); + this.current.chromaticIntensity = this.lerp(NORMAL_CONFIG.chromaticIntensity, DREAM_CONFIG.chromaticIntensity, t); + this.current.vignetteRadius = this.lerp(NORMAL_CONFIG.vignetteRadius, DREAM_CONFIG.vignetteRadius, t); + this.current.breatheAmplitude = this.lerp(NORMAL_CONFIG.breatheAmplitude, DREAM_CONFIG.breatheAmplitude, t); + + // Apply + bloomPass.strength = this.current.bloomStrength; + controls.autoRotateSpeed = this.current.rotateSpeed; + + // Fog color lerp + const normalFog = new THREE.Color(NORMAL_CONFIG.fogColor); + const dreamFog = new THREE.Color(DREAM_CONFIG.fogColor); + const fogColor = normalFog.clone().lerp(dreamFog, t); + scene.fog = new THREE.FogExp2(fogColor, this.current.fogDensity); + + // Aurora color cycling during dream + if (t > 0.01) { + this.auroraHue = (_time * 0.1) % 1; + const auroraColor1 = new THREE.Color().setHSL(0.75 + this.auroraHue * 0.15, 0.8, 0.5); + const auroraColor2 = new THREE.Color().setHSL(0.55 + this.auroraHue * 0.2, 0.7, 0.4); + lights.point1.color.lerp(auroraColor1, t * 0.3); + lights.point2.color.lerp(auroraColor2, t * 0.3); + } else { + lights.point1.color.set(0x6366f1); + lights.point2.color.set(0xa855f7); + } + } + + private lerp(a: number, b: number, t: number): number { + return a + (b - a) * t; + } +} diff --git a/apps/dashboard/src/lib/graph/edges.ts b/apps/dashboard/src/lib/graph/edges.ts new file mode 100644 index 0000000..5050fd9 --- /dev/null +++ b/apps/dashboard/src/lib/graph/edges.ts @@ -0,0 +1,53 @@ +import * as THREE from 'three'; +import type { GraphEdge } from '$types'; + +export class EdgeManager { + group: THREE.Group; + + constructor() { + this.group = new THREE.Group(); + } + + createEdges(edges: GraphEdge[], positions: Map) { + for (const edge of edges) { + const sourcePos = positions.get(edge.source); + const targetPos = positions.get(edge.target); + if (!sourcePos || !targetPos) continue; + + const points = [sourcePos, targetPos]; + const geometry = new THREE.BufferGeometry().setFromPoints(points); + const material = new THREE.LineBasicMaterial({ + color: 0x4a4a7a, + transparent: true, + opacity: Math.min(0.1 + edge.weight * 0.5, 0.6), + blending: THREE.AdditiveBlending, + }); + + const line = new THREE.Line(geometry, material); + line.userData = { source: edge.source, target: edge.target }; + this.group.add(line); + } + } + + updatePositions(positions: Map) { + this.group.children.forEach((child) => { + const line = child as THREE.Line; + const sourcePos = positions.get(line.userData.source); + const targetPos = positions.get(line.userData.target); + if (sourcePos && targetPos) { + const attrs = line.geometry.attributes.position as THREE.BufferAttribute; + attrs.setXYZ(0, sourcePos.x, sourcePos.y, sourcePos.z); + attrs.setXYZ(1, targetPos.x, targetPos.y, targetPos.z); + attrs.needsUpdate = true; + } + }); + } + + dispose() { + this.group.children.forEach((child) => { + const line = child as THREE.Line; + line.geometry?.dispose(); + (line.material as THREE.Material)?.dispose(); + }); + } +} diff --git a/apps/dashboard/src/lib/graph/effects.ts b/apps/dashboard/src/lib/graph/effects.ts new file mode 100644 index 0000000..25ed0f1 --- /dev/null +++ b/apps/dashboard/src/lib/graph/effects.ts @@ -0,0 +1,204 @@ +import * as THREE from 'three'; + +export interface PulseEffect { + nodeId: string; + intensity: number; + color: THREE.Color; + decay: number; +} + +interface SpawnBurst { + position: THREE.Vector3; + age: number; + particles: THREE.Points; +} + +interface Shockwave { + mesh: THREE.Mesh; + age: number; + maxAge: number; +} + +interface ConnectionFlash { + line: THREE.Line; + intensity: number; +} + +export class EffectManager { + pulseEffects: PulseEffect[] = []; + private spawnBursts: SpawnBurst[] = []; + private shockwaves: Shockwave[] = []; + private connectionFlashes: ConnectionFlash[] = []; + private scene: THREE.Scene; + + constructor(scene: THREE.Scene) { + this.scene = scene; + } + + addPulse(nodeId: string, intensity: number, color: THREE.Color, decay: number) { + this.pulseEffects.push({ nodeId, intensity, color, decay }); + } + + createSpawnBurst(position: THREE.Vector3, color: THREE.Color) { + const count = 60; + const geo = new THREE.BufferGeometry(); + const positions = new Float32Array(count * 3); + const velocities = new Float32Array(count * 3); + + for (let i = 0; i < count; i++) { + positions[i * 3] = position.x; + positions[i * 3 + 1] = position.y; + positions[i * 3 + 2] = position.z; + const theta = Math.random() * Math.PI * 2; + const phi = Math.acos(2 * Math.random() - 1); + const speed = 0.3 + Math.random() * 0.5; + velocities[i * 3] = Math.sin(phi) * Math.cos(theta) * speed; + velocities[i * 3 + 1] = Math.sin(phi) * Math.sin(theta) * speed; + velocities[i * 3 + 2] = Math.cos(phi) * speed; + } + + geo.setAttribute('position', new THREE.BufferAttribute(positions, 3)); + geo.setAttribute('velocity', new THREE.BufferAttribute(velocities, 3)); + + const mat = new THREE.PointsMaterial({ + color, + size: 0.6, + transparent: true, + opacity: 1.0, + blending: THREE.AdditiveBlending, + sizeAttenuation: true, + }); + + const pts = new THREE.Points(geo, mat); + this.scene.add(pts); + this.spawnBursts.push({ position: position.clone(), age: 0, particles: pts }); + } + + createShockwave(position: THREE.Vector3, color: THREE.Color, camera: THREE.Camera) { + const geo = new THREE.RingGeometry(0.1, 0.5, 64); + const mat = new THREE.MeshBasicMaterial({ + color, + transparent: true, + opacity: 0.8, + side: THREE.DoubleSide, + blending: THREE.AdditiveBlending, + }); + const ring = new THREE.Mesh(geo, mat); + ring.position.copy(position); + ring.lookAt(camera.position); + this.scene.add(ring); + this.shockwaves.push({ mesh: ring, age: 0, maxAge: 60 }); + } + + createConnectionFlash(from: THREE.Vector3, to: THREE.Vector3, color: THREE.Color) { + const points = [from.clone(), to.clone()]; + const geo = new THREE.BufferGeometry().setFromPoints(points); + const mat = new THREE.LineBasicMaterial({ + color, + transparent: true, + opacity: 1.0, + blending: THREE.AdditiveBlending, + }); + const line = new THREE.Line(geo, mat); + this.scene.add(line); + this.connectionFlashes.push({ line, intensity: 1.0 }); + } + + update(nodeMeshMap: Map, camera: THREE.Camera) { + // Pulse effects + for (let i = this.pulseEffects.length - 1; i >= 0; i--) { + const pulse = this.pulseEffects[i]; + pulse.intensity -= pulse.decay; + if (pulse.intensity <= 0) { + this.pulseEffects.splice(i, 1); + continue; + } + const mesh = nodeMeshMap.get(pulse.nodeId); + if (mesh) { + const mat = mesh.material as THREE.MeshStandardMaterial; + mat.emissive.lerp(pulse.color, pulse.intensity * 0.3); + mat.emissiveIntensity = Math.max(mat.emissiveIntensity, pulse.intensity); + } + } + + // Spawn bursts + for (let i = this.spawnBursts.length - 1; i >= 0; i--) { + const burst = this.spawnBursts[i]; + burst.age++; + if (burst.age > 120) { + this.scene.remove(burst.particles); + burst.particles.geometry.dispose(); + (burst.particles.material as THREE.Material).dispose(); + this.spawnBursts.splice(i, 1); + continue; + } + const positions = burst.particles.geometry.attributes.position as THREE.BufferAttribute; + const vels = burst.particles.geometry.attributes.velocity as THREE.BufferAttribute; + for (let j = 0; j < positions.count; j++) { + positions.setX(j, positions.getX(j) + vels.getX(j)); + positions.setY(j, positions.getY(j) + vels.getY(j)); + positions.setZ(j, positions.getZ(j) + vels.getZ(j)); + vels.setX(j, vels.getX(j) * 0.97); + vels.setY(j, vels.getY(j) * 0.97); + vels.setZ(j, vels.getZ(j) * 0.97); + } + positions.needsUpdate = true; + const mat = burst.particles.material as THREE.PointsMaterial; + mat.opacity = Math.max(0, 1 - burst.age / 120); + mat.size = 0.6 * (1 - burst.age / 200); + } + + // Shockwaves + for (let i = this.shockwaves.length - 1; i >= 0; i--) { + const sw = this.shockwaves[i]; + sw.age++; + if (sw.age > sw.maxAge) { + this.scene.remove(sw.mesh); + sw.mesh.geometry.dispose(); + (sw.mesh.material as THREE.Material).dispose(); + this.shockwaves.splice(i, 1); + continue; + } + const progress = sw.age / sw.maxAge; + sw.mesh.scale.setScalar(1 + progress * 20); + (sw.mesh.material as THREE.MeshBasicMaterial).opacity = 0.8 * (1 - progress); + sw.mesh.lookAt(camera.position); + } + + // Connection flashes + for (let i = this.connectionFlashes.length - 1; i >= 0; i--) { + const flash = this.connectionFlashes[i]; + flash.intensity -= 0.015; + if (flash.intensity <= 0) { + this.scene.remove(flash.line); + flash.line.geometry.dispose(); + (flash.line.material as THREE.Material).dispose(); + this.connectionFlashes.splice(i, 1); + continue; + } + (flash.line.material as THREE.LineBasicMaterial).opacity = flash.intensity; + } + } + + dispose() { + for (const burst of this.spawnBursts) { + this.scene.remove(burst.particles); + burst.particles.geometry.dispose(); + (burst.particles.material as THREE.Material).dispose(); + } + for (const sw of this.shockwaves) { + this.scene.remove(sw.mesh); + sw.mesh.geometry.dispose(); + (sw.mesh.material as THREE.Material).dispose(); + } + for (const flash of this.connectionFlashes) { + this.scene.remove(flash.line); + flash.line.geometry.dispose(); + (flash.line.material as THREE.Material).dispose(); + } + this.pulseEffects = []; + this.spawnBursts = []; + this.shockwaves = []; + this.connectionFlashes = []; + } +} diff --git a/apps/dashboard/src/lib/graph/events.ts b/apps/dashboard/src/lib/graph/events.ts new file mode 100644 index 0000000..6ab44e2 --- /dev/null +++ b/apps/dashboard/src/lib/graph/events.ts @@ -0,0 +1,98 @@ +import * as THREE from 'three'; +import type { VestigeEvent } from '$types'; +import type { EffectManager } from './effects'; + +export function mapEventToEffects( + event: VestigeEvent, + effects: EffectManager, + nodePositions: Map, + nodeMeshMap: Map, + camera: THREE.Camera +) { + switch (event.type) { + case 'MemoryCreated': { + const nodeId = (event.data as { id?: string })?.id; + const pos = nodeId ? nodePositions.get(nodeId) : null; + const burstPos = + pos?.clone() ?? + new THREE.Vector3( + (Math.random() - 0.5) * 40, + (Math.random() - 0.5) * 40, + (Math.random() - 0.5) * 40 + ); + effects.createSpawnBurst(burstPos, new THREE.Color(0x00ffd1)); + effects.createShockwave(burstPos, new THREE.Color(0x00ffd1), camera); + break; + } + case 'SearchPerformed': { + nodeMeshMap.forEach((_, id) => { + effects.addPulse(id, 0.6 + Math.random() * 0.4, new THREE.Color(0x818cf8), 0.02); + }); + break; + } + case 'DreamStarted': { + nodeMeshMap.forEach((_, id) => { + effects.addPulse(id, 1.0, new THREE.Color(0xa855f7), 0.005); + }); + break; + } + case 'DreamProgress': { + const memoryId = (event.data as { memory_id?: string })?.memory_id; + if (memoryId && nodeMeshMap.has(memoryId)) { + effects.addPulse(memoryId, 1.5, new THREE.Color(0xc084fc), 0.01); + } + break; + } + case 'DreamCompleted': { + effects.createSpawnBurst(new THREE.Vector3(0, 0, 0), new THREE.Color(0xa855f7)); + effects.createShockwave(new THREE.Vector3(0, 0, 0), new THREE.Color(0xa855f7), camera); + break; + } + case 'ConnectionDiscovered': { + const data = event.data as { source_id?: string; target_id?: string }; + const srcPos = data.source_id ? nodePositions.get(data.source_id) : null; + const tgtPos = data.target_id ? nodePositions.get(data.target_id) : null; + if (srcPos && tgtPos) { + effects.createConnectionFlash(srcPos, tgtPos, new THREE.Color(0x00d4ff)); + } + break; + } + case 'RetentionDecayed': { + const decayId = (event.data as { id?: string })?.id; + if (decayId && nodeMeshMap.has(decayId)) { + effects.addPulse(decayId, 0.8, new THREE.Color(0xff4757), 0.03); + } + break; + } + case 'MemoryPromoted': { + const promoId = (event.data as { id?: string })?.id; + if (promoId && nodeMeshMap.has(promoId)) { + effects.addPulse(promoId, 1.2, new THREE.Color(0x00ff88), 0.01); + const promoPos = nodePositions.get(promoId); + if (promoPos) effects.createShockwave(promoPos, new THREE.Color(0x00ff88), camera); + } + break; + } + case 'ConsolidationCompleted': { + nodeMeshMap.forEach((_, id) => { + effects.addPulse(id, 0.4 + Math.random() * 0.3, new THREE.Color(0xffb800), 0.015); + }); + break; + } + case 'ActivationSpread': { + const spreadData = event.data as { source_id?: string; target_ids?: string[] }; + if (spreadData.source_id && spreadData.target_ids) { + const srcPos = nodePositions.get(spreadData.source_id); + if (srcPos) { + for (const targetId of spreadData.target_ids) { + const tgtPos = nodePositions.get(targetId); + if (tgtPos) { + effects.createConnectionFlash(srcPos, tgtPos, new THREE.Color(0x14e8c6)); + } + } + } + } + break; + } + } +} diff --git a/apps/dashboard/src/lib/graph/force-sim.ts b/apps/dashboard/src/lib/graph/force-sim.ts new file mode 100644 index 0000000..dd53f90 --- /dev/null +++ b/apps/dashboard/src/lib/graph/force-sim.ts @@ -0,0 +1,77 @@ +import * as THREE from 'three'; +import type { GraphEdge } from '$types'; + +export class ForceSimulation { + positions: Map; + velocities: Map; + running = true; + step = 0; + + private readonly repulsionStrength = 500; + private readonly attractionStrength = 0.01; + private readonly dampening = 0.9; + private readonly maxSteps = 300; + + constructor(positions: Map) { + this.positions = positions; + this.velocities = new Map(); + for (const id of positions.keys()) { + this.velocities.set(id, new THREE.Vector3()); + } + } + + tick(edges: GraphEdge[]) { + if (!this.running || this.step > this.maxSteps) return; + this.step++; + + const alpha = Math.max(0.001, 1 - this.step / this.maxSteps); + const nodeIds = Array.from(this.positions.keys()); + + // Repulsion between all nodes + for (let i = 0; i < nodeIds.length; i++) { + for (let j = i + 1; j < nodeIds.length; j++) { + const posA = this.positions.get(nodeIds[i])!; + const posB = this.positions.get(nodeIds[j])!; + const diff = new THREE.Vector3().subVectors(posA, posB); + const dist = diff.length() || 1; + const force = (this.repulsionStrength / (dist * dist)) * alpha; + const dir = diff.normalize().multiplyScalar(force); + + this.velocities.get(nodeIds[i])!.add(dir); + this.velocities.get(nodeIds[j])!.sub(dir); + } + } + + // Attraction along edges + for (const edge of edges) { + const posA = this.positions.get(edge.source); + const posB = this.positions.get(edge.target); + if (!posA || !posB) continue; + + const diff = new THREE.Vector3().subVectors(posB, posA); + const dist = diff.length(); + const force = dist * this.attractionStrength * edge.weight * alpha; + const dir = diff.normalize().multiplyScalar(force); + + this.velocities.get(edge.source)!.add(dir); + this.velocities.get(edge.target)!.sub(dir); + } + + // Centering force + velocity integration + for (const id of nodeIds) { + const pos = this.positions.get(id)!; + const vel = this.velocities.get(id)!; + vel.sub(pos.clone().multiplyScalar(0.001 * alpha)); + vel.multiplyScalar(this.dampening); + pos.add(vel); + } + } + + reset() { + this.step = 0; + this.running = true; + for (const vel of this.velocities.values()) { + vel.set(0, 0, 0); + } + } +} diff --git a/apps/dashboard/src/lib/graph/nodes.ts b/apps/dashboard/src/lib/graph/nodes.ts new file mode 100644 index 0000000..c8f8bec --- /dev/null +++ b/apps/dashboard/src/lib/graph/nodes.ts @@ -0,0 +1,196 @@ +import * as THREE from 'three'; +import type { GraphNode } from '$types'; +import { NODE_TYPE_COLORS } from '$types'; + +export class NodeManager { + group: THREE.Group; + meshMap = new Map(); + positions = new Map(); + labelSprites = new Map(); + hoveredNode: string | null = null; + selectedNode: string | null = null; + + constructor() { + this.group = new THREE.Group(); + } + + createNodes(nodes: GraphNode[]): Map { + const phi = (1 + Math.sqrt(5)) / 2; + const count = nodes.length; + + for (let i = 0; i < count; i++) { + const node = nodes[i]; + + // Fibonacci sphere distribution for initial positions + const y = 1 - (2 * i) / (count - 1 || 1); + const radius = Math.sqrt(1 - y * y); + const theta = (2 * Math.PI * i) / phi; + const spread = 30 + count * 0.5; + + const pos = new THREE.Vector3( + radius * Math.cos(theta) * spread, + y * spread, + radius * Math.sin(theta) * spread + ); + + if (node.isCenter) pos.set(0, 0, 0); + + this.positions.set(node.id, pos); + + const size = 0.5 + node.retention * 2; + const color = NODE_TYPE_COLORS[node.type] || '#8B95A5'; + + // Node mesh + const geometry = new THREE.SphereGeometry(size, 16, 16); + const material = new THREE.MeshStandardMaterial({ + color: new THREE.Color(color), + emissive: new THREE.Color(color), + emissiveIntensity: 0.3 + node.retention * 0.5, + roughness: 0.3, + metalness: 0.1, + transparent: true, + opacity: 0.3 + node.retention * 0.7, + }); + + const mesh = new THREE.Mesh(geometry, material); + mesh.position.copy(pos); + mesh.userData = { nodeId: node.id, type: node.type, retention: node.retention }; + this.meshMap.set(node.id, mesh); + this.group.add(mesh); + + // Glow sprite + const spriteMat = new THREE.SpriteMaterial({ + color: new THREE.Color(color), + transparent: true, + opacity: 0.15 + node.retention * 0.2, + blending: THREE.AdditiveBlending, + }); + const sprite = new THREE.Sprite(spriteMat); + sprite.scale.set(size * 4, size * 4, 1); + sprite.position.copy(pos); + sprite.userData = { isGlow: true, nodeId: node.id }; + this.group.add(sprite); + + // Text label sprite + const labelText = node.label || node.type; + const labelSprite = this.createTextSprite(labelText, '#e2e8f0'); + labelSprite.position.copy(pos); + labelSprite.position.y += size * 2 + 1.5; + labelSprite.userData = { isLabel: true, nodeId: node.id, offset: size * 2 + 1.5 }; + this.group.add(labelSprite); + this.labelSprites.set(node.id, labelSprite); + } + + return this.positions; + } + + private createTextSprite(text: string, color: string): THREE.Sprite { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d')!; + canvas.width = 512; + canvas.height = 64; + + const label = text.length > 40 ? text.slice(0, 37) + '...' : text; + + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.font = 'bold 28px -apple-system, BlinkMacSystemFont, sans-serif'; + ctx.textAlign = 'center'; + ctx.textBaseline = 'middle'; + ctx.shadowColor = 'rgba(0, 0, 0, 0.8)'; + ctx.shadowBlur = 6; + ctx.shadowOffsetX = 0; + ctx.shadowOffsetY = 2; + ctx.fillStyle = color; + ctx.fillText(label, canvas.width / 2, canvas.height / 2); + + const texture = new THREE.CanvasTexture(canvas); + texture.needsUpdate = true; + + const mat = new THREE.SpriteMaterial({ + map: texture, + transparent: true, + opacity: 0, + depthTest: false, + sizeAttenuation: true, + }); + + const sprite = new THREE.Sprite(mat); + sprite.scale.set(12, 1.5, 1); + return sprite; + } + + updatePositions() { + this.group.children.forEach((child) => { + if (child.userData.nodeId) { + const pos = this.positions.get(child.userData.nodeId); + if (!pos) return; + + if (child.userData.isGlow) { + child.position.copy(pos); + } else if (child.userData.isLabel) { + child.position.copy(pos); + child.position.y += child.userData.offset; + } else if (child instanceof THREE.Mesh) { + child.position.copy(pos); + } + } + }); + } + + animate(time: number, nodes: GraphNode[], camera: THREE.PerspectiveCamera) { + // Node breathing + this.meshMap.forEach((mesh, id) => { + const node = nodes.find((n) => n.id === id); + if (!node) return; + const breathe = + 1 + Math.sin(time * 1.5 + nodes.indexOf(node) * 0.5) * 0.15 * node.retention; + mesh.scale.setScalar(breathe); + + const mat = mesh.material as THREE.MeshStandardMaterial; + if (id === this.hoveredNode) { + mat.emissiveIntensity = 1.0; + } else if (id === this.selectedNode) { + mat.emissiveIntensity = 0.8; + } else { + // Low-retention nodes breathe slower + const baseIntensity = 0.3 + node.retention * 0.5; + const breatheIntensity = + baseIntensity + Math.sin(time * (0.8 + node.retention * 0.7)) * 0.1 * node.retention; + mat.emissiveIntensity = breatheIntensity; + } + }); + + // Distance-based label visibility + this.labelSprites.forEach((sprite, id) => { + const pos = this.positions.get(id); + if (!pos) return; + const dist = camera.position.distanceTo(pos); + const mat = sprite.material as THREE.SpriteMaterial; + const targetOpacity = + id === this.hoveredNode || id === this.selectedNode + ? 1.0 + : dist < 40 + ? 0.9 + : dist < 80 + ? 0.9 * (1 - (dist - 40) / 40) + : 0; + mat.opacity += (targetOpacity - mat.opacity) * 0.1; + }); + } + + getMeshes(): THREE.Mesh[] { + return Array.from(this.meshMap.values()); + } + + dispose() { + this.group.traverse((obj) => { + if (obj instanceof THREE.Mesh) { + obj.geometry?.dispose(); + (obj.material as THREE.Material)?.dispose(); + } else if (obj instanceof THREE.Sprite) { + (obj.material as THREE.SpriteMaterial)?.map?.dispose(); + (obj.material as THREE.Material)?.dispose(); + } + }); + } +} diff --git a/apps/dashboard/src/lib/graph/particles.ts b/apps/dashboard/src/lib/graph/particles.ts new file mode 100644 index 0000000..d57fd40 --- /dev/null +++ b/apps/dashboard/src/lib/graph/particles.ts @@ -0,0 +1,92 @@ +import * as THREE from 'three'; + +export class ParticleSystem { + starField: THREE.Points; + neuralParticles: THREE.Points; + + constructor(scene: THREE.Scene) { + this.starField = this.createStarField(); + this.neuralParticles = this.createNeuralParticles(); + scene.add(this.starField); + scene.add(this.neuralParticles); + } + + private createStarField(): THREE.Points { + const count = 3000; + const geometry = new THREE.BufferGeometry(); + const positions = new Float32Array(count * 3); + const sizes = new Float32Array(count); + + for (let i = 0; i < count; i++) { + positions[i * 3] = (Math.random() - 0.5) * 1000; + positions[i * 3 + 1] = (Math.random() - 0.5) * 1000; + positions[i * 3 + 2] = (Math.random() - 0.5) * 1000; + sizes[i] = Math.random() * 1.5; + } + + geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3)); + geometry.setAttribute('size', new THREE.BufferAttribute(sizes, 1)); + + const material = new THREE.PointsMaterial({ + color: 0x6366f1, + size: 0.5, + transparent: true, + opacity: 0.4, + sizeAttenuation: true, + blending: THREE.AdditiveBlending, + }); + + return new THREE.Points(geometry, material); + } + + private createNeuralParticles(): THREE.Points { + const count = 500; + const geometry = new THREE.BufferGeometry(); + const positions = new Float32Array(count * 3); + const colors = new Float32Array(count * 3); + + for (let i = 0; i < count; i++) { + positions[i * 3] = (Math.random() - 0.5) * 100; + positions[i * 3 + 1] = (Math.random() - 0.5) * 100; + positions[i * 3 + 2] = (Math.random() - 0.5) * 100; + colors[i * 3] = 0.4 + Math.random() * 0.3; + colors[i * 3 + 1] = 0.3 + Math.random() * 0.2; + colors[i * 3 + 2] = 0.8 + Math.random() * 0.2; + } + + geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3)); + geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3)); + + const material = new THREE.PointsMaterial({ + size: 0.3, + vertexColors: true, + transparent: true, + opacity: 0.4, + blending: THREE.AdditiveBlending, + sizeAttenuation: true, + }); + + return new THREE.Points(geometry, material); + } + + animate(time: number) { + // Star rotation + this.starField.rotation.y += 0.0001; + this.starField.rotation.x += 0.00005; + + // Neural particle motion + const positions = this.neuralParticles.geometry.attributes.position as THREE.BufferAttribute; + for (let i = 0; i < positions.count; i++) { + positions.setY(i, positions.getY(i) + Math.sin(time + i * 0.1) * 0.02); + positions.setX(i, positions.getX(i) + Math.cos(time + i * 0.05) * 0.01); + } + positions.needsUpdate = true; + } + + dispose() { + this.starField.geometry.dispose(); + (this.starField.material as THREE.Material).dispose(); + this.neuralParticles.geometry.dispose(); + (this.neuralParticles.material as THREE.Material).dispose(); + } +} diff --git a/apps/dashboard/src/lib/graph/scene.ts b/apps/dashboard/src/lib/graph/scene.ts new file mode 100644 index 0000000..bbd39f0 --- /dev/null +++ b/apps/dashboard/src/lib/graph/scene.ts @@ -0,0 +1,116 @@ +import * as THREE from 'three'; +import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; +import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; +import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; +import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js'; + +export interface SceneContext { + scene: THREE.Scene; + camera: THREE.PerspectiveCamera; + renderer: THREE.WebGLRenderer; + controls: OrbitControls; + composer: EffectComposer; + bloomPass: UnrealBloomPass; + raycaster: THREE.Raycaster; + mouse: THREE.Vector2; + lights: { + ambient: THREE.AmbientLight; + point1: THREE.PointLight; + point2: THREE.PointLight; + }; +} + +export function createScene(container: HTMLDivElement): SceneContext { + const scene = new THREE.Scene(); + scene.fog = new THREE.FogExp2(0x050510, 0.008); + + const camera = new THREE.PerspectiveCamera( + 60, + container.clientWidth / container.clientHeight, + 0.1, + 2000 + ); + camera.position.set(0, 30, 80); + + const renderer = new THREE.WebGLRenderer({ + antialias: true, + alpha: true, + powerPreference: 'high-performance', + }); + renderer.setSize(container.clientWidth, container.clientHeight); + renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); + renderer.toneMapping = THREE.ACESFilmicToneMapping; + renderer.toneMappingExposure = 1.2; + container.appendChild(renderer.domElement); + + const controls = new OrbitControls(camera, renderer.domElement); + controls.enableDamping = true; + controls.dampingFactor = 0.05; + controls.rotateSpeed = 0.5; + controls.zoomSpeed = 0.8; + controls.minDistance = 10; + controls.maxDistance = 500; + controls.autoRotate = true; + controls.autoRotateSpeed = 0.3; + + const composer = new EffectComposer(renderer); + composer.addPass(new RenderPass(scene, camera)); + const bloomPass = new UnrealBloomPass( + new THREE.Vector2(container.clientWidth, container.clientHeight), + 0.8, + 0.4, + 0.85 + ); + composer.addPass(bloomPass); + + const ambient = new THREE.AmbientLight(0x1a1a3a, 0.5); + scene.add(ambient); + + const point1 = new THREE.PointLight(0x6366f1, 1.5, 200); + point1.position.set(50, 50, 50); + scene.add(point1); + + const point2 = new THREE.PointLight(0xa855f7, 1, 200); + point2.position.set(-50, -30, -50); + scene.add(point2); + + const raycaster = new THREE.Raycaster(); + raycaster.params.Points = { threshold: 2 }; + const mouse = new THREE.Vector2(); + + return { + scene, + camera, + renderer, + controls, + composer, + bloomPass, + raycaster, + mouse, + lights: { ambient, point1, point2 }, + }; +} + +export function resizeScene(ctx: SceneContext, container: HTMLDivElement) { + const w = container.clientWidth; + const h = container.clientHeight; + ctx.camera.aspect = w / h; + ctx.camera.updateProjectionMatrix(); + ctx.renderer.setSize(w, h); + ctx.composer.setSize(w, h); +} + +export function disposeScene(ctx: SceneContext) { + ctx.scene.traverse((obj: THREE.Object3D) => { + if (obj instanceof THREE.Mesh || obj instanceof THREE.InstancedMesh) { + obj.geometry?.dispose(); + if (Array.isArray(obj.material)) { + obj.material.forEach((m: THREE.Material) => m.dispose()); + } else if (obj.material) { + (obj.material as THREE.Material).dispose(); + } + } + }); + ctx.renderer.dispose(); + ctx.composer.dispose(); +} diff --git a/apps/dashboard/src/lib/graph/shaders/nebula.frag.ts b/apps/dashboard/src/lib/graph/shaders/nebula.frag.ts new file mode 100644 index 0000000..80d5290 --- /dev/null +++ b/apps/dashboard/src/lib/graph/shaders/nebula.frag.ts @@ -0,0 +1,146 @@ +import * as THREE from 'three'; + +// Domain-warped FBM noise nebula background shader +const vertexShader = /* glsl */ ` +varying vec2 vUv; +void main() { + vUv = uv; + gl_Position = vec4(position, 1.0); +} +`; + +const fragmentShader = /* glsl */ ` +precision highp float; + +uniform float uTime; +uniform vec2 uResolution; +uniform float uDreamIntensity; + +varying vec2 vUv; + +// Simplex-style hash +vec3 hash33(vec3 p3) { + p3 = fract(p3 * vec3(0.1031, 0.1030, 0.0973)); + p3 += dot(p3, p3.yxz + 33.33); + return fract((p3.xxy + p3.yxx) * p3.zyx); +} + +// 3D value noise +float noise(vec3 p) { + vec3 i = floor(p); + vec3 f = fract(p); + f = f * f * (3.0 - 2.0 * f); + + float n = i.x + i.y * 157.0 + 113.0 * i.z; + + vec4 v1 = fract(sin(vec4(n + 0.0, n + 1.0, n + 157.0, n + 158.0)) * 43758.5453); + vec4 v2 = fract(sin(vec4(n + 113.0, n + 114.0, n + 270.0, n + 271.0)) * 43758.5453); + + vec4 a = mix(v1, v2, f.z); + vec2 b = mix(a.xy, a.zw, f.y); + return mix(b.x, b.y, f.x); +} + +// FBM with 5 octaves +float fbm(vec3 p) { + float value = 0.0; + float amplitude = 0.5; + float frequency = 1.0; + for (int i = 0; i < 5; i++) { + value += amplitude * noise(p * frequency); + frequency *= 2.0; + amplitude *= 0.5; + } + return value; +} + +// IQ cosine palette +vec3 palette(float t, vec3 a, vec3 b, vec3 c, vec3 d) { + return a + b * cos(6.28318 * (c * t + d)); +} + +void main() { + vec2 uv = (gl_FragCoord.xy - 0.5 * uResolution.xy) / min(uResolution.x, uResolution.y); + float t = uTime * 0.05; + + // Domain warping: fbm(p + fbm(p + fbm(p))) + vec3 p = vec3(uv * 2.0, t); + + float warp1 = fbm(p); + float warp2 = fbm(p + warp1 * 3.0 + vec3(1.7, 9.2, t * 0.3)); + float warp3 = fbm(p + warp2 * 2.5 + vec3(8.3, 2.8, t * 0.2)); + + // Final noise value + float f = fbm(p + warp3 * 2.0); + + // Color: cosmic palette that shifts during dream mode + vec3 normalA = vec3(0.02, 0.01, 0.05); + vec3 normalB = vec3(0.03, 0.02, 0.08); + vec3 normalC = vec3(1.0, 1.0, 1.0); + vec3 normalD = vec3(0.70, 0.55, 0.80); + + vec3 dreamA = vec3(0.05, 0.01, 0.08); + vec3 dreamB = vec3(0.06, 0.03, 0.12); + vec3 dreamC = vec3(1.0, 0.8, 1.0); + vec3 dreamD = vec3(0.80, 0.40, 0.90); + + vec3 a = mix(normalA, dreamA, uDreamIntensity); + vec3 b = mix(normalB, dreamB, uDreamIntensity); + vec3 c = mix(normalC, dreamC, uDreamIntensity); + vec3 d = mix(normalD, dreamD, uDreamIntensity); + + vec3 color = palette(f + warp2 * 0.5, a, b, c, d); + + // Add subtle star-like highlights + float stars = smoothstep(0.97, 1.0, noise(vec3(uv * 50.0, t * 0.1))); + color += stars * 0.15; + + // Intensity modulation + float intensity = 0.15 + 0.1 * uDreamIntensity; + color *= intensity; + + // Vignette + float dist = length(uv); + color *= smoothstep(1.5, 0.3, dist); + + gl_FragColor = vec4(color, 1.0); +} +`; + +export function createNebulaBackground(scene: THREE.Scene): { + mesh: THREE.Mesh; + material: THREE.ShaderMaterial; +} { + const geometry = new THREE.PlaneGeometry(2, 2); + const material = new THREE.ShaderMaterial({ + vertexShader, + fragmentShader, + uniforms: { + uTime: { value: 0 }, + uResolution: { value: new THREE.Vector2(window.innerWidth, window.innerHeight) }, + uDreamIntensity: { value: 0 }, + }, + depthWrite: false, + depthTest: false, + transparent: false, + }); + + const mesh = new THREE.Mesh(geometry, material); + mesh.frustumCulled = false; + mesh.renderOrder = -1000; + scene.add(mesh); + + return { mesh, material }; +} + +export function updateNebula( + material: THREE.ShaderMaterial, + time: number, + dreamIntensity: number, + width: number, + height: number +) { + material.uniforms.uTime.value = time; + material.uniforms.uDreamIntensity.value = dreamIntensity; + material.uniforms.uResolution.value.set(width, height); +} diff --git a/apps/dashboard/src/lib/graph/shaders/post-processing.ts b/apps/dashboard/src/lib/graph/shaders/post-processing.ts new file mode 100644 index 0000000..687024f --- /dev/null +++ b/apps/dashboard/src/lib/graph/shaders/post-processing.ts @@ -0,0 +1,147 @@ +import * as THREE from 'three'; +import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; +import type { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; + +// Chromatic Aberration +const ChromaticAberrationShader = { + uniforms: { + tDiffuse: { value: null }, + uIntensity: { value: 0.002 }, + }, + vertexShader: /* glsl */ ` + varying vec2 vUv; + void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } + `, + fragmentShader: /* glsl */ ` + uniform sampler2D tDiffuse; + uniform float uIntensity; + varying vec2 vUv; + + void main() { + vec2 center = vec2(0.5); + vec2 dir = vUv - center; + float dist = length(dir); + + float rOffset = uIntensity * dist; + float gOffset = 0.0; + float bOffset = -uIntensity * dist; + + vec2 rUv = vUv + dir * rOffset; + vec2 gUv = vUv + dir * gOffset; + vec2 bUv = vUv + dir * bOffset; + + float r = texture2D(tDiffuse, rUv).r; + float g = texture2D(tDiffuse, gUv).g; + float b = texture2D(tDiffuse, bUv).b; + + gl_FragColor = vec4(r, g, b, 1.0); + } + `, +}; + +// Film Grain +const FilmGrainShader = { + uniforms: { + tDiffuse: { value: null }, + uTime: { value: 0 }, + uIntensity: { value: 0.04 }, + }, + vertexShader: /* glsl */ ` + varying vec2 vUv; + void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } + `, + fragmentShader: /* glsl */ ` + uniform sampler2D tDiffuse; + uniform float uTime; + uniform float uIntensity; + varying vec2 vUv; + + float rand(vec2 co) { + return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453); + } + + void main() { + vec4 color = texture2D(tDiffuse, vUv); + float grain = rand(vUv + vec2(uTime)) * 2.0 - 1.0; + color.rgb += grain * uIntensity; + gl_FragColor = color; + } + `, +}; + +// Vignette +const VignetteShader = { + uniforms: { + tDiffuse: { value: null }, + uRadius: { value: 0.9 }, + uSoftness: { value: 0.5 }, + }, + vertexShader: /* glsl */ ` + varying vec2 vUv; + void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } + `, + fragmentShader: /* glsl */ ` + uniform sampler2D tDiffuse; + uniform float uRadius; + uniform float uSoftness; + varying vec2 vUv; + + void main() { + vec4 color = texture2D(tDiffuse, vUv); + vec2 center = vec2(0.5); + float dist = distance(vUv, center) * 1.414; + float vignette = smoothstep(uRadius, uRadius - uSoftness, dist); + color.rgb *= vignette; + gl_FragColor = color; + } + `, +}; + +export interface PostProcessingStack { + chromatic: ShaderPass; + grain: ShaderPass; + vignette: ShaderPass; +} + +export function createPostProcessing(composer: EffectComposer): PostProcessingStack { + const chromatic = new ShaderPass(ChromaticAberrationShader); + const grain = new ShaderPass(FilmGrainShader); + const vignette = new ShaderPass(VignetteShader); + + composer.addPass(chromatic); + composer.addPass(grain); + composer.addPass(vignette); + + return { chromatic, grain, vignette }; +} + +export function updatePostProcessing( + stack: PostProcessingStack, + time: number, + dreamIntensity: number +) { + // Chromatic aberration: doubles during dream + const chromaticBase = 0.002; + const chromaticDream = 0.005; + stack.chromatic.uniforms.uIntensity.value = + chromaticBase + (chromaticDream - chromaticBase) * dreamIntensity; + + // Film grain: animated + stack.grain.uniforms.uTime.value = time; + stack.grain.uniforms.uIntensity.value = 0.04 + dreamIntensity * 0.02; + + // Vignette: tighter during dream + const vignetteBase = 0.9; + const vignetteDream = 0.7; + stack.vignette.uniforms.uRadius.value = + vignetteBase + (vignetteDream - vignetteBase) * dreamIntensity; +} diff --git a/apps/dashboard/src/lib/graph/temporal.ts b/apps/dashboard/src/lib/graph/temporal.ts new file mode 100644 index 0000000..9f466c5 --- /dev/null +++ b/apps/dashboard/src/lib/graph/temporal.ts @@ -0,0 +1,93 @@ +import type { GraphNode, GraphEdge } from '$types'; + +export interface TemporalState { + visibleNodes: GraphNode[]; + visibleEdges: GraphEdge[]; + nodeOpacities: Map; +} + +/** + * Filter nodes and edges by a temporal cutoff date. + * Nodes are visible if createdAt <= cutoffDate. + * Edges are visible if both endpoints are visible. + */ +export function filterByDate( + nodes: GraphNode[], + edges: GraphEdge[], + cutoffDate: Date +): TemporalState { + const cutoff = cutoffDate.getTime(); + const visibleNodeIds = new Set(); + const nodeOpacities = new Map(); + + const visibleNodes = nodes.filter((node) => { + const created = new Date(node.createdAt).getTime(); + if (created <= cutoff) { + visibleNodeIds.add(node.id); + + // Nodes created near the cutoff date get a fade-in opacity + const age = cutoff - created; + const fadeWindow = 24 * 60 * 60 * 1000; // 1 day fade window + const opacity = age < fadeWindow ? 0.3 + 0.7 * (age / fadeWindow) : 1.0; + nodeOpacities.set(node.id, opacity); + + return true; + } + return false; + }); + + const visibleEdges = edges.filter( + (edge) => visibleNodeIds.has(edge.source) && visibleNodeIds.has(edge.target) + ); + + return { visibleNodes, visibleEdges, nodeOpacities }; +} + +/** + * Calculate what retention would have been at a given historical date. + * Uses FSRS-6 decay formula: R(t) = exp(-t / S) + */ +export function retentionAtDate( + currentRetention: number, + stability: number, + nodeCreatedAt: string, + targetDate: Date, + now: Date = new Date() +): number { + const S = Math.max(stability, 0.1); + const nowMs = now.getTime(); + const targetMs = targetDate.getTime(); + const createdMs = new Date(nodeCreatedAt).getTime(); + + if (targetMs < createdMs) return 0; + + // Time elapsed from creation to target date (in days) + const elapsedDays = (targetMs - createdMs) / (24 * 60 * 60 * 1000); + + // R(t) = e^(-t/S) + return Math.exp(-elapsedDays / S); +} + +/** + * Get the date range from a set of nodes (oldest to newest). + */ +export function getDateRange(nodes: GraphNode[]): { oldest: Date; newest: Date } { + if (nodes.length === 0) { + const now = new Date(); + return { oldest: now, newest: now }; + } + + let oldest = Infinity; + let newest = -Infinity; + + for (const node of nodes) { + const ts = new Date(node.createdAt).getTime(); + if (ts < oldest) oldest = ts; + if (ts > newest) newest = ts; + } + + return { + oldest: new Date(oldest), + newest: new Date(newest), + }; +} diff --git a/apps/dashboard/src/lib/stores/graph-state.svelte.ts b/apps/dashboard/src/lib/stores/graph-state.svelte.ts new file mode 100644 index 0000000..5abe2c3 --- /dev/null +++ b/apps/dashboard/src/lib/stores/graph-state.svelte.ts @@ -0,0 +1,49 @@ +// Shared graph state using Svelte 5 $state runes +// This store manages temporal playback and dream mode state + +export const graphState = createGraphState(); + +function createGraphState() { + let temporalEnabled = $state(false); + let temporalDate = $state(new Date()); + let temporalPlaying = $state(false); + let temporalSpeed = $state(1); // days per second: 1, 7, 30 + let dreamMode = $state(false); + + return { + get temporalEnabled() { + return temporalEnabled; + }, + set temporalEnabled(v: boolean) { + temporalEnabled = v; + }, + + get temporalDate() { + return temporalDate; + }, + set temporalDate(v: Date) { + temporalDate = v; + }, + + get temporalPlaying() { + return temporalPlaying; + }, + set temporalPlaying(v: boolean) { + temporalPlaying = v; + }, + + get temporalSpeed() { + return temporalSpeed; + }, + set temporalSpeed(v: number) { + temporalSpeed = v; + }, + + get dreamMode() { + return dreamMode; + }, + set dreamMode(v: boolean) { + dreamMode = v; + }, + }; +} diff --git a/apps/dashboard/src/lib/types/index.ts b/apps/dashboard/src/lib/types/index.ts index a31a254..effed1e 100644 --- a/apps/dashboard/src/lib/types/index.ts +++ b/apps/dashboard/src/lib/types/index.ts @@ -180,33 +180,33 @@ export interface IntentionItem { snoozed_until?: string; } -// Node type colors for visualization +// Node type colors for visualization — bioluminescent palette export const NODE_TYPE_COLORS: Record = { - fact: '#3b82f6', // blue - concept: '#8b5cf6', // purple - event: '#f59e0b', // amber - person: '#10b981', // emerald - place: '#06b6d4', // cyan - note: '#6b7280', // gray - pattern: '#ec4899', // pink - decision: '#ef4444', // red + fact: '#00A8FF', // electric blue + concept: '#9D00FF', // deep violet + event: '#FFB800', // golden amber + person: '#00FFD1', // bioluminescent cyan + place: '#00D4FF', // bright cyan + note: '#8B95A5', // soft steel + pattern: '#FF3CAC', // hot pink + decision: '#FF4757', // vivid red }; export const EVENT_TYPE_COLORS: Record = { - MemoryCreated: '#10b981', - MemoryUpdated: '#3b82f6', - MemoryDeleted: '#ef4444', - MemoryPromoted: '#22c55e', - MemoryDemoted: '#f97316', - SearchPerformed: '#6366f1', - DreamStarted: '#8b5cf6', - DreamProgress: '#7c3aed', - DreamCompleted: '#a855f7', - ConsolidationStarted: '#f59e0b', - ConsolidationCompleted: '#f97316', - RetentionDecayed: '#ef4444', - ConnectionDiscovered: '#06b6d4', - ActivationSpread: '#14b8a6', - ImportanceScored: '#ec4899', - Heartbeat: '#6b7280', + MemoryCreated: '#00FFD1', + MemoryUpdated: '#00A8FF', + MemoryDeleted: '#FF4757', + MemoryPromoted: '#00FF88', + MemoryDemoted: '#FF6B35', + SearchPerformed: '#818CF8', + DreamStarted: '#9D00FF', + DreamProgress: '#B44AFF', + DreamCompleted: '#C084FC', + ConsolidationStarted: '#FFB800', + ConsolidationCompleted: '#FF9500', + RetentionDecayed: '#FF4757', + ConnectionDiscovered: '#00D4FF', + ActivationSpread: '#14E8C6', + ImportanceScored: '#FF3CAC', + Heartbeat: '#8B95A5', }; diff --git a/apps/dashboard/src/routes/(app)/explore/+page.svelte b/apps/dashboard/src/routes/(app)/explore/+page.svelte index f78a9ac..d05dd97 100644 --- a/apps/dashboard/src/routes/(app)/explore/+page.svelte +++ b/apps/dashboard/src/routes/(app)/explore/+page.svelte @@ -74,10 +74,10 @@
{#each (['associations', 'chains', 'bridges'] as const) as m}
{#if sourceMemory} -
+
Source

{sourceMemory.content.slice(0, 200)}

@@ -115,22 +115,22 @@ {#if mode === 'chains' || mode === 'bridges'}
- + Target Memory (for {mode})
e.key === 'Enter' && findTarget()} - class="flex-1 px-4 py-2.5 bg-surface border border-subtle/40 rounded-lg text-text text-sm - placeholder:text-muted focus:outline-none focus:border-dream/60 transition" /> + class="flex-1 px-4 py-2.5 bg-white/[0.03] border border-synapse/10 rounded-xl text-text text-sm + placeholder:text-muted focus:outline-none focus:border-dream/40 transition backdrop-blur-sm" />
{#if targetMemory} -
+
Target

{targetMemory.content.slice(0, 200)}

@@ -155,14 +155,14 @@
{#each associations as assoc, i} -
+
{i + 1}

{assoc.content}

- {#if assoc.nodeType}{assoc.nodeType}{/if} + {#if assoc.nodeType}{assoc.nodeType}{/if} {#if assoc.score}Score: {Number(assoc.score).toFixed(3)}{/if} {#if assoc.similarity}Similarity: {Number(assoc.similarity).toFixed(3)}{/if} {#if assoc.retention}{(Number(assoc.retention) * 100).toFixed(0)}% retention{/if} @@ -182,29 +182,29 @@ {/if} -
+

Importance Scorer

4-channel neuroscience scoring: novelty, arousal, reward, attention

{#if importanceResult} {@const channels = importanceResult.channels as Record | undefined} {@const composite = Number(importanceResult.composite || importanceResult.compositeScore || 0)} -
+
{composite.toFixed(2)} - 0.6 ? 'bg-recall/20 text-recall border border-recall/30' - : 'bg-surface text-dim border border-subtle/30'}"> + : 'bg-white/[0.04] text-dim border border-subtle/20'}"> {composite > 0.6 ? 'SAVE' : 'SKIP'}
diff --git a/apps/dashboard/src/routes/(app)/feed/+page.svelte b/apps/dashboard/src/routes/(app)/feed/+page.svelte index b372822..67e3f61 100644 --- a/apps/dashboard/src/routes/(app)/feed/+page.svelte +++ b/apps/dashboard/src/routes/(app)/feed/+page.svelte @@ -1,6 +1,7 @@ + + + + + -
+
-