diff --git a/feat/major-revamp/assets/_...all_.3216af14.js b/feat/major-revamp/assets/_...all_.3216af14.js
new file mode 100644
index 0000000..21f6123
--- /dev/null
+++ b/feat/major-revamp/assets/_...all_.3216af14.js
@@ -0,0 +1,7 @@
+import { _ as _export_sfc, o as openBlock, c as createElementBlock } from "./index.0eba1a90.js";
+const _sfc_main = {};
+function _sfc_render(_ctx, _cache) {
+ return openBlock(), createElementBlock("div", null, " Not Found ");
+}
+var ____all_ = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
+export { ____all_ as default };
diff --git a/feat/major-revamp/assets/index.0eba1a90.js b/feat/major-revamp/assets/index.0eba1a90.js
new file mode 100644
index 0000000..96860f2
--- /dev/null
+++ b/feat/major-revamp/assets/index.0eba1a90.js
@@ -0,0 +1,56043 @@
+var __defProp = Object.defineProperty;
+var __defProps = Object.defineProperties;
+var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
+var __getOwnPropSymbols = Object.getOwnPropertySymbols;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __propIsEnum = Object.prototype.propertyIsEnumerable;
+var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
+var __spreadValues = (a2, b3) => {
+ for (var prop in b3 || (b3 = {}))
+ if (__hasOwnProp.call(b3, prop))
+ __defNormalProp(a2, prop, b3[prop]);
+ if (__getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(b3)) {
+ if (__propIsEnum.call(b3, prop))
+ __defNormalProp(a2, prop, b3[prop]);
+ }
+ return a2;
+};
+var __spreadProps = (a2, b3) => __defProps(a2, __getOwnPropDescs(b3));
+var __objRest = (source, exclude) => {
+ var target = {};
+ for (var prop in source)
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
+ target[prop] = source[prop];
+ if (source != null && __getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(source)) {
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
+ target[prop] = source[prop];
+ }
+ return target;
+};
+const p$5 = function polyfill() {
+ const relList = document.createElement("link").relList;
+ if (relList && relList.supports && relList.supports("modulepreload")) {
+ return;
+ }
+ for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
+ processPreload(link);
+ }
+ new MutationObserver((mutations) => {
+ for (const mutation of mutations) {
+ if (mutation.type !== "childList") {
+ continue;
+ }
+ for (const node of mutation.addedNodes) {
+ if (node.tagName === "LINK" && node.rel === "modulepreload")
+ processPreload(node);
+ }
+ }
+ }).observe(document, { childList: true, subtree: true });
+ function getFetchOpts(script) {
+ const fetchOpts = {};
+ if (script.integrity)
+ fetchOpts.integrity = script.integrity;
+ if (script.referrerpolicy)
+ fetchOpts.referrerPolicy = script.referrerpolicy;
+ if (script.crossorigin === "use-credentials")
+ fetchOpts.credentials = "include";
+ else if (script.crossorigin === "anonymous")
+ fetchOpts.credentials = "omit";
+ else
+ fetchOpts.credentials = "same-origin";
+ return fetchOpts;
+ }
+ function processPreload(link) {
+ if (link.ep)
+ return;
+ link.ep = true;
+ const fetchOpts = getFetchOpts(link);
+ fetch(link.href, fetchOpts);
+ }
+};
+p$5();
+function makeMap(str, expectsLowerCase) {
+ const map = /* @__PURE__ */ Object.create(null);
+ const list = str.split(",");
+ for (let i = 0; i < list.length; i++) {
+ map[list[i]] = true;
+ }
+ return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
+}
+const EMPTY_OBJ = {};
+const EMPTY_ARR = [];
+const NOOP = () => {
+};
+const NO = () => false;
+const onRE = /^on[^a-z]/;
+const isOn = (key) => onRE.test(key);
+const isModelListener = (key) => key.startsWith("onUpdate:");
+const extend = Object.assign;
+const remove = (arr, el) => {
+ const i = arr.indexOf(el);
+ if (i > -1) {
+ arr.splice(i, 1);
+ }
+};
+const hasOwnProperty$c = Object.prototype.hasOwnProperty;
+const hasOwn$1 = (val, key) => hasOwnProperty$c.call(val, key);
+const isArray$4 = Array.isArray;
+const isMap = (val) => toTypeString(val) === "[object Map]";
+const isSet = (val) => toTypeString(val) === "[object Set]";
+const isFunction$1 = (val) => typeof val === "function";
+const isString$2 = (val) => typeof val === "string";
+const isSymbol$1 = (val) => typeof val === "symbol";
+const isObject$2 = (val) => val !== null && typeof val === "object";
+const isPromise = (val) => {
+ return isObject$2(val) && isFunction$1(val.then) && isFunction$1(val.catch);
+};
+const objectToString$1 = Object.prototype.toString;
+const toTypeString = (value) => objectToString$1.call(value);
+const toRawType = (value) => {
+ return toTypeString(value).slice(8, -1);
+};
+const isPlainObject = (val) => toTypeString(val) === "[object Object]";
+const isIntegerKey = (key) => isString$2(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
+const isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
+const cacheStringFunction = (fn) => {
+ const cache = /* @__PURE__ */ Object.create(null);
+ return (str) => {
+ const hit = cache[str];
+ return hit || (cache[str] = fn(str));
+ };
+};
+const camelizeRE = /-(\w)/g;
+const camelize = cacheStringFunction((str) => {
+ return str.replace(camelizeRE, (_, c2) => c2 ? c2.toUpperCase() : "");
+});
+const hyphenateRE = /\B([A-Z])/g;
+const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
+const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
+const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
+const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
+const invokeArrayFns = (fns, arg) => {
+ for (let i = 0; i < fns.length; i++) {
+ fns[i](arg);
+ }
+};
+const def = (obj, key, value) => {
+ Object.defineProperty(obj, key, {
+ configurable: true,
+ enumerable: false,
+ value
+ });
+};
+const looseToNumber = (val) => {
+ const n2 = parseFloat(val);
+ return isNaN(n2) ? val : n2;
+};
+const toNumber = (val) => {
+ const n2 = isString$2(val) ? Number(val) : NaN;
+ return isNaN(n2) ? val : n2;
+};
+let _globalThis;
+const getGlobalThis = () => {
+ return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
+};
+function normalizeStyle(value) {
+ if (isArray$4(value)) {
+ const res = {};
+ for (let i = 0; i < value.length; i++) {
+ const item = value[i];
+ const normalized = isString$2(item) ? parseStringStyle(item) : normalizeStyle(item);
+ if (normalized) {
+ for (const key in normalized) {
+ res[key] = normalized[key];
+ }
+ }
+ }
+ return res;
+ } else if (isString$2(value)) {
+ return value;
+ } else if (isObject$2(value)) {
+ return value;
+ }
+}
+const listDelimiterRE = /;(?![^(]*\))/g;
+const propertyDelimiterRE = /:([^]+)/;
+const styleCommentRE = /\/\*[^]*?\*\//g;
+function parseStringStyle(cssText) {
+ const ret = {};
+ cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
+ if (item) {
+ const tmp2 = item.split(propertyDelimiterRE);
+ tmp2.length > 1 && (ret[tmp2[0].trim()] = tmp2[1].trim());
+ }
+ });
+ return ret;
+}
+function normalizeClass(value) {
+ let res = "";
+ if (isString$2(value)) {
+ res = value;
+ } else if (isArray$4(value)) {
+ for (let i = 0; i < value.length; i++) {
+ const normalized = normalizeClass(value[i]);
+ if (normalized) {
+ res += normalized + " ";
+ }
+ }
+ } else if (isObject$2(value)) {
+ for (const name in value) {
+ if (value[name]) {
+ res += name + " ";
+ }
+ }
+ }
+ return res.trim();
+}
+const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
+const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
+function includeBooleanAttr(value) {
+ return !!value || value === "";
+}
+const toDisplayString = (val) => {
+ return isString$2(val) ? val : val == null ? "" : isArray$4(val) || isObject$2(val) && (val.toString === objectToString$1 || !isFunction$1(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
+};
+const replacer = (_key, val) => {
+ if (val && val.__v_isRef) {
+ return replacer(_key, val.value);
+ } else if (isMap(val)) {
+ return {
+ [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
+ entries[`${key} =>`] = val2;
+ return entries;
+ }, {})
+ };
+ } else if (isSet(val)) {
+ return {
+ [`Set(${val.size})`]: [...val.values()]
+ };
+ } else if (isObject$2(val) && !isArray$4(val) && !isPlainObject(val)) {
+ return String(val);
+ }
+ return val;
+};
+let activeEffectScope;
+class EffectScope {
+ constructor(detached = false) {
+ this.detached = detached;
+ this._active = true;
+ this.effects = [];
+ this.cleanups = [];
+ this.parent = activeEffectScope;
+ if (!detached && activeEffectScope) {
+ this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
+ }
+ }
+ get active() {
+ return this._active;
+ }
+ run(fn) {
+ if (this._active) {
+ const currentEffectScope = activeEffectScope;
+ try {
+ activeEffectScope = this;
+ return fn();
+ } finally {
+ activeEffectScope = currentEffectScope;
+ }
+ }
+ }
+ on() {
+ activeEffectScope = this;
+ }
+ off() {
+ activeEffectScope = this.parent;
+ }
+ stop(fromParent) {
+ if (this._active) {
+ let i, l2;
+ for (i = 0, l2 = this.effects.length; i < l2; i++) {
+ this.effects[i].stop();
+ }
+ for (i = 0, l2 = this.cleanups.length; i < l2; i++) {
+ this.cleanups[i]();
+ }
+ if (this.scopes) {
+ for (i = 0, l2 = this.scopes.length; i < l2; i++) {
+ this.scopes[i].stop(true);
+ }
+ }
+ if (!this.detached && this.parent && !fromParent) {
+ const last = this.parent.scopes.pop();
+ if (last && last !== this) {
+ this.parent.scopes[this.index] = last;
+ last.index = this.index;
+ }
+ }
+ this.parent = void 0;
+ this._active = false;
+ }
+ }
+}
+function recordEffectScope(effect, scope = activeEffectScope) {
+ if (scope && scope.active) {
+ scope.effects.push(effect);
+ }
+}
+function getCurrentScope() {
+ return activeEffectScope;
+}
+function onScopeDispose(fn) {
+ if (activeEffectScope) {
+ activeEffectScope.cleanups.push(fn);
+ }
+}
+const createDep = (effects) => {
+ const dep = new Set(effects);
+ dep.w = 0;
+ dep.n = 0;
+ return dep;
+};
+const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
+const newTracked = (dep) => (dep.n & trackOpBit) > 0;
+const initDepMarkers = ({ deps }) => {
+ if (deps.length) {
+ for (let i = 0; i < deps.length; i++) {
+ deps[i].w |= trackOpBit;
+ }
+ }
+};
+const finalizeDepMarkers = (effect) => {
+ const { deps } = effect;
+ if (deps.length) {
+ let ptr = 0;
+ for (let i = 0; i < deps.length; i++) {
+ const dep = deps[i];
+ if (wasTracked(dep) && !newTracked(dep)) {
+ dep.delete(effect);
+ } else {
+ deps[ptr++] = dep;
+ }
+ dep.w &= ~trackOpBit;
+ dep.n &= ~trackOpBit;
+ }
+ deps.length = ptr;
+ }
+};
+const targetMap = /* @__PURE__ */ new WeakMap();
+let effectTrackDepth = 0;
+let trackOpBit = 1;
+const maxMarkerBits = 30;
+let activeEffect;
+const ITERATE_KEY = Symbol("");
+const MAP_KEY_ITERATE_KEY = Symbol("");
+class ReactiveEffect {
+ constructor(fn, scheduler = null, scope) {
+ this.fn = fn;
+ this.scheduler = scheduler;
+ this.active = true;
+ this.deps = [];
+ this.parent = void 0;
+ recordEffectScope(this, scope);
+ }
+ run() {
+ if (!this.active) {
+ return this.fn();
+ }
+ let parent = activeEffect;
+ let lastShouldTrack = shouldTrack;
+ while (parent) {
+ if (parent === this) {
+ return;
+ }
+ parent = parent.parent;
+ }
+ try {
+ this.parent = activeEffect;
+ activeEffect = this;
+ shouldTrack = true;
+ trackOpBit = 1 << ++effectTrackDepth;
+ if (effectTrackDepth <= maxMarkerBits) {
+ initDepMarkers(this);
+ } else {
+ cleanupEffect(this);
+ }
+ return this.fn();
+ } finally {
+ if (effectTrackDepth <= maxMarkerBits) {
+ finalizeDepMarkers(this);
+ }
+ trackOpBit = 1 << --effectTrackDepth;
+ activeEffect = this.parent;
+ shouldTrack = lastShouldTrack;
+ this.parent = void 0;
+ if (this.deferStop) {
+ this.stop();
+ }
+ }
+ }
+ stop() {
+ if (activeEffect === this) {
+ this.deferStop = true;
+ } else if (this.active) {
+ cleanupEffect(this);
+ if (this.onStop) {
+ this.onStop();
+ }
+ this.active = false;
+ }
+ }
+}
+function cleanupEffect(effect2) {
+ const { deps } = effect2;
+ if (deps.length) {
+ for (let i = 0; i < deps.length; i++) {
+ deps[i].delete(effect2);
+ }
+ deps.length = 0;
+ }
+}
+let shouldTrack = true;
+const trackStack = [];
+function pauseTracking() {
+ trackStack.push(shouldTrack);
+ shouldTrack = false;
+}
+function resetTracking() {
+ const last = trackStack.pop();
+ shouldTrack = last === void 0 ? true : last;
+}
+function track(target, type, key) {
+ if (shouldTrack && activeEffect) {
+ let depsMap = targetMap.get(target);
+ if (!depsMap) {
+ targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
+ }
+ let dep = depsMap.get(key);
+ if (!dep) {
+ depsMap.set(key, dep = createDep());
+ }
+ trackEffects(dep);
+ }
+}
+function trackEffects(dep, debuggerEventExtraInfo) {
+ let shouldTrack2 = false;
+ if (effectTrackDepth <= maxMarkerBits) {
+ if (!newTracked(dep)) {
+ dep.n |= trackOpBit;
+ shouldTrack2 = !wasTracked(dep);
+ }
+ } else {
+ shouldTrack2 = !dep.has(activeEffect);
+ }
+ if (shouldTrack2) {
+ dep.add(activeEffect);
+ activeEffect.deps.push(dep);
+ }
+}
+function trigger(target, type, key, newValue, oldValue, oldTarget) {
+ const depsMap = targetMap.get(target);
+ if (!depsMap) {
+ return;
+ }
+ let deps = [];
+ if (type === "clear") {
+ deps = [...depsMap.values()];
+ } else if (key === "length" && isArray$4(target)) {
+ const newLength = Number(newValue);
+ depsMap.forEach((dep, key2) => {
+ if (key2 === "length" || key2 >= newLength) {
+ deps.push(dep);
+ }
+ });
+ } else {
+ if (key !== void 0) {
+ deps.push(depsMap.get(key));
+ }
+ switch (type) {
+ case "add":
+ if (!isArray$4(target)) {
+ deps.push(depsMap.get(ITERATE_KEY));
+ if (isMap(target)) {
+ deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
+ }
+ } else if (isIntegerKey(key)) {
+ deps.push(depsMap.get("length"));
+ }
+ break;
+ case "delete":
+ if (!isArray$4(target)) {
+ deps.push(depsMap.get(ITERATE_KEY));
+ if (isMap(target)) {
+ deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
+ }
+ }
+ break;
+ case "set":
+ if (isMap(target)) {
+ deps.push(depsMap.get(ITERATE_KEY));
+ }
+ break;
+ }
+ }
+ if (deps.length === 1) {
+ if (deps[0]) {
+ {
+ triggerEffects(deps[0]);
+ }
+ }
+ } else {
+ const effects = [];
+ for (const dep of deps) {
+ if (dep) {
+ effects.push(...dep);
+ }
+ }
+ {
+ triggerEffects(createDep(effects));
+ }
+ }
+}
+function triggerEffects(dep, debuggerEventExtraInfo) {
+ const effects = isArray$4(dep) ? dep : [...dep];
+ for (const effect2 of effects) {
+ if (effect2.computed) {
+ triggerEffect(effect2);
+ }
+ }
+ for (const effect2 of effects) {
+ if (!effect2.computed) {
+ triggerEffect(effect2);
+ }
+ }
+}
+function triggerEffect(effect2, debuggerEventExtraInfo) {
+ if (effect2 !== activeEffect || effect2.allowRecurse) {
+ if (effect2.scheduler) {
+ effect2.scheduler();
+ } else {
+ effect2.run();
+ }
+ }
+}
+function getDepFromReactive(object, key) {
+ var _a2;
+ return (_a2 = targetMap.get(object)) == null ? void 0 : _a2.get(key);
+}
+const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
+const builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol$1));
+const get$1$1 = /* @__PURE__ */ createGetter();
+const shallowGet = /* @__PURE__ */ createGetter(false, true);
+const readonlyGet = /* @__PURE__ */ createGetter(true);
+const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
+function createArrayInstrumentations() {
+ const instrumentations = {};
+ ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
+ instrumentations[key] = function(...args) {
+ const arr = toRaw(this);
+ for (let i = 0, l2 = this.length; i < l2; i++) {
+ track(arr, "get", i + "");
+ }
+ const res = arr[key](...args);
+ if (res === -1 || res === false) {
+ return arr[key](...args.map(toRaw));
+ } else {
+ return res;
+ }
+ };
+ });
+ ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
+ instrumentations[key] = function(...args) {
+ pauseTracking();
+ const res = toRaw(this)[key].apply(this, args);
+ resetTracking();
+ return res;
+ };
+ });
+ return instrumentations;
+}
+function hasOwnProperty$b(key) {
+ const obj = toRaw(this);
+ track(obj, "has", key);
+ return obj.hasOwnProperty(key);
+}
+function createGetter(isReadonly2 = false, shallow = false) {
+ return function get2(target, key, receiver) {
+ if (key === "__v_isReactive") {
+ return !isReadonly2;
+ } else if (key === "__v_isReadonly") {
+ return isReadonly2;
+ } else if (key === "__v_isShallow") {
+ return shallow;
+ } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
+ return target;
+ }
+ const targetIsArray = isArray$4(target);
+ if (!isReadonly2) {
+ if (targetIsArray && hasOwn$1(arrayInstrumentations, key)) {
+ return Reflect.get(arrayInstrumentations, key, receiver);
+ }
+ if (key === "hasOwnProperty") {
+ return hasOwnProperty$b;
+ }
+ }
+ const res = Reflect.get(target, key, receiver);
+ if (isSymbol$1(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
+ return res;
+ }
+ if (!isReadonly2) {
+ track(target, "get", key);
+ }
+ if (shallow) {
+ return res;
+ }
+ if (isRef(res)) {
+ return targetIsArray && isIntegerKey(key) ? res : res.value;
+ }
+ if (isObject$2(res)) {
+ return isReadonly2 ? readonly(res) : reactive(res);
+ }
+ return res;
+ };
+}
+const set$1 = /* @__PURE__ */ createSetter();
+const shallowSet = /* @__PURE__ */ createSetter(true);
+function createSetter(shallow = false) {
+ return function set2(target, key, value, receiver) {
+ let oldValue = target[key];
+ if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
+ return false;
+ }
+ if (!shallow) {
+ if (!isShallow(value) && !isReadonly(value)) {
+ oldValue = toRaw(oldValue);
+ value = toRaw(value);
+ }
+ if (!isArray$4(target) && isRef(oldValue) && !isRef(value)) {
+ oldValue.value = value;
+ return true;
+ }
+ }
+ const hadKey = isArray$4(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
+ const result = Reflect.set(target, key, value, receiver);
+ if (target === toRaw(receiver)) {
+ if (!hadKey) {
+ trigger(target, "add", key, value);
+ } else if (hasChanged(value, oldValue)) {
+ trigger(target, "set", key, value);
+ }
+ }
+ return result;
+ };
+}
+function deleteProperty(target, key) {
+ const hadKey = hasOwn$1(target, key);
+ target[key];
+ const result = Reflect.deleteProperty(target, key);
+ if (result && hadKey) {
+ trigger(target, "delete", key, void 0);
+ }
+ return result;
+}
+function has$1(target, key) {
+ const result = Reflect.has(target, key);
+ if (!isSymbol$1(key) || !builtInSymbols.has(key)) {
+ track(target, "has", key);
+ }
+ return result;
+}
+function ownKeys(target) {
+ track(target, "iterate", isArray$4(target) ? "length" : ITERATE_KEY);
+ return Reflect.ownKeys(target);
+}
+const mutableHandlers = {
+ get: get$1$1,
+ set: set$1,
+ deleteProperty,
+ has: has$1,
+ ownKeys
+};
+const readonlyHandlers = {
+ get: readonlyGet,
+ set(target, key) {
+ return true;
+ },
+ deleteProperty(target, key) {
+ return true;
+ }
+};
+const shallowReactiveHandlers = /* @__PURE__ */ extend({}, mutableHandlers, {
+ get: shallowGet,
+ set: shallowSet
+});
+const toShallow = (value) => value;
+const getProto = (v2) => Reflect.getPrototypeOf(v2);
+function get$2(target, key, isReadonly2 = false, isShallow2 = false) {
+ target = target["__v_raw"];
+ const rawTarget = toRaw(target);
+ const rawKey = toRaw(key);
+ if (!isReadonly2) {
+ if (key !== rawKey) {
+ track(rawTarget, "get", key);
+ }
+ track(rawTarget, "get", rawKey);
+ }
+ const { has: has2 } = getProto(rawTarget);
+ const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
+ if (has2.call(rawTarget, key)) {
+ return wrap(target.get(key));
+ } else if (has2.call(rawTarget, rawKey)) {
+ return wrap(target.get(rawKey));
+ } else if (target !== rawTarget) {
+ target.get(key);
+ }
+}
+function has(key, isReadonly2 = false) {
+ const target = this["__v_raw"];
+ const rawTarget = toRaw(target);
+ const rawKey = toRaw(key);
+ if (!isReadonly2) {
+ if (key !== rawKey) {
+ track(rawTarget, "has", key);
+ }
+ track(rawTarget, "has", rawKey);
+ }
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
+}
+function size(target, isReadonly2 = false) {
+ target = target["__v_raw"];
+ !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
+ return Reflect.get(target, "size", target);
+}
+function add(value) {
+ value = toRaw(value);
+ const target = toRaw(this);
+ const proto = getProto(target);
+ const hadKey = proto.has.call(target, value);
+ if (!hadKey) {
+ target.add(value);
+ trigger(target, "add", value, value);
+ }
+ return this;
+}
+function set(key, value) {
+ value = toRaw(value);
+ const target = toRaw(this);
+ const { has: has2, get: get2 } = getProto(target);
+ let hadKey = has2.call(target, key);
+ if (!hadKey) {
+ key = toRaw(key);
+ hadKey = has2.call(target, key);
+ }
+ const oldValue = get2.call(target, key);
+ target.set(key, value);
+ if (!hadKey) {
+ trigger(target, "add", key, value);
+ } else if (hasChanged(value, oldValue)) {
+ trigger(target, "set", key, value);
+ }
+ return this;
+}
+function deleteEntry(key) {
+ const target = toRaw(this);
+ const { has: has2, get: get2 } = getProto(target);
+ let hadKey = has2.call(target, key);
+ if (!hadKey) {
+ key = toRaw(key);
+ hadKey = has2.call(target, key);
+ }
+ get2 ? get2.call(target, key) : void 0;
+ const result = target.delete(key);
+ if (hadKey) {
+ trigger(target, "delete", key, void 0);
+ }
+ return result;
+}
+function clear() {
+ const target = toRaw(this);
+ const hadItems = target.size !== 0;
+ const result = target.clear();
+ if (hadItems) {
+ trigger(target, "clear", void 0, void 0);
+ }
+ return result;
+}
+function createForEach(isReadonly2, isShallow2) {
+ return function forEach(callback, thisArg) {
+ const observed = this;
+ const target = observed["__v_raw"];
+ const rawTarget = toRaw(target);
+ const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
+ !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
+ return target.forEach((value, key) => {
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
+ });
+ };
+}
+function createIterableMethod(method, isReadonly2, isShallow2) {
+ return function(...args) {
+ const target = this["__v_raw"];
+ const rawTarget = toRaw(target);
+ const targetIsMap = isMap(rawTarget);
+ const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
+ const isKeyOnly = method === "keys" && targetIsMap;
+ const innerIterator = target[method](...args);
+ const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
+ !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
+ return {
+ next() {
+ const { value, done } = innerIterator.next();
+ return done ? { value, done } : {
+ value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
+ done
+ };
+ },
+ [Symbol.iterator]() {
+ return this;
+ }
+ };
+ };
+}
+function createReadonlyMethod(type) {
+ return function(...args) {
+ return type === "delete" ? false : this;
+ };
+}
+function createInstrumentations() {
+ const mutableInstrumentations2 = {
+ get(key) {
+ return get$2(this, key);
+ },
+ get size() {
+ return size(this);
+ },
+ has,
+ add,
+ set,
+ delete: deleteEntry,
+ clear,
+ forEach: createForEach(false, false)
+ };
+ const shallowInstrumentations2 = {
+ get(key) {
+ return get$2(this, key, false, true);
+ },
+ get size() {
+ return size(this);
+ },
+ has,
+ add,
+ set,
+ delete: deleteEntry,
+ clear,
+ forEach: createForEach(false, true)
+ };
+ const readonlyInstrumentations2 = {
+ get(key) {
+ return get$2(this, key, true);
+ },
+ get size() {
+ return size(this, true);
+ },
+ has(key) {
+ return has.call(this, key, true);
+ },
+ add: createReadonlyMethod("add"),
+ set: createReadonlyMethod("set"),
+ delete: createReadonlyMethod("delete"),
+ clear: createReadonlyMethod("clear"),
+ forEach: createForEach(true, false)
+ };
+ const shallowReadonlyInstrumentations2 = {
+ get(key) {
+ return get$2(this, key, true, true);
+ },
+ get size() {
+ return size(this, true);
+ },
+ has(key) {
+ return has.call(this, key, true);
+ },
+ add: createReadonlyMethod("add"),
+ set: createReadonlyMethod("set"),
+ delete: createReadonlyMethod("delete"),
+ clear: createReadonlyMethod("clear"),
+ forEach: createForEach(true, true)
+ };
+ const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
+ iteratorMethods.forEach((method) => {
+ mutableInstrumentations2[method] = createIterableMethod(method, false, false);
+ readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
+ shallowInstrumentations2[method] = createIterableMethod(method, false, true);
+ shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
+ });
+ return [
+ mutableInstrumentations2,
+ readonlyInstrumentations2,
+ shallowInstrumentations2,
+ shallowReadonlyInstrumentations2
+ ];
+}
+const [
+ mutableInstrumentations,
+ readonlyInstrumentations,
+ shallowInstrumentations,
+ shallowReadonlyInstrumentations
+] = /* @__PURE__ */ createInstrumentations();
+function createInstrumentationGetter(isReadonly2, shallow) {
+ const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
+ return (target, key, receiver) => {
+ if (key === "__v_isReactive") {
+ return !isReadonly2;
+ } else if (key === "__v_isReadonly") {
+ return isReadonly2;
+ } else if (key === "__v_raw") {
+ return target;
+ }
+ return Reflect.get(hasOwn$1(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
+ };
+}
+const mutableCollectionHandlers = {
+ get: /* @__PURE__ */ createInstrumentationGetter(false, false)
+};
+const shallowCollectionHandlers = {
+ get: /* @__PURE__ */ createInstrumentationGetter(false, true)
+};
+const readonlyCollectionHandlers = {
+ get: /* @__PURE__ */ createInstrumentationGetter(true, false)
+};
+const reactiveMap = /* @__PURE__ */ new WeakMap();
+const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
+const readonlyMap = /* @__PURE__ */ new WeakMap();
+const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
+function targetTypeMap(rawType) {
+ switch (rawType) {
+ case "Object":
+ case "Array":
+ return 1;
+ case "Map":
+ case "Set":
+ case "WeakMap":
+ case "WeakSet":
+ return 2;
+ default:
+ return 0;
+ }
+}
+function getTargetType(value) {
+ return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
+}
+function reactive(target) {
+ if (isReadonly(target)) {
+ return target;
+ }
+ return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
+}
+function shallowReactive(target) {
+ return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
+}
+function readonly(target) {
+ return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
+}
+function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
+ if (!isObject$2(target)) {
+ return target;
+ }
+ if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
+ return target;
+ }
+ const existingProxy = proxyMap.get(target);
+ if (existingProxy) {
+ return existingProxy;
+ }
+ const targetType = getTargetType(target);
+ if (targetType === 0) {
+ return target;
+ }
+ const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
+ proxyMap.set(target, proxy);
+ return proxy;
+}
+function isReactive(value) {
+ if (isReadonly(value)) {
+ return isReactive(value["__v_raw"]);
+ }
+ return !!(value && value["__v_isReactive"]);
+}
+function isReadonly(value) {
+ return !!(value && value["__v_isReadonly"]);
+}
+function isShallow(value) {
+ return !!(value && value["__v_isShallow"]);
+}
+function isProxy(value) {
+ return isReactive(value) || isReadonly(value);
+}
+function toRaw(observed) {
+ const raw = observed && observed["__v_raw"];
+ return raw ? toRaw(raw) : observed;
+}
+function markRaw(value) {
+ def(value, "__v_skip", true);
+ return value;
+}
+const toReactive = (value) => isObject$2(value) ? reactive(value) : value;
+const toReadonly = (value) => isObject$2(value) ? readonly(value) : value;
+function trackRefValue(ref2) {
+ if (shouldTrack && activeEffect) {
+ ref2 = toRaw(ref2);
+ {
+ trackEffects(ref2.dep || (ref2.dep = createDep()));
+ }
+ }
+}
+function triggerRefValue(ref2, newVal) {
+ ref2 = toRaw(ref2);
+ const dep = ref2.dep;
+ if (dep) {
+ {
+ triggerEffects(dep);
+ }
+ }
+}
+function isRef(r2) {
+ return !!(r2 && r2.__v_isRef === true);
+}
+function ref(value) {
+ return createRef(value, false);
+}
+function shallowRef(value) {
+ return createRef(value, true);
+}
+function createRef(rawValue, shallow) {
+ if (isRef(rawValue)) {
+ return rawValue;
+ }
+ return new RefImpl(rawValue, shallow);
+}
+class RefImpl {
+ constructor(value, __v_isShallow) {
+ this.__v_isShallow = __v_isShallow;
+ this.dep = void 0;
+ this.__v_isRef = true;
+ this._rawValue = __v_isShallow ? value : toRaw(value);
+ this._value = __v_isShallow ? value : toReactive(value);
+ }
+ get value() {
+ trackRefValue(this);
+ return this._value;
+ }
+ set value(newVal) {
+ const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
+ newVal = useDirectValue ? newVal : toRaw(newVal);
+ if (hasChanged(newVal, this._rawValue)) {
+ this._rawValue = newVal;
+ this._value = useDirectValue ? newVal : toReactive(newVal);
+ triggerRefValue(this);
+ }
+ }
+}
+function unref(ref2) {
+ return isRef(ref2) ? ref2.value : ref2;
+}
+const shallowUnwrapHandlers = {
+ get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
+ set: (target, key, value, receiver) => {
+ const oldValue = target[key];
+ if (isRef(oldValue) && !isRef(value)) {
+ oldValue.value = value;
+ return true;
+ } else {
+ return Reflect.set(target, key, value, receiver);
+ }
+ }
+};
+function proxyRefs(objectWithRefs) {
+ return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
+}
+function toRefs(object) {
+ const ret = isArray$4(object) ? new Array(object.length) : {};
+ for (const key in object) {
+ ret[key] = propertyToRef(object, key);
+ }
+ return ret;
+}
+class ObjectRefImpl {
+ constructor(_object, _key, _defaultValue) {
+ this._object = _object;
+ this._key = _key;
+ this._defaultValue = _defaultValue;
+ this.__v_isRef = true;
+ }
+ get value() {
+ const val = this._object[this._key];
+ return val === void 0 ? this._defaultValue : val;
+ }
+ set value(newVal) {
+ this._object[this._key] = newVal;
+ }
+ get dep() {
+ return getDepFromReactive(toRaw(this._object), this._key);
+ }
+}
+class GetterRefImpl {
+ constructor(_getter) {
+ this._getter = _getter;
+ this.__v_isRef = true;
+ this.__v_isReadonly = true;
+ }
+ get value() {
+ return this._getter();
+ }
+}
+function toRef(source, key, defaultValue) {
+ if (isRef(source)) {
+ return source;
+ } else if (isFunction$1(source)) {
+ return new GetterRefImpl(source);
+ } else if (isObject$2(source) && arguments.length > 1) {
+ return propertyToRef(source, key, defaultValue);
+ } else {
+ return ref(source);
+ }
+}
+function propertyToRef(source, key, defaultValue) {
+ const val = source[key];
+ return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
+}
+class ComputedRefImpl {
+ constructor(getter, _setter, isReadonly2, isSSR) {
+ this._setter = _setter;
+ this.dep = void 0;
+ this.__v_isRef = true;
+ this["__v_isReadonly"] = false;
+ this._dirty = true;
+ this.effect = new ReactiveEffect(getter, () => {
+ if (!this._dirty) {
+ this._dirty = true;
+ triggerRefValue(this);
+ }
+ });
+ this.effect.computed = this;
+ this.effect.active = this._cacheable = !isSSR;
+ this["__v_isReadonly"] = isReadonly2;
+ }
+ get value() {
+ const self2 = toRaw(this);
+ trackRefValue(self2);
+ if (self2._dirty || !self2._cacheable) {
+ self2._dirty = false;
+ self2._value = self2.effect.run();
+ }
+ return self2._value;
+ }
+ set value(newValue) {
+ this._setter(newValue);
+ }
+}
+function computed$1(getterOrOptions, debugOptions, isSSR = false) {
+ let getter;
+ let setter;
+ const onlyGetter = isFunction$1(getterOrOptions);
+ if (onlyGetter) {
+ getter = getterOrOptions;
+ setter = NOOP;
+ } else {
+ getter = getterOrOptions.get;
+ setter = getterOrOptions.set;
+ }
+ const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
+ return cRef;
+}
+function warn(msg, ...args) {
+ return;
+}
+function callWithErrorHandling(fn, instance, type, args) {
+ let res;
+ try {
+ res = args ? fn(...args) : fn();
+ } catch (err) {
+ handleError(err, instance, type);
+ }
+ return res;
+}
+function callWithAsyncErrorHandling(fn, instance, type, args) {
+ if (isFunction$1(fn)) {
+ const res = callWithErrorHandling(fn, instance, type, args);
+ if (res && isPromise(res)) {
+ res.catch((err) => {
+ handleError(err, instance, type);
+ });
+ }
+ return res;
+ }
+ const values = [];
+ for (let i = 0; i < fn.length; i++) {
+ values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
+ }
+ return values;
+}
+function handleError(err, instance, type, throwInDev = true) {
+ const contextVNode = instance ? instance.vnode : null;
+ if (instance) {
+ let cur = instance.parent;
+ const exposedInstance = instance.proxy;
+ const errorInfo = type;
+ while (cur) {
+ const errorCapturedHooks = cur.ec;
+ if (errorCapturedHooks) {
+ for (let i = 0; i < errorCapturedHooks.length; i++) {
+ if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
+ return;
+ }
+ }
+ }
+ cur = cur.parent;
+ }
+ const appErrorHandler = instance.appContext.config.errorHandler;
+ if (appErrorHandler) {
+ callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
+ return;
+ }
+ }
+ logError(err, type, contextVNode, throwInDev);
+}
+function logError(err, type, contextVNode, throwInDev = true) {
+ {
+ console.error(err);
+ }
+}
+let isFlushing = false;
+let isFlushPending = false;
+const queue = [];
+let flushIndex = 0;
+const pendingPostFlushCbs = [];
+let activePostFlushCbs = null;
+let postFlushIndex = 0;
+const resolvedPromise = /* @__PURE__ */ Promise.resolve();
+let currentFlushPromise = null;
+function nextTick(fn) {
+ const p2 = currentFlushPromise || resolvedPromise;
+ return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
+}
+function findInsertionIndex(id) {
+ let start = flushIndex + 1;
+ let end = queue.length;
+ while (start < end) {
+ const middle = start + end >>> 1;
+ const middleJobId = getId(queue[middle]);
+ middleJobId < id ? start = middle + 1 : end = middle;
+ }
+ return start;
+}
+function queueJob(job) {
+ if (!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
+ if (job.id == null) {
+ queue.push(job);
+ } else {
+ queue.splice(findInsertionIndex(job.id), 0, job);
+ }
+ queueFlush();
+ }
+}
+function queueFlush() {
+ if (!isFlushing && !isFlushPending) {
+ isFlushPending = true;
+ currentFlushPromise = resolvedPromise.then(flushJobs);
+ }
+}
+function invalidateJob(job) {
+ const i = queue.indexOf(job);
+ if (i > flushIndex) {
+ queue.splice(i, 1);
+ }
+}
+function queuePostFlushCb(cb) {
+ if (!isArray$4(cb)) {
+ if (!activePostFlushCbs || !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
+ pendingPostFlushCbs.push(cb);
+ }
+ } else {
+ pendingPostFlushCbs.push(...cb);
+ }
+ queueFlush();
+}
+function flushPreFlushCbs(seen2, i = isFlushing ? flushIndex + 1 : 0) {
+ for (; i < queue.length; i++) {
+ const cb = queue[i];
+ if (cb && cb.pre) {
+ queue.splice(i, 1);
+ i--;
+ cb();
+ }
+ }
+}
+function flushPostFlushCbs(seen2) {
+ if (pendingPostFlushCbs.length) {
+ const deduped = [...new Set(pendingPostFlushCbs)];
+ pendingPostFlushCbs.length = 0;
+ if (activePostFlushCbs) {
+ activePostFlushCbs.push(...deduped);
+ return;
+ }
+ activePostFlushCbs = deduped;
+ activePostFlushCbs.sort((a2, b3) => getId(a2) - getId(b3));
+ for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
+ activePostFlushCbs[postFlushIndex]();
+ }
+ activePostFlushCbs = null;
+ postFlushIndex = 0;
+ }
+}
+const getId = (job) => job.id == null ? Infinity : job.id;
+const comparator = (a2, b3) => {
+ const diff = getId(a2) - getId(b3);
+ if (diff === 0) {
+ if (a2.pre && !b3.pre)
+ return -1;
+ if (b3.pre && !a2.pre)
+ return 1;
+ }
+ return diff;
+};
+function flushJobs(seen2) {
+ isFlushPending = false;
+ isFlushing = true;
+ queue.sort(comparator);
+ const check = NOOP;
+ try {
+ for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
+ const job = queue[flushIndex];
+ if (job && job.active !== false) {
+ if (false)
+ ;
+ callWithErrorHandling(job, null, 14);
+ }
+ }
+ } finally {
+ flushIndex = 0;
+ queue.length = 0;
+ flushPostFlushCbs();
+ isFlushing = false;
+ currentFlushPromise = null;
+ if (queue.length || pendingPostFlushCbs.length) {
+ flushJobs();
+ }
+ }
+}
+function emit(instance, event, ...rawArgs) {
+ if (instance.isUnmounted)
+ return;
+ const props2 = instance.vnode.props || EMPTY_OBJ;
+ let args = rawArgs;
+ const isModelListener2 = event.startsWith("update:");
+ const modelArg = isModelListener2 && event.slice(7);
+ if (modelArg && modelArg in props2) {
+ const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
+ const { number, trim } = props2[modifiersKey] || EMPTY_OBJ;
+ if (trim) {
+ args = rawArgs.map((a2) => isString$2(a2) ? a2.trim() : a2);
+ }
+ if (number) {
+ args = rawArgs.map(looseToNumber);
+ }
+ }
+ let handlerName;
+ let handler = props2[handlerName = toHandlerKey(event)] || props2[handlerName = toHandlerKey(camelize(event))];
+ if (!handler && isModelListener2) {
+ handler = props2[handlerName = toHandlerKey(hyphenate(event))];
+ }
+ if (handler) {
+ callWithAsyncErrorHandling(handler, instance, 6, args);
+ }
+ const onceHandler = props2[handlerName + `Once`];
+ if (onceHandler) {
+ if (!instance.emitted) {
+ instance.emitted = {};
+ } else if (instance.emitted[handlerName]) {
+ return;
+ }
+ instance.emitted[handlerName] = true;
+ callWithAsyncErrorHandling(onceHandler, instance, 6, args);
+ }
+}
+function normalizeEmitsOptions(comp, appContext, asMixin = false) {
+ const cache = appContext.emitsCache;
+ const cached = cache.get(comp);
+ if (cached !== void 0) {
+ return cached;
+ }
+ const raw = comp.emits;
+ let normalized = {};
+ let hasExtends = false;
+ if (!isFunction$1(comp)) {
+ const extendEmits = (raw2) => {
+ const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
+ if (normalizedFromExtend) {
+ hasExtends = true;
+ extend(normalized, normalizedFromExtend);
+ }
+ };
+ if (!asMixin && appContext.mixins.length) {
+ appContext.mixins.forEach(extendEmits);
+ }
+ if (comp.extends) {
+ extendEmits(comp.extends);
+ }
+ if (comp.mixins) {
+ comp.mixins.forEach(extendEmits);
+ }
+ }
+ if (!raw && !hasExtends) {
+ if (isObject$2(comp)) {
+ cache.set(comp, null);
+ }
+ return null;
+ }
+ if (isArray$4(raw)) {
+ raw.forEach((key) => normalized[key] = null);
+ } else {
+ extend(normalized, raw);
+ }
+ if (isObject$2(comp)) {
+ cache.set(comp, normalized);
+ }
+ return normalized;
+}
+function isEmitListener(options, key) {
+ if (!options || !isOn(key)) {
+ return false;
+ }
+ key = key.slice(2).replace(/Once$/, "");
+ return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key);
+}
+let currentRenderingInstance = null;
+let currentScopeId = null;
+function setCurrentRenderingInstance(instance) {
+ const prev = currentRenderingInstance;
+ currentRenderingInstance = instance;
+ currentScopeId = instance && instance.type.__scopeId || null;
+ return prev;
+}
+function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
+ if (!ctx)
+ return fn;
+ if (fn._n) {
+ return fn;
+ }
+ const renderFnWithContext = (...args) => {
+ if (renderFnWithContext._d) {
+ setBlockTracking(-1);
+ }
+ const prevInstance = setCurrentRenderingInstance(ctx);
+ let res;
+ try {
+ res = fn(...args);
+ } finally {
+ setCurrentRenderingInstance(prevInstance);
+ if (renderFnWithContext._d) {
+ setBlockTracking(1);
+ }
+ }
+ return res;
+ };
+ renderFnWithContext._n = true;
+ renderFnWithContext._c = true;
+ renderFnWithContext._d = true;
+ return renderFnWithContext;
+}
+function markAttrsAccessed() {
+}
+function renderComponentRoot(instance) {
+ const {
+ type: Component,
+ vnode,
+ proxy,
+ withProxy,
+ props: props2,
+ propsOptions: [propsOptions],
+ slots,
+ attrs,
+ emit: emit2,
+ render: render2,
+ renderCache,
+ data,
+ setupState,
+ ctx,
+ inheritAttrs
+ } = instance;
+ let result;
+ let fallthroughAttrs;
+ const prev = setCurrentRenderingInstance(instance);
+ try {
+ if (vnode.shapeFlag & 4) {
+ const proxyToUse = withProxy || proxy;
+ result = normalizeVNode(render2.call(proxyToUse, proxyToUse, renderCache, props2, setupState, data, ctx));
+ fallthroughAttrs = attrs;
+ } else {
+ const render22 = Component;
+ if (false)
+ ;
+ result = normalizeVNode(render22.length > 1 ? render22(props2, false ? {
+ get attrs() {
+ markAttrsAccessed();
+ return attrs;
+ },
+ slots,
+ emit: emit2
+ } : { attrs, slots, emit: emit2 }) : render22(props2, null));
+ fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
+ }
+ } catch (err) {
+ blockStack.length = 0;
+ handleError(err, instance, 1);
+ result = createVNode(Comment$1);
+ }
+ let root2 = result;
+ if (fallthroughAttrs && inheritAttrs !== false) {
+ const keys2 = Object.keys(fallthroughAttrs);
+ const { shapeFlag } = root2;
+ if (keys2.length) {
+ if (shapeFlag & (1 | 6)) {
+ if (propsOptions && keys2.some(isModelListener)) {
+ fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
+ }
+ root2 = cloneVNode(root2, fallthroughAttrs);
+ }
+ }
+ }
+ if (vnode.dirs) {
+ root2 = cloneVNode(root2);
+ root2.dirs = root2.dirs ? root2.dirs.concat(vnode.dirs) : vnode.dirs;
+ }
+ if (vnode.transition) {
+ root2.transition = vnode.transition;
+ }
+ {
+ result = root2;
+ }
+ setCurrentRenderingInstance(prev);
+ return result;
+}
+const getFunctionalFallthrough = (attrs) => {
+ let res;
+ for (const key in attrs) {
+ if (key === "class" || key === "style" || isOn(key)) {
+ (res || (res = {}))[key] = attrs[key];
+ }
+ }
+ return res;
+};
+const filterModelListeners = (attrs, props2) => {
+ const res = {};
+ for (const key in attrs) {
+ if (!isModelListener(key) || !(key.slice(9) in props2)) {
+ res[key] = attrs[key];
+ }
+ }
+ return res;
+};
+function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
+ const { props: prevProps, children: prevChildren, component } = prevVNode;
+ const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
+ const emits = component.emitsOptions;
+ if (nextVNode.dirs || nextVNode.transition) {
+ return true;
+ }
+ if (optimized && patchFlag >= 0) {
+ if (patchFlag & 1024) {
+ return true;
+ }
+ if (patchFlag & 16) {
+ if (!prevProps) {
+ return !!nextProps;
+ }
+ return hasPropsChanged(prevProps, nextProps, emits);
+ } else if (patchFlag & 8) {
+ const dynamicProps = nextVNode.dynamicProps;
+ for (let i = 0; i < dynamicProps.length; i++) {
+ const key = dynamicProps[i];
+ if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
+ return true;
+ }
+ }
+ }
+ } else {
+ if (prevChildren || nextChildren) {
+ if (!nextChildren || !nextChildren.$stable) {
+ return true;
+ }
+ }
+ if (prevProps === nextProps) {
+ return false;
+ }
+ if (!prevProps) {
+ return !!nextProps;
+ }
+ if (!nextProps) {
+ return true;
+ }
+ return hasPropsChanged(prevProps, nextProps, emits);
+ }
+ return false;
+}
+function hasPropsChanged(prevProps, nextProps, emitsOptions) {
+ const nextKeys = Object.keys(nextProps);
+ if (nextKeys.length !== Object.keys(prevProps).length) {
+ return true;
+ }
+ for (let i = 0; i < nextKeys.length; i++) {
+ const key = nextKeys[i];
+ if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
+ return true;
+ }
+ }
+ return false;
+}
+function updateHOCHostEl({ vnode, parent }, el) {
+ while (parent && parent.subTree === vnode) {
+ (vnode = parent.vnode).el = el;
+ parent = parent.parent;
+ }
+}
+const isSuspense = (type) => type.__isSuspense;
+function queueEffectWithSuspense(fn, suspense) {
+ if (suspense && suspense.pendingBranch) {
+ if (isArray$4(fn)) {
+ suspense.effects.push(...fn);
+ } else {
+ suspense.effects.push(fn);
+ }
+ } else {
+ queuePostFlushCb(fn);
+ }
+}
+function watchEffect(effect, options) {
+ return doWatch(effect, null, options);
+}
+const INITIAL_WATCHER_VALUE = {};
+function watch(source, cb, options) {
+ return doWatch(source, cb, options);
+}
+function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
+ var _a2;
+ const instance = getCurrentScope() === ((_a2 = currentInstance) == null ? void 0 : _a2.scope) ? currentInstance : null;
+ let getter;
+ let forceTrigger = false;
+ let isMultiSource = false;
+ if (isRef(source)) {
+ getter = () => source.value;
+ forceTrigger = isShallow(source);
+ } else if (isReactive(source)) {
+ getter = () => source;
+ deep = true;
+ } else if (isArray$4(source)) {
+ isMultiSource = true;
+ forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
+ getter = () => source.map((s2) => {
+ if (isRef(s2)) {
+ return s2.value;
+ } else if (isReactive(s2)) {
+ return traverse(s2);
+ } else if (isFunction$1(s2)) {
+ return callWithErrorHandling(s2, instance, 2);
+ } else
+ ;
+ });
+ } else if (isFunction$1(source)) {
+ if (cb) {
+ getter = () => callWithErrorHandling(source, instance, 2);
+ } else {
+ getter = () => {
+ if (instance && instance.isUnmounted) {
+ return;
+ }
+ if (cleanup) {
+ cleanup();
+ }
+ return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]);
+ };
+ }
+ } else {
+ getter = NOOP;
+ }
+ if (cb && deep) {
+ const baseGetter = getter;
+ getter = () => traverse(baseGetter());
+ }
+ let cleanup;
+ let onCleanup = (fn) => {
+ cleanup = effect.onStop = () => {
+ callWithErrorHandling(fn, instance, 4);
+ };
+ };
+ let ssrCleanup;
+ if (isInSSRComponentSetup) {
+ onCleanup = NOOP;
+ if (!cb) {
+ getter();
+ } else if (immediate) {
+ callWithAsyncErrorHandling(cb, instance, 3, [
+ getter(),
+ isMultiSource ? [] : void 0,
+ onCleanup
+ ]);
+ }
+ if (flush === "sync") {
+ const ctx = useSSRContext();
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
+ } else {
+ return NOOP;
+ }
+ }
+ let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
+ const job = () => {
+ if (!effect.active) {
+ return;
+ }
+ if (cb) {
+ const newValue = effect.run();
+ if (deep || forceTrigger || (isMultiSource ? newValue.some((v2, i) => hasChanged(v2, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
+ if (cleanup) {
+ cleanup();
+ }
+ callWithAsyncErrorHandling(cb, instance, 3, [
+ newValue,
+ oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
+ onCleanup
+ ]);
+ oldValue = newValue;
+ }
+ } else {
+ effect.run();
+ }
+ };
+ job.allowRecurse = !!cb;
+ let scheduler;
+ if (flush === "sync") {
+ scheduler = job;
+ } else if (flush === "post") {
+ scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
+ } else {
+ job.pre = true;
+ if (instance)
+ job.id = instance.uid;
+ scheduler = () => queueJob(job);
+ }
+ const effect = new ReactiveEffect(getter, scheduler);
+ if (cb) {
+ if (immediate) {
+ job();
+ } else {
+ oldValue = effect.run();
+ }
+ } else if (flush === "post") {
+ queuePostRenderEffect(effect.run.bind(effect), instance && instance.suspense);
+ } else {
+ effect.run();
+ }
+ const unwatch = () => {
+ effect.stop();
+ if (instance && instance.scope) {
+ remove(instance.scope.effects, effect);
+ }
+ };
+ if (ssrCleanup)
+ ssrCleanup.push(unwatch);
+ return unwatch;
+}
+function instanceWatch(source, value, options) {
+ const publicThis = this.proxy;
+ const getter = isString$2(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
+ let cb;
+ if (isFunction$1(value)) {
+ cb = value;
+ } else {
+ cb = value.handler;
+ options = value;
+ }
+ const cur = currentInstance;
+ setCurrentInstance(this);
+ const res = doWatch(getter, cb.bind(publicThis), options);
+ if (cur) {
+ setCurrentInstance(cur);
+ } else {
+ unsetCurrentInstance();
+ }
+ return res;
+}
+function createPathGetter(ctx, path) {
+ const segments = path.split(".");
+ return () => {
+ let cur = ctx;
+ for (let i = 0; i < segments.length && cur; i++) {
+ cur = cur[segments[i]];
+ }
+ return cur;
+ };
+}
+function traverse(value, seen2) {
+ if (!isObject$2(value) || value["__v_skip"]) {
+ return value;
+ }
+ seen2 = seen2 || /* @__PURE__ */ new Set();
+ if (seen2.has(value)) {
+ return value;
+ }
+ seen2.add(value);
+ if (isRef(value)) {
+ traverse(value.value, seen2);
+ } else if (isArray$4(value)) {
+ for (let i = 0; i < value.length; i++) {
+ traverse(value[i], seen2);
+ }
+ } else if (isSet(value) || isMap(value)) {
+ value.forEach((v2) => {
+ traverse(v2, seen2);
+ });
+ } else if (isPlainObject(value)) {
+ for (const key in value) {
+ traverse(value[key], seen2);
+ }
+ }
+ return value;
+}
+function withDirectives(vnode, directives) {
+ const internalInstance = currentRenderingInstance;
+ if (internalInstance === null) {
+ return vnode;
+ }
+ const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
+ const bindings = vnode.dirs || (vnode.dirs = []);
+ for (let i = 0; i < directives.length; i++) {
+ let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
+ if (dir) {
+ if (isFunction$1(dir)) {
+ dir = {
+ mounted: dir,
+ updated: dir
+ };
+ }
+ if (dir.deep) {
+ traverse(value);
+ }
+ bindings.push({
+ dir,
+ instance,
+ value,
+ oldValue: void 0,
+ arg,
+ modifiers
+ });
+ }
+ }
+ return vnode;
+}
+function invokeDirectiveHook(vnode, prevVNode, instance, name) {
+ const bindings = vnode.dirs;
+ const oldBindings = prevVNode && prevVNode.dirs;
+ for (let i = 0; i < bindings.length; i++) {
+ const binding = bindings[i];
+ if (oldBindings) {
+ binding.oldValue = oldBindings[i].value;
+ }
+ let hook = binding.dir[name];
+ if (hook) {
+ pauseTracking();
+ callWithAsyncErrorHandling(hook, instance, 8, [
+ vnode.el,
+ binding,
+ vnode,
+ prevVNode
+ ]);
+ resetTracking();
+ }
+ }
+}
+function useTransitionState() {
+ const state = {
+ isMounted: false,
+ isLeaving: false,
+ isUnmounting: false,
+ leavingVNodes: /* @__PURE__ */ new Map()
+ };
+ onMounted(() => {
+ state.isMounted = true;
+ });
+ onBeforeUnmount(() => {
+ state.isUnmounting = true;
+ });
+ return state;
+}
+const TransitionHookValidator = [Function, Array];
+const BaseTransitionPropsValidators = {
+ mode: String,
+ appear: Boolean,
+ persisted: Boolean,
+ onBeforeEnter: TransitionHookValidator,
+ onEnter: TransitionHookValidator,
+ onAfterEnter: TransitionHookValidator,
+ onEnterCancelled: TransitionHookValidator,
+ onBeforeLeave: TransitionHookValidator,
+ onLeave: TransitionHookValidator,
+ onAfterLeave: TransitionHookValidator,
+ onLeaveCancelled: TransitionHookValidator,
+ onBeforeAppear: TransitionHookValidator,
+ onAppear: TransitionHookValidator,
+ onAfterAppear: TransitionHookValidator,
+ onAppearCancelled: TransitionHookValidator
+};
+const BaseTransitionImpl = {
+ name: `BaseTransition`,
+ props: BaseTransitionPropsValidators,
+ setup(props2, { slots }) {
+ const instance = getCurrentInstance();
+ const state = useTransitionState();
+ let prevTransitionKey;
+ return () => {
+ const children = slots.default && getTransitionRawChildren(slots.default(), true);
+ if (!children || !children.length) {
+ return;
+ }
+ let child = children[0];
+ if (children.length > 1) {
+ for (const c2 of children) {
+ if (c2.type !== Comment$1) {
+ child = c2;
+ break;
+ }
+ }
+ }
+ const rawProps = toRaw(props2);
+ const { mode: mode2 } = rawProps;
+ if (state.isLeaving) {
+ return emptyPlaceholder(child);
+ }
+ const innerChild = getKeepAliveChild(child);
+ if (!innerChild) {
+ return emptyPlaceholder(child);
+ }
+ const enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance);
+ setTransitionHooks(innerChild, enterHooks);
+ const oldChild = instance.subTree;
+ const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
+ let transitionKeyChanged = false;
+ const { getTransitionKey } = innerChild.type;
+ if (getTransitionKey) {
+ const key = getTransitionKey();
+ if (prevTransitionKey === void 0) {
+ prevTransitionKey = key;
+ } else if (key !== prevTransitionKey) {
+ prevTransitionKey = key;
+ transitionKeyChanged = true;
+ }
+ }
+ if (oldInnerChild && oldInnerChild.type !== Comment$1 && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {
+ const leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
+ setTransitionHooks(oldInnerChild, leavingHooks);
+ if (mode2 === "out-in") {
+ state.isLeaving = true;
+ leavingHooks.afterLeave = () => {
+ state.isLeaving = false;
+ if (instance.update.active !== false) {
+ instance.update();
+ }
+ };
+ return emptyPlaceholder(child);
+ } else if (mode2 === "in-out" && innerChild.type !== Comment$1) {
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
+ const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
+ leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
+ el._leaveCb = () => {
+ earlyRemove();
+ el._leaveCb = void 0;
+ delete enterHooks.delayedLeave;
+ };
+ enterHooks.delayedLeave = delayedLeave;
+ };
+ }
+ }
+ return child;
+ };
+ }
+};
+const BaseTransition = BaseTransitionImpl;
+function getLeavingNodesForType(state, vnode) {
+ const { leavingVNodes } = state;
+ let leavingVNodesCache = leavingVNodes.get(vnode.type);
+ if (!leavingVNodesCache) {
+ leavingVNodesCache = /* @__PURE__ */ Object.create(null);
+ leavingVNodes.set(vnode.type, leavingVNodesCache);
+ }
+ return leavingVNodesCache;
+}
+function resolveTransitionHooks(vnode, props2, state, instance) {
+ const {
+ appear,
+ mode: mode2,
+ persisted = false,
+ onBeforeEnter,
+ onEnter,
+ onAfterEnter,
+ onEnterCancelled,
+ onBeforeLeave,
+ onLeave,
+ onAfterLeave,
+ onLeaveCancelled,
+ onBeforeAppear,
+ onAppear,
+ onAfterAppear,
+ onAppearCancelled
+ } = props2;
+ const key = String(vnode.key);
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
+ const callHook2 = (hook, args) => {
+ hook && callWithAsyncErrorHandling(hook, instance, 9, args);
+ };
+ const callAsyncHook = (hook, args) => {
+ const done = args[1];
+ callHook2(hook, args);
+ if (isArray$4(hook)) {
+ if (hook.every((hook2) => hook2.length <= 1))
+ done();
+ } else if (hook.length <= 1) {
+ done();
+ }
+ };
+ const hooks = {
+ mode: mode2,
+ persisted,
+ beforeEnter(el) {
+ let hook = onBeforeEnter;
+ if (!state.isMounted) {
+ if (appear) {
+ hook = onBeforeAppear || onBeforeEnter;
+ } else {
+ return;
+ }
+ }
+ if (el._leaveCb) {
+ el._leaveCb(true);
+ }
+ const leavingVNode = leavingVNodesCache[key];
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) {
+ leavingVNode.el._leaveCb();
+ }
+ callHook2(hook, [el]);
+ },
+ enter(el) {
+ let hook = onEnter;
+ let afterHook = onAfterEnter;
+ let cancelHook = onEnterCancelled;
+ if (!state.isMounted) {
+ if (appear) {
+ hook = onAppear || onEnter;
+ afterHook = onAfterAppear || onAfterEnter;
+ cancelHook = onAppearCancelled || onEnterCancelled;
+ } else {
+ return;
+ }
+ }
+ let called = false;
+ const done = el._enterCb = (cancelled) => {
+ if (called)
+ return;
+ called = true;
+ if (cancelled) {
+ callHook2(cancelHook, [el]);
+ } else {
+ callHook2(afterHook, [el]);
+ }
+ if (hooks.delayedLeave) {
+ hooks.delayedLeave();
+ }
+ el._enterCb = void 0;
+ };
+ if (hook) {
+ callAsyncHook(hook, [el, done]);
+ } else {
+ done();
+ }
+ },
+ leave(el, remove2) {
+ const key2 = String(vnode.key);
+ if (el._enterCb) {
+ el._enterCb(true);
+ }
+ if (state.isUnmounting) {
+ return remove2();
+ }
+ callHook2(onBeforeLeave, [el]);
+ let called = false;
+ const done = el._leaveCb = (cancelled) => {
+ if (called)
+ return;
+ called = true;
+ remove2();
+ if (cancelled) {
+ callHook2(onLeaveCancelled, [el]);
+ } else {
+ callHook2(onAfterLeave, [el]);
+ }
+ el._leaveCb = void 0;
+ if (leavingVNodesCache[key2] === vnode) {
+ delete leavingVNodesCache[key2];
+ }
+ };
+ leavingVNodesCache[key2] = vnode;
+ if (onLeave) {
+ callAsyncHook(onLeave, [el, done]);
+ } else {
+ done();
+ }
+ },
+ clone(vnode2) {
+ return resolveTransitionHooks(vnode2, props2, state, instance);
+ }
+ };
+ return hooks;
+}
+function emptyPlaceholder(vnode) {
+ if (isKeepAlive(vnode)) {
+ vnode = cloneVNode(vnode);
+ vnode.children = null;
+ return vnode;
+ }
+}
+function getKeepAliveChild(vnode) {
+ return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode;
+}
+function setTransitionHooks(vnode, hooks) {
+ if (vnode.shapeFlag & 6 && vnode.component) {
+ setTransitionHooks(vnode.component.subTree, hooks);
+ } else if (vnode.shapeFlag & 128) {
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
+ } else {
+ vnode.transition = hooks;
+ }
+}
+function getTransitionRawChildren(children, keepComment = false, parentKey) {
+ let ret = [];
+ let keyedFragmentCount = 0;
+ for (let i = 0; i < children.length; i++) {
+ let child = children[i];
+ const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
+ if (child.type === Fragment) {
+ if (child.patchFlag & 128)
+ keyedFragmentCount++;
+ ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
+ } else if (keepComment || child.type !== Comment$1) {
+ ret.push(key != null ? cloneVNode(child, { key }) : child);
+ }
+ }
+ if (keyedFragmentCount > 1) {
+ for (let i = 0; i < ret.length; i++) {
+ ret[i].patchFlag = -2;
+ }
+ }
+ return ret;
+}
+function defineComponent(options, extraOptions) {
+ return isFunction$1(options) ? /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))() : options;
+}
+const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
+const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
+function onActivated(hook, target) {
+ registerKeepAliveHook(hook, "a", target);
+}
+function onDeactivated(hook, target) {
+ registerKeepAliveHook(hook, "da", target);
+}
+function registerKeepAliveHook(hook, type, target = currentInstance) {
+ const wrappedHook = hook.__wdc || (hook.__wdc = () => {
+ let current = target;
+ while (current) {
+ if (current.isDeactivated) {
+ return;
+ }
+ current = current.parent;
+ }
+ return hook();
+ });
+ injectHook(type, wrappedHook, target);
+ if (target) {
+ let current = target.parent;
+ while (current && current.parent) {
+ if (isKeepAlive(current.parent.vnode)) {
+ injectToKeepAliveRoot(wrappedHook, type, target, current);
+ }
+ current = current.parent;
+ }
+ }
+}
+function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
+ const injected = injectHook(type, hook, keepAliveRoot, true);
+ onUnmounted(() => {
+ remove(keepAliveRoot[type], injected);
+ }, target);
+}
+function injectHook(type, hook, target = currentInstance, prepend = false) {
+ if (target) {
+ const hooks = target[type] || (target[type] = []);
+ const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
+ if (target.isUnmounted) {
+ return;
+ }
+ pauseTracking();
+ setCurrentInstance(target);
+ const res = callWithAsyncErrorHandling(hook, target, type, args);
+ unsetCurrentInstance();
+ resetTracking();
+ return res;
+ });
+ if (prepend) {
+ hooks.unshift(wrappedHook);
+ } else {
+ hooks.push(wrappedHook);
+ }
+ return wrappedHook;
+ }
+}
+const createHook = (lifecycle) => (hook, target = currentInstance) => (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target);
+const onBeforeMount = createHook("bm");
+const onMounted = createHook("m");
+const onBeforeUpdate = createHook("bu");
+const onUpdated = createHook("u");
+const onBeforeUnmount = createHook("bum");
+const onUnmounted = createHook("um");
+const onServerPrefetch = createHook("sp");
+const onRenderTriggered = createHook("rtg");
+const onRenderTracked = createHook("rtc");
+function onErrorCaptured(hook, target = currentInstance) {
+ injectHook("ec", hook, target);
+}
+const COMPONENTS = "components";
+function resolveComponent(name, maybeSelfReference) {
+ return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
+}
+const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
+function resolveDynamicComponent(component) {
+ if (isString$2(component)) {
+ return resolveAsset(COMPONENTS, component, false) || component;
+ } else {
+ return component || NULL_DYNAMIC_COMPONENT;
+ }
+}
+function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
+ const instance = currentRenderingInstance || currentInstance;
+ if (instance) {
+ const Component = instance.type;
+ if (type === COMPONENTS) {
+ const selfName = getComponentName(Component, false);
+ if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
+ return Component;
+ }
+ }
+ const res = resolve(instance[type] || Component[type], name) || resolve(instance.appContext[type], name);
+ if (!res && maybeSelfReference) {
+ return Component;
+ }
+ return res;
+ }
+}
+function resolve(registry, name) {
+ return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
+}
+function renderList(source, renderItem, cache, index) {
+ let ret;
+ const cached = cache && cache[index];
+ if (isArray$4(source) || isString$2(source)) {
+ ret = new Array(source.length);
+ for (let i = 0, l2 = source.length; i < l2; i++) {
+ ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);
+ }
+ } else if (typeof source === "number") {
+ ret = new Array(source);
+ for (let i = 0; i < source; i++) {
+ ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
+ }
+ } else if (isObject$2(source)) {
+ if (source[Symbol.iterator]) {
+ ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
+ } else {
+ const keys2 = Object.keys(source);
+ ret = new Array(keys2.length);
+ for (let i = 0, l2 = keys2.length; i < l2; i++) {
+ const key = keys2[i];
+ ret[i] = renderItem(source[key], key, i, cached && cached[i]);
+ }
+ }
+ } else {
+ ret = [];
+ }
+ if (cache) {
+ cache[index] = ret;
+ }
+ return ret;
+}
+function renderSlot(slots, name, props2 = {}, fallback, noSlotted) {
+ if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
+ if (name !== "default")
+ props2.name = name;
+ return createVNode("slot", props2, fallback && fallback());
+ }
+ let slot = slots[name];
+ if (slot && slot._c) {
+ slot._d = false;
+ }
+ openBlock();
+ const validSlotContent = slot && ensureValidVNode(slot(props2));
+ const rendered = createBlock(Fragment, {
+ key: props2.key || validSlotContent && validSlotContent.key || `_${name}`
+ }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
+ if (!noSlotted && rendered.scopeId) {
+ rendered.slotScopeIds = [rendered.scopeId + "-s"];
+ }
+ if (slot && slot._c) {
+ slot._d = true;
+ }
+ return rendered;
+}
+function ensureValidVNode(vnodes) {
+ return vnodes.some((child) => {
+ if (!isVNode(child))
+ return true;
+ if (child.type === Comment$1)
+ return false;
+ if (child.type === Fragment && !ensureValidVNode(child.children))
+ return false;
+ return true;
+ }) ? vnodes : null;
+}
+const getPublicInstance = (i) => {
+ if (!i)
+ return null;
+ if (isStatefulComponent(i))
+ return getExposeProxy(i) || i.proxy;
+ return getPublicInstance(i.parent);
+};
+const publicPropertiesMap = /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
+ $: (i) => i,
+ $el: (i) => i.vnode.el,
+ $data: (i) => i.data,
+ $props: (i) => i.props,
+ $attrs: (i) => i.attrs,
+ $slots: (i) => i.slots,
+ $refs: (i) => i.refs,
+ $parent: (i) => getPublicInstance(i.parent),
+ $root: (i) => getPublicInstance(i.root),
+ $emit: (i) => i.emit,
+ $options: (i) => resolveMergedOptions(i),
+ $forceUpdate: (i) => i.f || (i.f = () => queueJob(i.update)),
+ $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
+ $watch: (i) => instanceWatch.bind(i)
+});
+const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key);
+const PublicInstanceProxyHandlers = {
+ get({ _: instance }, key) {
+ const { ctx, setupState, data, props: props2, accessCache, type, appContext } = instance;
+ let normalizedProps;
+ if (key[0] !== "$") {
+ const n2 = accessCache[key];
+ if (n2 !== void 0) {
+ switch (n2) {
+ case 1:
+ return setupState[key];
+ case 2:
+ return data[key];
+ case 4:
+ return ctx[key];
+ case 3:
+ return props2[key];
+ }
+ } else if (hasSetupBinding(setupState, key)) {
+ accessCache[key] = 1;
+ return setupState[key];
+ } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
+ accessCache[key] = 2;
+ return data[key];
+ } else if ((normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key)) {
+ accessCache[key] = 3;
+ return props2[key];
+ } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
+ accessCache[key] = 4;
+ return ctx[key];
+ } else if (shouldCacheAccess) {
+ accessCache[key] = 0;
+ }
+ }
+ const publicGetter = publicPropertiesMap[key];
+ let cssModule, globalProperties;
+ if (publicGetter) {
+ if (key === "$attrs") {
+ track(instance, "get", key);
+ }
+ return publicGetter(instance);
+ } else if ((cssModule = type.__cssModules) && (cssModule = cssModule[key])) {
+ return cssModule;
+ } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
+ accessCache[key] = 4;
+ return ctx[key];
+ } else if (globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key)) {
+ {
+ return globalProperties[key];
+ }
+ } else
+ ;
+ },
+ set({ _: instance }, key, value) {
+ const { data, setupState, ctx } = instance;
+ if (hasSetupBinding(setupState, key)) {
+ setupState[key] = value;
+ return true;
+ } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
+ data[key] = value;
+ return true;
+ } else if (hasOwn$1(instance.props, key)) {
+ return false;
+ }
+ if (key[0] === "$" && key.slice(1) in instance) {
+ return false;
+ } else {
+ {
+ ctx[key] = value;
+ }
+ }
+ return true;
+ },
+ has({
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions }
+ }, key) {
+ let normalizedProps;
+ return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key);
+ },
+ defineProperty(target, key, descriptor) {
+ if (descriptor.get != null) {
+ target._.accessCache[key] = 0;
+ } else if (hasOwn$1(descriptor, "value")) {
+ this.set(target, key, descriptor.value, null);
+ }
+ return Reflect.defineProperty(target, key, descriptor);
+ }
+};
+function normalizePropsOrEmits(props2) {
+ return isArray$4(props2) ? props2.reduce((normalized, p2) => (normalized[p2] = null, normalized), {}) : props2;
+}
+let shouldCacheAccess = true;
+function applyOptions(instance) {
+ const options = resolveMergedOptions(instance);
+ const publicThis = instance.proxy;
+ const ctx = instance.ctx;
+ shouldCacheAccess = false;
+ if (options.beforeCreate) {
+ callHook$1(options.beforeCreate, instance, "bc");
+ }
+ const {
+ data: dataOptions,
+ computed: computedOptions,
+ methods,
+ watch: watchOptions,
+ provide: provideOptions,
+ inject: injectOptions,
+ created,
+ beforeMount,
+ mounted,
+ beforeUpdate,
+ updated,
+ activated,
+ deactivated,
+ beforeDestroy,
+ beforeUnmount,
+ destroyed,
+ unmounted,
+ render: render2,
+ renderTracked,
+ renderTriggered,
+ errorCaptured,
+ serverPrefetch,
+ expose,
+ inheritAttrs,
+ components,
+ directives,
+ filters
+ } = options;
+ const checkDuplicateProperties = null;
+ if (injectOptions) {
+ resolveInjections(injectOptions, ctx, checkDuplicateProperties);
+ }
+ if (methods) {
+ for (const key in methods) {
+ const methodHandler = methods[key];
+ if (isFunction$1(methodHandler)) {
+ {
+ ctx[key] = methodHandler.bind(publicThis);
+ }
+ }
+ }
+ }
+ if (dataOptions) {
+ const data = dataOptions.call(publicThis, publicThis);
+ if (!isObject$2(data))
+ ;
+ else {
+ instance.data = reactive(data);
+ }
+ }
+ shouldCacheAccess = true;
+ if (computedOptions) {
+ for (const key in computedOptions) {
+ const opt = computedOptions[key];
+ const get2 = isFunction$1(opt) ? opt.bind(publicThis, publicThis) : isFunction$1(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
+ const set2 = !isFunction$1(opt) && isFunction$1(opt.set) ? opt.set.bind(publicThis) : NOOP;
+ const c2 = computed({
+ get: get2,
+ set: set2
+ });
+ Object.defineProperty(ctx, key, {
+ enumerable: true,
+ configurable: true,
+ get: () => c2.value,
+ set: (v2) => c2.value = v2
+ });
+ }
+ }
+ if (watchOptions) {
+ for (const key in watchOptions) {
+ createWatcher(watchOptions[key], ctx, publicThis, key);
+ }
+ }
+ if (provideOptions) {
+ const provides = isFunction$1(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
+ Reflect.ownKeys(provides).forEach((key) => {
+ provide(key, provides[key]);
+ });
+ }
+ if (created) {
+ callHook$1(created, instance, "c");
+ }
+ function registerLifecycleHook(register2, hook) {
+ if (isArray$4(hook)) {
+ hook.forEach((_hook) => register2(_hook.bind(publicThis)));
+ } else if (hook) {
+ register2(hook.bind(publicThis));
+ }
+ }
+ registerLifecycleHook(onBeforeMount, beforeMount);
+ registerLifecycleHook(onMounted, mounted);
+ registerLifecycleHook(onBeforeUpdate, beforeUpdate);
+ registerLifecycleHook(onUpdated, updated);
+ registerLifecycleHook(onActivated, activated);
+ registerLifecycleHook(onDeactivated, deactivated);
+ registerLifecycleHook(onErrorCaptured, errorCaptured);
+ registerLifecycleHook(onRenderTracked, renderTracked);
+ registerLifecycleHook(onRenderTriggered, renderTriggered);
+ registerLifecycleHook(onBeforeUnmount, beforeUnmount);
+ registerLifecycleHook(onUnmounted, unmounted);
+ registerLifecycleHook(onServerPrefetch, serverPrefetch);
+ if (isArray$4(expose)) {
+ if (expose.length) {
+ const exposed = instance.exposed || (instance.exposed = {});
+ expose.forEach((key) => {
+ Object.defineProperty(exposed, key, {
+ get: () => publicThis[key],
+ set: (val) => publicThis[key] = val
+ });
+ });
+ } else if (!instance.exposed) {
+ instance.exposed = {};
+ }
+ }
+ if (render2 && instance.render === NOOP) {
+ instance.render = render2;
+ }
+ if (inheritAttrs != null) {
+ instance.inheritAttrs = inheritAttrs;
+ }
+ if (components)
+ instance.components = components;
+ if (directives)
+ instance.directives = directives;
+}
+function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
+ if (isArray$4(injectOptions)) {
+ injectOptions = normalizeInject(injectOptions);
+ }
+ for (const key in injectOptions) {
+ const opt = injectOptions[key];
+ let injected;
+ if (isObject$2(opt)) {
+ if ("default" in opt) {
+ injected = inject$1(opt.from || key, opt.default, true);
+ } else {
+ injected = inject$1(opt.from || key);
+ }
+ } else {
+ injected = inject$1(opt);
+ }
+ if (isRef(injected)) {
+ Object.defineProperty(ctx, key, {
+ enumerable: true,
+ configurable: true,
+ get: () => injected.value,
+ set: (v2) => injected.value = v2
+ });
+ } else {
+ ctx[key] = injected;
+ }
+ }
+}
+function callHook$1(hook, instance, type) {
+ callWithAsyncErrorHandling(isArray$4(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
+}
+function createWatcher(raw, ctx, publicThis, key) {
+ const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
+ if (isString$2(raw)) {
+ const handler = ctx[raw];
+ if (isFunction$1(handler)) {
+ watch(getter, handler);
+ }
+ } else if (isFunction$1(raw)) {
+ watch(getter, raw.bind(publicThis));
+ } else if (isObject$2(raw)) {
+ if (isArray$4(raw)) {
+ raw.forEach((r2) => createWatcher(r2, ctx, publicThis, key));
+ } else {
+ const handler = isFunction$1(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
+ if (isFunction$1(handler)) {
+ watch(getter, handler, raw);
+ }
+ }
+ } else
+ ;
+}
+function resolveMergedOptions(instance) {
+ const base2 = instance.type;
+ const { mixins, extends: extendsOptions } = base2;
+ const {
+ mixins: globalMixins,
+ optionsCache: cache,
+ config: { optionMergeStrategies }
+ } = instance.appContext;
+ const cached = cache.get(base2);
+ let resolved;
+ if (cached) {
+ resolved = cached;
+ } else if (!globalMixins.length && !mixins && !extendsOptions) {
+ {
+ resolved = base2;
+ }
+ } else {
+ resolved = {};
+ if (globalMixins.length) {
+ globalMixins.forEach((m2) => mergeOptions$1(resolved, m2, optionMergeStrategies, true));
+ }
+ mergeOptions$1(resolved, base2, optionMergeStrategies);
+ }
+ if (isObject$2(base2)) {
+ cache.set(base2, resolved);
+ }
+ return resolved;
+}
+function mergeOptions$1(to, from, strats, asMixin = false) {
+ const { mixins, extends: extendsOptions } = from;
+ if (extendsOptions) {
+ mergeOptions$1(to, extendsOptions, strats, true);
+ }
+ if (mixins) {
+ mixins.forEach((m2) => mergeOptions$1(to, m2, strats, true));
+ }
+ for (const key in from) {
+ if (asMixin && key === "expose")
+ ;
+ else {
+ const strat = internalOptionMergeStrats[key] || strats && strats[key];
+ to[key] = strat ? strat(to[key], from[key]) : from[key];
+ }
+ }
+ return to;
+}
+const internalOptionMergeStrats = {
+ data: mergeDataFn,
+ props: mergeEmitsOrPropsOptions,
+ emits: mergeEmitsOrPropsOptions,
+ methods: mergeObjectOptions,
+ computed: mergeObjectOptions,
+ beforeCreate: mergeAsArray,
+ created: mergeAsArray,
+ beforeMount: mergeAsArray,
+ mounted: mergeAsArray,
+ beforeUpdate: mergeAsArray,
+ updated: mergeAsArray,
+ beforeDestroy: mergeAsArray,
+ beforeUnmount: mergeAsArray,
+ destroyed: mergeAsArray,
+ unmounted: mergeAsArray,
+ activated: mergeAsArray,
+ deactivated: mergeAsArray,
+ errorCaptured: mergeAsArray,
+ serverPrefetch: mergeAsArray,
+ components: mergeObjectOptions,
+ directives: mergeObjectOptions,
+ watch: mergeWatchOptions,
+ provide: mergeDataFn,
+ inject: mergeInject
+};
+function mergeDataFn(to, from) {
+ if (!from) {
+ return to;
+ }
+ if (!to) {
+ return from;
+ }
+ return function mergedDataFn() {
+ return extend(isFunction$1(to) ? to.call(this, this) : to, isFunction$1(from) ? from.call(this, this) : from);
+ };
+}
+function mergeInject(to, from) {
+ return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
+}
+function normalizeInject(raw) {
+ if (isArray$4(raw)) {
+ const res = {};
+ for (let i = 0; i < raw.length; i++) {
+ res[raw[i]] = raw[i];
+ }
+ return res;
+ }
+ return raw;
+}
+function mergeAsArray(to, from) {
+ return to ? [...new Set([].concat(to, from))] : from;
+}
+function mergeObjectOptions(to, from) {
+ return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
+}
+function mergeEmitsOrPropsOptions(to, from) {
+ if (to) {
+ if (isArray$4(to) && isArray$4(from)) {
+ return [.../* @__PURE__ */ new Set([...to, ...from])];
+ }
+ return extend(/* @__PURE__ */ Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from != null ? from : {}));
+ } else {
+ return from;
+ }
+}
+function mergeWatchOptions(to, from) {
+ if (!to)
+ return from;
+ if (!from)
+ return to;
+ const merged = extend(/* @__PURE__ */ Object.create(null), to);
+ for (const key in from) {
+ merged[key] = mergeAsArray(to[key], from[key]);
+ }
+ return merged;
+}
+function createAppContext() {
+ return {
+ app: null,
+ config: {
+ isNativeTag: NO,
+ performance: false,
+ globalProperties: {},
+ optionMergeStrategies: {},
+ errorHandler: void 0,
+ warnHandler: void 0,
+ compilerOptions: {}
+ },
+ mixins: [],
+ components: {},
+ directives: {},
+ provides: /* @__PURE__ */ Object.create(null),
+ optionsCache: /* @__PURE__ */ new WeakMap(),
+ propsCache: /* @__PURE__ */ new WeakMap(),
+ emitsCache: /* @__PURE__ */ new WeakMap()
+ };
+}
+let uid$1 = 0;
+function createAppAPI(render2, hydrate) {
+ return function createApp2(rootComponent, rootProps = null) {
+ if (!isFunction$1(rootComponent)) {
+ rootComponent = extend({}, rootComponent);
+ }
+ if (rootProps != null && !isObject$2(rootProps)) {
+ rootProps = null;
+ }
+ const context = createAppContext();
+ const installedPlugins = /* @__PURE__ */ new Set();
+ let isMounted = false;
+ const app2 = context.app = {
+ _uid: uid$1++,
+ _component: rootComponent,
+ _props: rootProps,
+ _container: null,
+ _context: context,
+ _instance: null,
+ version,
+ get config() {
+ return context.config;
+ },
+ set config(v2) {
+ },
+ use(plugin, ...options) {
+ if (installedPlugins.has(plugin))
+ ;
+ else if (plugin && isFunction$1(plugin.install)) {
+ installedPlugins.add(plugin);
+ plugin.install(app2, ...options);
+ } else if (isFunction$1(plugin)) {
+ installedPlugins.add(plugin);
+ plugin(app2, ...options);
+ } else
+ ;
+ return app2;
+ },
+ mixin(mixin) {
+ {
+ if (!context.mixins.includes(mixin)) {
+ context.mixins.push(mixin);
+ }
+ }
+ return app2;
+ },
+ component(name, component) {
+ if (!component) {
+ return context.components[name];
+ }
+ context.components[name] = component;
+ return app2;
+ },
+ directive(name, directive) {
+ if (!directive) {
+ return context.directives[name];
+ }
+ context.directives[name] = directive;
+ return app2;
+ },
+ mount(rootContainer, isHydrate, isSVG) {
+ if (!isMounted) {
+ const vnode = createVNode(rootComponent, rootProps);
+ vnode.appContext = context;
+ if (isHydrate && hydrate) {
+ hydrate(vnode, rootContainer);
+ } else {
+ render2(vnode, rootContainer, isSVG);
+ }
+ isMounted = true;
+ app2._container = rootContainer;
+ rootContainer.__vue_app__ = app2;
+ return getExposeProxy(vnode.component) || vnode.component.proxy;
+ }
+ },
+ unmount() {
+ if (isMounted) {
+ render2(null, app2._container);
+ delete app2._container.__vue_app__;
+ }
+ },
+ provide(key, value) {
+ context.provides[key] = value;
+ return app2;
+ },
+ runWithContext(fn) {
+ currentApp = app2;
+ try {
+ return fn();
+ } finally {
+ currentApp = null;
+ }
+ }
+ };
+ return app2;
+ };
+}
+let currentApp = null;
+function provide(key, value) {
+ if (!currentInstance)
+ ;
+ else {
+ let provides = currentInstance.provides;
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
+ if (parentProvides === provides) {
+ provides = currentInstance.provides = Object.create(parentProvides);
+ }
+ provides[key] = value;
+ }
+}
+function inject$1(key, defaultValue, treatDefaultAsFactory = false) {
+ const instance = currentInstance || currentRenderingInstance;
+ if (instance || currentApp) {
+ const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
+ if (provides && key in provides) {
+ return provides[key];
+ } else if (arguments.length > 1) {
+ return treatDefaultAsFactory && isFunction$1(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
+ } else
+ ;
+ }
+}
+function initProps(instance, rawProps, isStateful, isSSR = false) {
+ const props2 = {};
+ const attrs = {};
+ def(attrs, InternalObjectKey, 1);
+ instance.propsDefaults = /* @__PURE__ */ Object.create(null);
+ setFullProps(instance, rawProps, props2, attrs);
+ for (const key in instance.propsOptions[0]) {
+ if (!(key in props2)) {
+ props2[key] = void 0;
+ }
+ }
+ if (isStateful) {
+ instance.props = isSSR ? props2 : shallowReactive(props2);
+ } else {
+ if (!instance.type.props) {
+ instance.props = attrs;
+ } else {
+ instance.props = props2;
+ }
+ }
+ instance.attrs = attrs;
+}
+function updateProps(instance, rawProps, rawPrevProps, optimized) {
+ const {
+ props: props2,
+ attrs,
+ vnode: { patchFlag }
+ } = instance;
+ const rawCurrentProps = toRaw(props2);
+ const [options] = instance.propsOptions;
+ let hasAttrsChanged = false;
+ if ((optimized || patchFlag > 0) && !(patchFlag & 16)) {
+ if (patchFlag & 8) {
+ const propsToUpdate = instance.vnode.dynamicProps;
+ for (let i = 0; i < propsToUpdate.length; i++) {
+ let key = propsToUpdate[i];
+ if (isEmitListener(instance.emitsOptions, key)) {
+ continue;
+ }
+ const value = rawProps[key];
+ if (options) {
+ if (hasOwn$1(attrs, key)) {
+ if (value !== attrs[key]) {
+ attrs[key] = value;
+ hasAttrsChanged = true;
+ }
+ } else {
+ const camelizedKey = camelize(key);
+ props2[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false);
+ }
+ } else {
+ if (value !== attrs[key]) {
+ attrs[key] = value;
+ hasAttrsChanged = true;
+ }
+ }
+ }
+ }
+ } else {
+ if (setFullProps(instance, rawProps, props2, attrs)) {
+ hasAttrsChanged = true;
+ }
+ let kebabKey;
+ for (const key in rawCurrentProps) {
+ if (!rawProps || !hasOwn$1(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) {
+ if (options) {
+ if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) {
+ props2[key] = resolvePropValue(options, rawCurrentProps, key, void 0, instance, true);
+ }
+ } else {
+ delete props2[key];
+ }
+ }
+ }
+ if (attrs !== rawCurrentProps) {
+ for (const key in attrs) {
+ if (!rawProps || !hasOwn$1(rawProps, key) && true) {
+ delete attrs[key];
+ hasAttrsChanged = true;
+ }
+ }
+ }
+ }
+ if (hasAttrsChanged) {
+ trigger(instance, "set", "$attrs");
+ }
+}
+function setFullProps(instance, rawProps, props2, attrs) {
+ const [options, needCastKeys] = instance.propsOptions;
+ let hasAttrsChanged = false;
+ let rawCastValues;
+ if (rawProps) {
+ for (let key in rawProps) {
+ if (isReservedProp(key)) {
+ continue;
+ }
+ const value = rawProps[key];
+ let camelKey;
+ if (options && hasOwn$1(options, camelKey = camelize(key))) {
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) {
+ props2[camelKey] = value;
+ } else {
+ (rawCastValues || (rawCastValues = {}))[camelKey] = value;
+ }
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
+ if (!(key in attrs) || value !== attrs[key]) {
+ attrs[key] = value;
+ hasAttrsChanged = true;
+ }
+ }
+ }
+ }
+ if (needCastKeys) {
+ const rawCurrentProps = toRaw(props2);
+ const castValues = rawCastValues || EMPTY_OBJ;
+ for (let i = 0; i < needCastKeys.length; i++) {
+ const key = needCastKeys[i];
+ props2[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn$1(castValues, key));
+ }
+ }
+ return hasAttrsChanged;
+}
+function resolvePropValue(options, props2, key, value, instance, isAbsent) {
+ const opt = options[key];
+ if (opt != null) {
+ const hasDefault = hasOwn$1(opt, "default");
+ if (hasDefault && value === void 0) {
+ const defaultValue = opt.default;
+ if (opt.type !== Function && !opt.skipFactory && isFunction$1(defaultValue)) {
+ const { propsDefaults } = instance;
+ if (key in propsDefaults) {
+ value = propsDefaults[key];
+ } else {
+ setCurrentInstance(instance);
+ value = propsDefaults[key] = defaultValue.call(null, props2);
+ unsetCurrentInstance();
+ }
+ } else {
+ value = defaultValue;
+ }
+ }
+ if (opt[0]) {
+ if (isAbsent && !hasDefault) {
+ value = false;
+ } else if (opt[1] && (value === "" || value === hyphenate(key))) {
+ value = true;
+ }
+ }
+ }
+ return value;
+}
+function normalizePropsOptions(comp, appContext, asMixin = false) {
+ const cache = appContext.propsCache;
+ const cached = cache.get(comp);
+ if (cached) {
+ return cached;
+ }
+ const raw = comp.props;
+ const normalized = {};
+ const needCastKeys = [];
+ let hasExtends = false;
+ if (!isFunction$1(comp)) {
+ const extendProps = (raw2) => {
+ hasExtends = true;
+ const [props2, keys2] = normalizePropsOptions(raw2, appContext, true);
+ extend(normalized, props2);
+ if (keys2)
+ needCastKeys.push(...keys2);
+ };
+ if (!asMixin && appContext.mixins.length) {
+ appContext.mixins.forEach(extendProps);
+ }
+ if (comp.extends) {
+ extendProps(comp.extends);
+ }
+ if (comp.mixins) {
+ comp.mixins.forEach(extendProps);
+ }
+ }
+ if (!raw && !hasExtends) {
+ if (isObject$2(comp)) {
+ cache.set(comp, EMPTY_ARR);
+ }
+ return EMPTY_ARR;
+ }
+ if (isArray$4(raw)) {
+ for (let i = 0; i < raw.length; i++) {
+ const normalizedKey = camelize(raw[i]);
+ if (validatePropName(normalizedKey)) {
+ normalized[normalizedKey] = EMPTY_OBJ;
+ }
+ }
+ } else if (raw) {
+ for (const key in raw) {
+ const normalizedKey = camelize(key);
+ if (validatePropName(normalizedKey)) {
+ const opt = raw[key];
+ const prop = normalized[normalizedKey] = isArray$4(opt) || isFunction$1(opt) ? { type: opt } : extend({}, opt);
+ if (prop) {
+ const booleanIndex = getTypeIndex(Boolean, prop.type);
+ const stringIndex = getTypeIndex(String, prop.type);
+ prop[0] = booleanIndex > -1;
+ prop[1] = stringIndex < 0 || booleanIndex < stringIndex;
+ if (booleanIndex > -1 || hasOwn$1(prop, "default")) {
+ needCastKeys.push(normalizedKey);
+ }
+ }
+ }
+ }
+ }
+ const res = [normalized, needCastKeys];
+ if (isObject$2(comp)) {
+ cache.set(comp, res);
+ }
+ return res;
+}
+function validatePropName(key) {
+ if (key[0] !== "$") {
+ return true;
+ }
+ return false;
+}
+function getType(ctor) {
+ const match2 = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
+ return match2 ? match2[2] : ctor === null ? "null" : "";
+}
+function isSameType(a2, b3) {
+ return getType(a2) === getType(b3);
+}
+function getTypeIndex(type, expectedTypes) {
+ if (isArray$4(expectedTypes)) {
+ return expectedTypes.findIndex((t2) => isSameType(t2, type));
+ } else if (isFunction$1(expectedTypes)) {
+ return isSameType(expectedTypes, type) ? 0 : -1;
+ }
+ return -1;
+}
+const isInternalKey = (key) => key[0] === "_" || key === "$stable";
+const normalizeSlotValue = (value) => isArray$4(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
+const normalizeSlot$1 = (key, rawSlot, ctx) => {
+ if (rawSlot._n) {
+ return rawSlot;
+ }
+ const normalized = withCtx((...args) => {
+ if (false)
+ ;
+ return normalizeSlotValue(rawSlot(...args));
+ }, ctx);
+ normalized._c = false;
+ return normalized;
+};
+const normalizeObjectSlots = (rawSlots, slots, instance) => {
+ const ctx = rawSlots._ctx;
+ for (const key in rawSlots) {
+ if (isInternalKey(key))
+ continue;
+ const value = rawSlots[key];
+ if (isFunction$1(value)) {
+ slots[key] = normalizeSlot$1(key, value, ctx);
+ } else if (value != null) {
+ const normalized = normalizeSlotValue(value);
+ slots[key] = () => normalized;
+ }
+ }
+};
+const normalizeVNodeSlots = (instance, children) => {
+ const normalized = normalizeSlotValue(children);
+ instance.slots.default = () => normalized;
+};
+const initSlots = (instance, children) => {
+ if (instance.vnode.shapeFlag & 32) {
+ const type = children._;
+ if (type) {
+ instance.slots = toRaw(children);
+ def(children, "_", type);
+ } else {
+ normalizeObjectSlots(children, instance.slots = {});
+ }
+ } else {
+ instance.slots = {};
+ if (children) {
+ normalizeVNodeSlots(instance, children);
+ }
+ }
+ def(instance.slots, InternalObjectKey, 1);
+};
+const updateSlots = (instance, children, optimized) => {
+ const { vnode, slots } = instance;
+ let needDeletionCheck = true;
+ let deletionComparisonTarget = EMPTY_OBJ;
+ if (vnode.shapeFlag & 32) {
+ const type = children._;
+ if (type) {
+ if (optimized && type === 1) {
+ needDeletionCheck = false;
+ } else {
+ extend(slots, children);
+ if (!optimized && type === 1) {
+ delete slots._;
+ }
+ }
+ } else {
+ needDeletionCheck = !children.$stable;
+ normalizeObjectSlots(children, slots);
+ }
+ deletionComparisonTarget = children;
+ } else if (children) {
+ normalizeVNodeSlots(instance, children);
+ deletionComparisonTarget = { default: 1 };
+ }
+ if (needDeletionCheck) {
+ for (const key in slots) {
+ if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
+ delete slots[key];
+ }
+ }
+ }
+};
+function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
+ if (isArray$4(rawRef)) {
+ rawRef.forEach((r2, i) => setRef(r2, oldRawRef && (isArray$4(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
+ return;
+ }
+ if (isAsyncWrapper(vnode) && !isUnmount) {
+ return;
+ }
+ const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el;
+ const value = isUnmount ? null : refValue;
+ const { i: owner, r: ref2 } = rawRef;
+ const oldRef = oldRawRef && oldRawRef.r;
+ const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
+ const setupState = owner.setupState;
+ if (oldRef != null && oldRef !== ref2) {
+ if (isString$2(oldRef)) {
+ refs[oldRef] = null;
+ if (hasOwn$1(setupState, oldRef)) {
+ setupState[oldRef] = null;
+ }
+ } else if (isRef(oldRef)) {
+ oldRef.value = null;
+ }
+ }
+ if (isFunction$1(ref2)) {
+ callWithErrorHandling(ref2, owner, 12, [value, refs]);
+ } else {
+ const _isString = isString$2(ref2);
+ const _isRef = isRef(ref2);
+ if (_isString || _isRef) {
+ const doSet = () => {
+ if (rawRef.f) {
+ const existing = _isString ? hasOwn$1(setupState, ref2) ? setupState[ref2] : refs[ref2] : ref2.value;
+ if (isUnmount) {
+ isArray$4(existing) && remove(existing, refValue);
+ } else {
+ if (!isArray$4(existing)) {
+ if (_isString) {
+ refs[ref2] = [refValue];
+ if (hasOwn$1(setupState, ref2)) {
+ setupState[ref2] = refs[ref2];
+ }
+ } else {
+ ref2.value = [refValue];
+ if (rawRef.k)
+ refs[rawRef.k] = ref2.value;
+ }
+ } else if (!existing.includes(refValue)) {
+ existing.push(refValue);
+ }
+ }
+ } else if (_isString) {
+ refs[ref2] = value;
+ if (hasOwn$1(setupState, ref2)) {
+ setupState[ref2] = value;
+ }
+ } else if (_isRef) {
+ ref2.value = value;
+ if (rawRef.k)
+ refs[rawRef.k] = value;
+ } else
+ ;
+ };
+ if (value) {
+ doSet.id = -1;
+ queuePostRenderEffect(doSet, parentSuspense);
+ } else {
+ doSet();
+ }
+ }
+ }
+}
+const queuePostRenderEffect = queueEffectWithSuspense;
+function createRenderer(options) {
+ return baseCreateRenderer(options);
+}
+function baseCreateRenderer(options, createHydrationFns) {
+ const target = getGlobalThis();
+ target.__VUE__ = true;
+ const {
+ insert: hostInsert,
+ remove: hostRemove,
+ patchProp: hostPatchProp,
+ createElement: hostCreateElement,
+ createText: hostCreateText,
+ createComment: hostCreateComment,
+ setText: hostSetText,
+ setElementText: hostSetElementText,
+ parentNode: hostParentNode,
+ nextSibling: hostNextSibling,
+ setScopeId: hostSetScopeId = NOOP,
+ insertStaticContent: hostInsertStaticContent
+ } = options;
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
+ if (n1 === n2) {
+ return;
+ }
+ if (n1 && !isSameVNodeType(n1, n2)) {
+ anchor = getNextHostNode(n1);
+ unmount(n1, parentComponent, parentSuspense, true);
+ n1 = null;
+ }
+ if (n2.patchFlag === -2) {
+ optimized = false;
+ n2.dynamicChildren = null;
+ }
+ const { type, ref: ref2, shapeFlag } = n2;
+ switch (type) {
+ case Text:
+ processText(n1, n2, container, anchor);
+ break;
+ case Comment$1:
+ processCommentNode(n1, n2, container, anchor);
+ break;
+ case Static:
+ if (n1 == null) {
+ mountStaticNode(n2, container, anchor, isSVG);
+ }
+ break;
+ case Fragment:
+ processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ break;
+ default:
+ if (shapeFlag & 1) {
+ processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ } else if (shapeFlag & 6) {
+ processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ } else if (shapeFlag & 64) {
+ type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
+ } else if (shapeFlag & 128) {
+ type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
+ } else
+ ;
+ }
+ if (ref2 != null && parentComponent) {
+ setRef(ref2, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
+ }
+ };
+ const processText = (n1, n2, container, anchor) => {
+ if (n1 == null) {
+ hostInsert(n2.el = hostCreateText(n2.children), container, anchor);
+ } else {
+ const el = n2.el = n1.el;
+ if (n2.children !== n1.children) {
+ hostSetText(el, n2.children);
+ }
+ }
+ };
+ const processCommentNode = (n1, n2, container, anchor) => {
+ if (n1 == null) {
+ hostInsert(n2.el = hostCreateComment(n2.children || ""), container, anchor);
+ } else {
+ n2.el = n1.el;
+ }
+ };
+ const mountStaticNode = (n2, container, anchor, isSVG) => {
+ [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG, n2.el, n2.anchor);
+ };
+ const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
+ let next;
+ while (el && el !== anchor) {
+ next = hostNextSibling(el);
+ hostInsert(el, container, nextSibling);
+ el = next;
+ }
+ hostInsert(anchor, container, nextSibling);
+ };
+ const removeStaticNode = ({ el, anchor }) => {
+ let next;
+ while (el && el !== anchor) {
+ next = hostNextSibling(el);
+ hostRemove(el);
+ el = next;
+ }
+ hostRemove(anchor);
+ };
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
+ isSVG = isSVG || n2.type === "svg";
+ if (n1 == null) {
+ mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ } else {
+ patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ }
+ };
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
+ let el;
+ let vnodeHook;
+ const { type, props: props2, shapeFlag, transition, dirs } = vnode;
+ el = vnode.el = hostCreateElement(vnode.type, isSVG, props2 && props2.is, props2);
+ if (shapeFlag & 8) {
+ hostSetElementText(el, vnode.children);
+ } else if (shapeFlag & 16) {
+ mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== "foreignObject", slotScopeIds, optimized);
+ }
+ if (dirs) {
+ invokeDirectiveHook(vnode, null, parentComponent, "created");
+ }
+ setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
+ if (props2) {
+ for (const key in props2) {
+ if (key !== "value" && !isReservedProp(key)) {
+ hostPatchProp(el, key, null, props2[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
+ }
+ }
+ if ("value" in props2) {
+ hostPatchProp(el, "value", null, props2.value);
+ }
+ if (vnodeHook = props2.onVnodeBeforeMount) {
+ invokeVNodeHook(vnodeHook, parentComponent, vnode);
+ }
+ }
+ if (dirs) {
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
+ }
+ const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
+ if (needCallTransitionHooks) {
+ transition.beforeEnter(el);
+ }
+ hostInsert(el, container, anchor);
+ if ((vnodeHook = props2 && props2.onVnodeMounted) || needCallTransitionHooks || dirs) {
+ queuePostRenderEffect(() => {
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
+ needCallTransitionHooks && transition.enter(el);
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
+ }, parentSuspense);
+ }
+ };
+ const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
+ if (scopeId) {
+ hostSetScopeId(el, scopeId);
+ }
+ if (slotScopeIds) {
+ for (let i = 0; i < slotScopeIds.length; i++) {
+ hostSetScopeId(el, slotScopeIds[i]);
+ }
+ }
+ if (parentComponent) {
+ let subTree = parentComponent.subTree;
+ if (vnode === subTree) {
+ const parentVNode = parentComponent.vnode;
+ setScopeId(el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent);
+ }
+ }
+ };
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
+ for (let i = start; i < children.length; i++) {
+ const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
+ patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ }
+ };
+ const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
+ const el = n2.el = n1.el;
+ let { patchFlag, dynamicChildren, dirs } = n2;
+ patchFlag |= n1.patchFlag & 16;
+ const oldProps = n1.props || EMPTY_OBJ;
+ const newProps = n2.props || EMPTY_OBJ;
+ let vnodeHook;
+ parentComponent && toggleRecurse(parentComponent, false);
+ if (vnodeHook = newProps.onVnodeBeforeUpdate) {
+ invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
+ }
+ if (dirs) {
+ invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
+ }
+ parentComponent && toggleRecurse(parentComponent, true);
+ const areChildrenSVG = isSVG && n2.type !== "foreignObject";
+ if (dynamicChildren) {
+ patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds);
+ } else if (!optimized) {
+ patchChildren(n1, n2, el, null, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds, false);
+ }
+ if (patchFlag > 0) {
+ if (patchFlag & 16) {
+ patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);
+ } else {
+ if (patchFlag & 2) {
+ if (oldProps.class !== newProps.class) {
+ hostPatchProp(el, "class", null, newProps.class, isSVG);
+ }
+ }
+ if (patchFlag & 4) {
+ hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
+ }
+ if (patchFlag & 8) {
+ const propsToUpdate = n2.dynamicProps;
+ for (let i = 0; i < propsToUpdate.length; i++) {
+ const key = propsToUpdate[i];
+ const prev = oldProps[key];
+ const next = newProps[key];
+ if (next !== prev || key === "value") {
+ hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);
+ }
+ }
+ }
+ }
+ if (patchFlag & 1) {
+ if (n1.children !== n2.children) {
+ hostSetElementText(el, n2.children);
+ }
+ }
+ } else if (!optimized && dynamicChildren == null) {
+ patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);
+ }
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
+ queuePostRenderEffect(() => {
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
+ dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
+ }, parentSuspense);
+ }
+ };
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
+ for (let i = 0; i < newChildren.length; i++) {
+ const oldVNode = oldChildren[i];
+ const newVNode = newChildren[i];
+ const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : fallbackContainer;
+ patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, true);
+ }
+ };
+ const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
+ if (oldProps !== newProps) {
+ if (oldProps !== EMPTY_OBJ) {
+ for (const key in oldProps) {
+ if (!isReservedProp(key) && !(key in newProps)) {
+ hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
+ }
+ }
+ }
+ for (const key in newProps) {
+ if (isReservedProp(key))
+ continue;
+ const next = newProps[key];
+ const prev = oldProps[key];
+ if (next !== prev && key !== "value") {
+ hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
+ }
+ }
+ if ("value" in newProps) {
+ hostPatchProp(el, "value", oldProps.value, newProps.value);
+ }
+ }
+ };
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
+ const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
+ const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
+ let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
+ if (fragmentSlotScopeIds) {
+ slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
+ }
+ if (n1 == null) {
+ hostInsert(fragmentStartAnchor, container, anchor);
+ hostInsert(fragmentEndAnchor, container, anchor);
+ mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ } else {
+ if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && n1.dynamicChildren) {
+ patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG, slotScopeIds);
+ if (n2.key != null || parentComponent && n2 === parentComponent.subTree) {
+ traverseStaticChildren(n1, n2, true);
+ }
+ } else {
+ patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ }
+ }
+ };
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
+ n2.slotScopeIds = slotScopeIds;
+ if (n1 == null) {
+ if (n2.shapeFlag & 512) {
+ parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);
+ } else {
+ mountComponent(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);
+ }
+ } else {
+ updateComponent(n1, n2, optimized);
+ }
+ };
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
+ const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
+ if (isKeepAlive(initialVNode)) {
+ instance.ctx.renderer = internals;
+ }
+ {
+ setupComponent(instance);
+ }
+ if (instance.asyncDep) {
+ parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);
+ if (!initialVNode.el) {
+ const placeholder = instance.subTree = createVNode(Comment$1);
+ processCommentNode(null, placeholder, container, anchor);
+ }
+ return;
+ }
+ setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized);
+ };
+ const updateComponent = (n1, n2, optimized) => {
+ const instance = n2.component = n1.component;
+ if (shouldUpdateComponent(n1, n2, optimized)) {
+ if (instance.asyncDep && !instance.asyncResolved) {
+ updateComponentPreRender(instance, n2, optimized);
+ return;
+ } else {
+ instance.next = n2;
+ invalidateJob(instance.update);
+ instance.update();
+ }
+ } else {
+ n2.el = n1.el;
+ instance.vnode = n2;
+ }
+ };
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
+ const componentUpdateFn = () => {
+ if (!instance.isMounted) {
+ let vnodeHook;
+ const { el, props: props2 } = initialVNode;
+ const { bm, m: m2, parent } = instance;
+ const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
+ toggleRecurse(instance, false);
+ if (bm) {
+ invokeArrayFns(bm);
+ }
+ if (!isAsyncWrapperVNode && (vnodeHook = props2 && props2.onVnodeBeforeMount)) {
+ invokeVNodeHook(vnodeHook, parent, initialVNode);
+ }
+ toggleRecurse(instance, true);
+ if (el && hydrateNode) {
+ const hydrateSubTree = () => {
+ instance.subTree = renderComponentRoot(instance);
+ hydrateNode(el, instance.subTree, instance, parentSuspense, null);
+ };
+ if (isAsyncWrapperVNode) {
+ initialVNode.type.__asyncLoader().then(() => !instance.isUnmounted && hydrateSubTree());
+ } else {
+ hydrateSubTree();
+ }
+ } else {
+ const subTree = instance.subTree = renderComponentRoot(instance);
+ patch(null, subTree, container, anchor, instance, parentSuspense, isSVG);
+ initialVNode.el = subTree.el;
+ }
+ if (m2) {
+ queuePostRenderEffect(m2, parentSuspense);
+ }
+ if (!isAsyncWrapperVNode && (vnodeHook = props2 && props2.onVnodeMounted)) {
+ const scopedInitialVNode = initialVNode;
+ queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
+ }
+ if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
+ instance.a && queuePostRenderEffect(instance.a, parentSuspense);
+ }
+ instance.isMounted = true;
+ initialVNode = container = anchor = null;
+ } else {
+ let { next, bu, u: u2, parent, vnode } = instance;
+ let originNext = next;
+ let vnodeHook;
+ toggleRecurse(instance, false);
+ if (next) {
+ next.el = vnode.el;
+ updateComponentPreRender(instance, next, optimized);
+ } else {
+ next = vnode;
+ }
+ if (bu) {
+ invokeArrayFns(bu);
+ }
+ if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
+ invokeVNodeHook(vnodeHook, parent, next, vnode);
+ }
+ toggleRecurse(instance, true);
+ const nextTree = renderComponentRoot(instance);
+ const prevTree = instance.subTree;
+ instance.subTree = nextTree;
+ patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, isSVG);
+ next.el = nextTree.el;
+ if (originNext === null) {
+ updateHOCHostEl(instance, nextTree.el);
+ }
+ if (u2) {
+ queuePostRenderEffect(u2, parentSuspense);
+ }
+ if (vnodeHook = next.props && next.props.onVnodeUpdated) {
+ queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
+ }
+ }
+ };
+ const effect = instance.effect = new ReactiveEffect(componentUpdateFn, () => queueJob(update), instance.scope);
+ const update = instance.update = () => effect.run();
+ update.id = instance.uid;
+ toggleRecurse(instance, true);
+ update();
+ };
+ const updateComponentPreRender = (instance, nextVNode, optimized) => {
+ nextVNode.component = instance;
+ const prevProps = instance.vnode.props;
+ instance.vnode = nextVNode;
+ instance.next = null;
+ updateProps(instance, nextVNode.props, prevProps, optimized);
+ updateSlots(instance, nextVNode.children, optimized);
+ pauseTracking();
+ flushPreFlushCbs();
+ resetTracking();
+ };
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
+ const c1 = n1 && n1.children;
+ const prevShapeFlag = n1 ? n1.shapeFlag : 0;
+ const c2 = n2.children;
+ const { patchFlag, shapeFlag } = n2;
+ if (patchFlag > 0) {
+ if (patchFlag & 128) {
+ patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ return;
+ } else if (patchFlag & 256) {
+ patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ return;
+ }
+ }
+ if (shapeFlag & 8) {
+ if (prevShapeFlag & 16) {
+ unmountChildren(c1, parentComponent, parentSuspense);
+ }
+ if (c2 !== c1) {
+ hostSetElementText(container, c2);
+ }
+ } else {
+ if (prevShapeFlag & 16) {
+ if (shapeFlag & 16) {
+ patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ } else {
+ unmountChildren(c1, parentComponent, parentSuspense, true);
+ }
+ } else {
+ if (prevShapeFlag & 8) {
+ hostSetElementText(container, "");
+ }
+ if (shapeFlag & 16) {
+ mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ }
+ }
+ }
+ };
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
+ c1 = c1 || EMPTY_ARR;
+ c2 = c2 || EMPTY_ARR;
+ const oldLength = c1.length;
+ const newLength = c2.length;
+ const commonLength = Math.min(oldLength, newLength);
+ let i;
+ for (i = 0; i < commonLength; i++) {
+ const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
+ patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ }
+ if (oldLength > newLength) {
+ unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength);
+ } else {
+ mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, commonLength);
+ }
+ };
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
+ let i = 0;
+ const l2 = c2.length;
+ let e1 = c1.length - 1;
+ let e2 = l2 - 1;
+ while (i <= e1 && i <= e2) {
+ const n1 = c1[i];
+ const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
+ if (isSameVNodeType(n1, n2)) {
+ patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ } else {
+ break;
+ }
+ i++;
+ }
+ while (i <= e1 && i <= e2) {
+ const n1 = c1[e1];
+ const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
+ if (isSameVNodeType(n1, n2)) {
+ patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ } else {
+ break;
+ }
+ e1--;
+ e2--;
+ }
+ if (i > e1) {
+ if (i <= e2) {
+ const nextPos = e2 + 1;
+ const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
+ while (i <= e2) {
+ patch(null, c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ i++;
+ }
+ }
+ } else if (i > e2) {
+ while (i <= e1) {
+ unmount(c1[i], parentComponent, parentSuspense, true);
+ i++;
+ }
+ } else {
+ const s1 = i;
+ const s2 = i;
+ const keyToNewIndexMap = /* @__PURE__ */ new Map();
+ for (i = s2; i <= e2; i++) {
+ const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
+ if (nextChild.key != null) {
+ keyToNewIndexMap.set(nextChild.key, i);
+ }
+ }
+ let j2;
+ let patched = 0;
+ const toBePatched = e2 - s2 + 1;
+ let moved = false;
+ let maxNewIndexSoFar = 0;
+ const newIndexToOldIndexMap = new Array(toBePatched);
+ for (i = 0; i < toBePatched; i++)
+ newIndexToOldIndexMap[i] = 0;
+ for (i = s1; i <= e1; i++) {
+ const prevChild = c1[i];
+ if (patched >= toBePatched) {
+ unmount(prevChild, parentComponent, parentSuspense, true);
+ continue;
+ }
+ let newIndex;
+ if (prevChild.key != null) {
+ newIndex = keyToNewIndexMap.get(prevChild.key);
+ } else {
+ for (j2 = s2; j2 <= e2; j2++) {
+ if (newIndexToOldIndexMap[j2 - s2] === 0 && isSameVNodeType(prevChild, c2[j2])) {
+ newIndex = j2;
+ break;
+ }
+ }
+ }
+ if (newIndex === void 0) {
+ unmount(prevChild, parentComponent, parentSuspense, true);
+ } else {
+ newIndexToOldIndexMap[newIndex - s2] = i + 1;
+ if (newIndex >= maxNewIndexSoFar) {
+ maxNewIndexSoFar = newIndex;
+ } else {
+ moved = true;
+ }
+ patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ patched++;
+ }
+ }
+ const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
+ j2 = increasingNewIndexSequence.length - 1;
+ for (i = toBePatched - 1; i >= 0; i--) {
+ const nextIndex = s2 + i;
+ const nextChild = c2[nextIndex];
+ const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
+ if (newIndexToOldIndexMap[i] === 0) {
+ patch(null, nextChild, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ } else if (moved) {
+ if (j2 < 0 || i !== increasingNewIndexSequence[j2]) {
+ move(nextChild, container, anchor, 2);
+ } else {
+ j2--;
+ }
+ }
+ }
+ }
+ };
+ const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
+ const { el, type, transition, children, shapeFlag } = vnode;
+ if (shapeFlag & 6) {
+ move(vnode.component.subTree, container, anchor, moveType);
+ return;
+ }
+ if (shapeFlag & 128) {
+ vnode.suspense.move(container, anchor, moveType);
+ return;
+ }
+ if (shapeFlag & 64) {
+ type.move(vnode, container, anchor, internals);
+ return;
+ }
+ if (type === Fragment) {
+ hostInsert(el, container, anchor);
+ for (let i = 0; i < children.length; i++) {
+ move(children[i], container, anchor, moveType);
+ }
+ hostInsert(vnode.anchor, container, anchor);
+ return;
+ }
+ if (type === Static) {
+ moveStaticNode(vnode, container, anchor);
+ return;
+ }
+ const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
+ if (needTransition) {
+ if (moveType === 0) {
+ transition.beforeEnter(el);
+ hostInsert(el, container, anchor);
+ queuePostRenderEffect(() => transition.enter(el), parentSuspense);
+ } else {
+ const { leave, delayLeave, afterLeave } = transition;
+ const remove22 = () => hostInsert(el, container, anchor);
+ const performLeave = () => {
+ leave(el, () => {
+ remove22();
+ afterLeave && afterLeave();
+ });
+ };
+ if (delayLeave) {
+ delayLeave(el, remove22, performLeave);
+ } else {
+ performLeave();
+ }
+ }
+ } else {
+ hostInsert(el, container, anchor);
+ }
+ };
+ const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
+ const {
+ type,
+ props: props2,
+ ref: ref2,
+ children,
+ dynamicChildren,
+ shapeFlag,
+ patchFlag,
+ dirs
+ } = vnode;
+ if (ref2 != null) {
+ setRef(ref2, null, parentSuspense, vnode, true);
+ }
+ if (shapeFlag & 256) {
+ parentComponent.ctx.deactivate(vnode);
+ return;
+ }
+ const shouldInvokeDirs = shapeFlag & 1 && dirs;
+ const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
+ let vnodeHook;
+ if (shouldInvokeVnodeHook && (vnodeHook = props2 && props2.onVnodeBeforeUnmount)) {
+ invokeVNodeHook(vnodeHook, parentComponent, vnode);
+ }
+ if (shapeFlag & 6) {
+ unmountComponent(vnode.component, parentSuspense, doRemove);
+ } else {
+ if (shapeFlag & 128) {
+ vnode.suspense.unmount(parentSuspense, doRemove);
+ return;
+ }
+ if (shouldInvokeDirs) {
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
+ }
+ if (shapeFlag & 64) {
+ vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);
+ } else if (dynamicChildren && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
+ unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
+ } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
+ unmountChildren(children, parentComponent, parentSuspense);
+ }
+ if (doRemove) {
+ remove2(vnode);
+ }
+ }
+ if (shouldInvokeVnodeHook && (vnodeHook = props2 && props2.onVnodeUnmounted) || shouldInvokeDirs) {
+ queuePostRenderEffect(() => {
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
+ shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
+ }, parentSuspense);
+ }
+ };
+ const remove2 = (vnode) => {
+ const { type, el, anchor, transition } = vnode;
+ if (type === Fragment) {
+ {
+ removeFragment(el, anchor);
+ }
+ return;
+ }
+ if (type === Static) {
+ removeStaticNode(vnode);
+ return;
+ }
+ const performRemove = () => {
+ hostRemove(el);
+ if (transition && !transition.persisted && transition.afterLeave) {
+ transition.afterLeave();
+ }
+ };
+ if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
+ const { leave, delayLeave } = transition;
+ const performLeave = () => leave(el, performRemove);
+ if (delayLeave) {
+ delayLeave(vnode.el, performRemove, performLeave);
+ } else {
+ performLeave();
+ }
+ } else {
+ performRemove();
+ }
+ };
+ const removeFragment = (cur, end) => {
+ let next;
+ while (cur !== end) {
+ next = hostNextSibling(cur);
+ hostRemove(cur);
+ cur = next;
+ }
+ hostRemove(end);
+ };
+ const unmountComponent = (instance, parentSuspense, doRemove) => {
+ const { bum, scope, update, subTree, um } = instance;
+ if (bum) {
+ invokeArrayFns(bum);
+ }
+ scope.stop();
+ if (update) {
+ update.active = false;
+ unmount(subTree, instance, parentSuspense, doRemove);
+ }
+ if (um) {
+ queuePostRenderEffect(um, parentSuspense);
+ }
+ queuePostRenderEffect(() => {
+ instance.isUnmounted = true;
+ }, parentSuspense);
+ if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
+ parentSuspense.deps--;
+ if (parentSuspense.deps === 0) {
+ parentSuspense.resolve();
+ }
+ }
+ };
+ const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
+ for (let i = start; i < children.length; i++) {
+ unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
+ }
+ };
+ const getNextHostNode = (vnode) => {
+ if (vnode.shapeFlag & 6) {
+ return getNextHostNode(vnode.component.subTree);
+ }
+ if (vnode.shapeFlag & 128) {
+ return vnode.suspense.next();
+ }
+ return hostNextSibling(vnode.anchor || vnode.el);
+ };
+ const render2 = (vnode, container, isSVG) => {
+ if (vnode == null) {
+ if (container._vnode) {
+ unmount(container._vnode, null, null, true);
+ }
+ } else {
+ patch(container._vnode || null, vnode, container, null, null, null, isSVG);
+ }
+ flushPreFlushCbs();
+ flushPostFlushCbs();
+ container._vnode = vnode;
+ };
+ const internals = {
+ p: patch,
+ um: unmount,
+ m: move,
+ r: remove2,
+ mt: mountComponent,
+ mc: mountChildren,
+ pc: patchChildren,
+ pbc: patchBlockChildren,
+ n: getNextHostNode,
+ o: options
+ };
+ let hydrate;
+ let hydrateNode;
+ if (createHydrationFns) {
+ [hydrate, hydrateNode] = createHydrationFns(internals);
+ }
+ return {
+ render: render2,
+ hydrate,
+ createApp: createAppAPI(render2, hydrate)
+ };
+}
+function toggleRecurse({ effect, update }, allowed) {
+ effect.allowRecurse = update.allowRecurse = allowed;
+}
+function traverseStaticChildren(n1, n2, shallow = false) {
+ const ch1 = n1.children;
+ const ch22 = n2.children;
+ if (isArray$4(ch1) && isArray$4(ch22)) {
+ for (let i = 0; i < ch1.length; i++) {
+ const c1 = ch1[i];
+ let c2 = ch22[i];
+ if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
+ if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
+ c2 = ch22[i] = cloneIfMounted(ch22[i]);
+ c2.el = c1.el;
+ }
+ if (!shallow)
+ traverseStaticChildren(c1, c2);
+ }
+ if (c2.type === Text) {
+ c2.el = c1.el;
+ }
+ }
+ }
+}
+function getSequence(arr) {
+ const p2 = arr.slice();
+ const result = [0];
+ let i, j2, u2, v2, c2;
+ const len = arr.length;
+ for (i = 0; i < len; i++) {
+ const arrI = arr[i];
+ if (arrI !== 0) {
+ j2 = result[result.length - 1];
+ if (arr[j2] < arrI) {
+ p2[i] = j2;
+ result.push(i);
+ continue;
+ }
+ u2 = 0;
+ v2 = result.length - 1;
+ while (u2 < v2) {
+ c2 = u2 + v2 >> 1;
+ if (arr[result[c2]] < arrI) {
+ u2 = c2 + 1;
+ } else {
+ v2 = c2;
+ }
+ }
+ if (arrI < arr[result[u2]]) {
+ if (u2 > 0) {
+ p2[i] = result[u2 - 1];
+ }
+ result[u2] = i;
+ }
+ }
+ }
+ u2 = result.length;
+ v2 = result[u2 - 1];
+ while (u2-- > 0) {
+ result[u2] = v2;
+ v2 = p2[v2];
+ }
+ return result;
+}
+const isTeleport = (type) => type.__isTeleport;
+const isTeleportDisabled = (props2) => props2 && (props2.disabled || props2.disabled === "");
+const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
+const resolveTarget = (props2, select) => {
+ const targetSelector = props2 && props2.to;
+ if (isString$2(targetSelector)) {
+ if (!select) {
+ return null;
+ } else {
+ const target = select(targetSelector);
+ return target;
+ }
+ } else {
+ return targetSelector;
+ }
+};
+const TeleportImpl = {
+ __isTeleport: true,
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
+ const {
+ mc: mountChildren,
+ pc: patchChildren,
+ pbc: patchBlockChildren,
+ o: { insert, querySelector, createText, createComment }
+ } = internals;
+ const disabled = isTeleportDisabled(n2.props);
+ let { shapeFlag, children, dynamicChildren } = n2;
+ if (n1 == null) {
+ const placeholder = n2.el = createText("");
+ const mainAnchor = n2.anchor = createText("");
+ insert(placeholder, container, anchor);
+ insert(mainAnchor, container, anchor);
+ const target = n2.target = resolveTarget(n2.props, querySelector);
+ const targetAnchor = n2.targetAnchor = createText("");
+ if (target) {
+ insert(targetAnchor, target);
+ isSVG = isSVG || isTargetSVG(target);
+ }
+ const mount = (container2, anchor2) => {
+ if (shapeFlag & 16) {
+ mountChildren(children, container2, anchor2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
+ }
+ };
+ if (disabled) {
+ mount(container, mainAnchor);
+ } else if (target) {
+ mount(target, targetAnchor);
+ }
+ } else {
+ n2.el = n1.el;
+ const mainAnchor = n2.anchor = n1.anchor;
+ const target = n2.target = n1.target;
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
+ const wasDisabled = isTeleportDisabled(n1.props);
+ const currentContainer = wasDisabled ? container : target;
+ const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
+ isSVG = isSVG || isTargetSVG(target);
+ if (dynamicChildren) {
+ patchBlockChildren(n1.dynamicChildren, dynamicChildren, currentContainer, parentComponent, parentSuspense, isSVG, slotScopeIds);
+ traverseStaticChildren(n1, n2, true);
+ } else if (!optimized) {
+ patchChildren(n1, n2, currentContainer, currentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, false);
+ }
+ if (disabled) {
+ if (!wasDisabled) {
+ moveTeleport(n2, container, mainAnchor, internals, 1);
+ }
+ } else {
+ if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
+ const nextTarget = n2.target = resolveTarget(n2.props, querySelector);
+ if (nextTarget) {
+ moveTeleport(n2, nextTarget, null, internals, 0);
+ }
+ } else if (wasDisabled) {
+ moveTeleport(n2, target, targetAnchor, internals, 1);
+ }
+ }
+ }
+ updateCssVars(n2);
+ },
+ remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
+ const { shapeFlag, children, anchor, targetAnchor, target, props: props2 } = vnode;
+ if (target) {
+ hostRemove(targetAnchor);
+ }
+ if (doRemove || !isTeleportDisabled(props2)) {
+ hostRemove(anchor);
+ if (shapeFlag & 16) {
+ for (let i = 0; i < children.length; i++) {
+ const child = children[i];
+ unmount(child, parentComponent, parentSuspense, true, !!child.dynamicChildren);
+ }
+ }
+ }
+ },
+ move: moveTeleport,
+ hydrate: hydrateTeleport
+};
+function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
+ if (moveType === 0) {
+ insert(vnode.targetAnchor, container, parentAnchor);
+ }
+ const { el, anchor, shapeFlag, children, props: props2 } = vnode;
+ const isReorder = moveType === 2;
+ if (isReorder) {
+ insert(el, container, parentAnchor);
+ }
+ if (!isReorder || isTeleportDisabled(props2)) {
+ if (shapeFlag & 16) {
+ for (let i = 0; i < children.length; i++) {
+ move(children[i], container, parentAnchor, 2);
+ }
+ }
+ }
+ if (isReorder) {
+ insert(anchor, container, parentAnchor);
+ }
+}
+function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
+ o: { nextSibling, parentNode, querySelector }
+}, hydrateChildren) {
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
+ if (target) {
+ const targetNode = target._lpa || target.firstChild;
+ if (vnode.shapeFlag & 16) {
+ if (isTeleportDisabled(vnode.props)) {
+ vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);
+ vnode.targetAnchor = targetNode;
+ } else {
+ vnode.anchor = nextSibling(node);
+ let targetAnchor = targetNode;
+ while (targetAnchor) {
+ targetAnchor = nextSibling(targetAnchor);
+ if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
+ vnode.targetAnchor = targetAnchor;
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
+ break;
+ }
+ }
+ hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
+ }
+ }
+ updateCssVars(vnode);
+ }
+ return vnode.anchor && nextSibling(vnode.anchor);
+}
+const Teleport = TeleportImpl;
+function updateCssVars(vnode) {
+ const ctx = vnode.ctx;
+ if (ctx && ctx.ut) {
+ let node = vnode.children[0].el;
+ while (node !== vnode.targetAnchor) {
+ if (node.nodeType === 1)
+ node.setAttribute("data-v-owner", ctx.uid);
+ node = node.nextSibling;
+ }
+ ctx.ut();
+ }
+}
+const Fragment = Symbol.for("v-fgt");
+const Text = Symbol.for("v-txt");
+const Comment$1 = Symbol.for("v-cmt");
+const Static = Symbol.for("v-stc");
+const blockStack = [];
+let currentBlock = null;
+function openBlock(disableTracking = false) {
+ blockStack.push(currentBlock = disableTracking ? null : []);
+}
+function closeBlock() {
+ blockStack.pop();
+ currentBlock = blockStack[blockStack.length - 1] || null;
+}
+let isBlockTreeEnabled = 1;
+function setBlockTracking(value) {
+ isBlockTreeEnabled += value;
+}
+function setupBlock(vnode) {
+ vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
+ closeBlock();
+ if (isBlockTreeEnabled > 0 && currentBlock) {
+ currentBlock.push(vnode);
+ }
+ return vnode;
+}
+function createElementBlock(type, props2, children, patchFlag, dynamicProps, shapeFlag) {
+ return setupBlock(createBaseVNode(type, props2, children, patchFlag, dynamicProps, shapeFlag, true));
+}
+function createBlock(type, props2, children, patchFlag, dynamicProps) {
+ return setupBlock(createVNode(type, props2, children, patchFlag, dynamicProps, true));
+}
+function isVNode(value) {
+ return value ? value.__v_isVNode === true : false;
+}
+function isSameVNodeType(n1, n2) {
+ return n1.type === n2.type && n1.key === n2.key;
+}
+const InternalObjectKey = `__vInternal`;
+const normalizeKey = ({ key }) => key != null ? key : null;
+const normalizeRef = ({
+ ref: ref2,
+ ref_key,
+ ref_for
+}) => {
+ if (typeof ref2 === "number") {
+ ref2 = "" + ref2;
+ }
+ return ref2 != null ? isString$2(ref2) || isRef(ref2) || isFunction$1(ref2) ? { i: currentRenderingInstance, r: ref2, k: ref_key, f: !!ref_for } : ref2 : null;
+};
+function createBaseVNode(type, props2 = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
+ const vnode = {
+ __v_isVNode: true,
+ __v_skip: true,
+ type,
+ props: props2,
+ key: props2 && normalizeKey(props2),
+ ref: props2 && normalizeRef(props2),
+ scopeId: currentScopeId,
+ slotScopeIds: null,
+ children,
+ component: null,
+ suspense: null,
+ ssContent: null,
+ ssFallback: null,
+ dirs: null,
+ transition: null,
+ el: null,
+ anchor: null,
+ target: null,
+ targetAnchor: null,
+ staticCount: 0,
+ shapeFlag,
+ patchFlag,
+ dynamicProps,
+ dynamicChildren: null,
+ appContext: null,
+ ctx: currentRenderingInstance
+ };
+ if (needFullChildrenNormalization) {
+ normalizeChildren(vnode, children);
+ if (shapeFlag & 128) {
+ type.normalize(vnode);
+ }
+ } else if (children) {
+ vnode.shapeFlag |= isString$2(children) ? 8 : 16;
+ }
+ if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) {
+ currentBlock.push(vnode);
+ }
+ return vnode;
+}
+const createVNode = _createVNode;
+function _createVNode(type, props2 = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
+ if (!type || type === NULL_DYNAMIC_COMPONENT) {
+ type = Comment$1;
+ }
+ if (isVNode(type)) {
+ const cloned = cloneVNode(type, props2, true);
+ if (children) {
+ normalizeChildren(cloned, children);
+ }
+ if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
+ if (cloned.shapeFlag & 6) {
+ currentBlock[currentBlock.indexOf(type)] = cloned;
+ } else {
+ currentBlock.push(cloned);
+ }
+ }
+ cloned.patchFlag |= -2;
+ return cloned;
+ }
+ if (isClassComponent(type)) {
+ type = type.__vccOpts;
+ }
+ if (props2) {
+ props2 = guardReactiveProps(props2);
+ let { class: klass, style } = props2;
+ if (klass && !isString$2(klass)) {
+ props2.class = normalizeClass(klass);
+ }
+ if (isObject$2(style)) {
+ if (isProxy(style) && !isArray$4(style)) {
+ style = extend({}, style);
+ }
+ props2.style = normalizeStyle(style);
+ }
+ }
+ const shapeFlag = isString$2(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$2(type) ? 4 : isFunction$1(type) ? 2 : 0;
+ return createBaseVNode(type, props2, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true);
+}
+function guardReactiveProps(props2) {
+ if (!props2)
+ return null;
+ return isProxy(props2) || InternalObjectKey in props2 ? extend({}, props2) : props2;
+}
+function cloneVNode(vnode, extraProps, mergeRef = false) {
+ const { props: props2, ref: ref2, patchFlag, children } = vnode;
+ const mergedProps = extraProps ? mergeProps(props2 || {}, extraProps) : props2;
+ const cloned = {
+ __v_isVNode: true,
+ __v_skip: true,
+ type: vnode.type,
+ props: mergedProps,
+ key: mergedProps && normalizeKey(mergedProps),
+ ref: extraProps && extraProps.ref ? mergeRef && ref2 ? isArray$4(ref2) ? ref2.concat(normalizeRef(extraProps)) : [ref2, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref2,
+ scopeId: vnode.scopeId,
+ slotScopeIds: vnode.slotScopeIds,
+ children,
+ target: vnode.target,
+ targetAnchor: vnode.targetAnchor,
+ staticCount: vnode.staticCount,
+ shapeFlag: vnode.shapeFlag,
+ patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
+ dynamicProps: vnode.dynamicProps,
+ dynamicChildren: vnode.dynamicChildren,
+ appContext: vnode.appContext,
+ dirs: vnode.dirs,
+ transition: vnode.transition,
+ component: vnode.component,
+ suspense: vnode.suspense,
+ ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
+ ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
+ el: vnode.el,
+ anchor: vnode.anchor,
+ ctx: vnode.ctx,
+ ce: vnode.ce
+ };
+ return cloned;
+}
+function createTextVNode(text = " ", flag = 0) {
+ return createVNode(Text, null, text, flag);
+}
+function createStaticVNode(content, numberOfNodes) {
+ const vnode = createVNode(Static, null, content);
+ vnode.staticCount = numberOfNodes;
+ return vnode;
+}
+function createCommentVNode(text = "", asBlock = false) {
+ return asBlock ? (openBlock(), createBlock(Comment$1, null, text)) : createVNode(Comment$1, null, text);
+}
+function normalizeVNode(child) {
+ if (child == null || typeof child === "boolean") {
+ return createVNode(Comment$1);
+ } else if (isArray$4(child)) {
+ return createVNode(Fragment, null, child.slice());
+ } else if (typeof child === "object") {
+ return cloneIfMounted(child);
+ } else {
+ return createVNode(Text, null, String(child));
+ }
+}
+function cloneIfMounted(child) {
+ return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
+}
+function normalizeChildren(vnode, children) {
+ let type = 0;
+ const { shapeFlag } = vnode;
+ if (children == null) {
+ children = null;
+ } else if (isArray$4(children)) {
+ type = 16;
+ } else if (typeof children === "object") {
+ if (shapeFlag & (1 | 64)) {
+ const slot = children.default;
+ if (slot) {
+ slot._c && (slot._d = false);
+ normalizeChildren(vnode, slot());
+ slot._c && (slot._d = true);
+ }
+ return;
+ } else {
+ type = 32;
+ const slotFlag = children._;
+ if (!slotFlag && !(InternalObjectKey in children)) {
+ children._ctx = currentRenderingInstance;
+ } else if (slotFlag === 3 && currentRenderingInstance) {
+ if (currentRenderingInstance.slots._ === 1) {
+ children._ = 1;
+ } else {
+ children._ = 2;
+ vnode.patchFlag |= 1024;
+ }
+ }
+ }
+ } else if (isFunction$1(children)) {
+ children = { default: children, _ctx: currentRenderingInstance };
+ type = 32;
+ } else {
+ children = String(children);
+ if (shapeFlag & 64) {
+ type = 16;
+ children = [createTextVNode(children)];
+ } else {
+ type = 8;
+ }
+ }
+ vnode.children = children;
+ vnode.shapeFlag |= type;
+}
+function mergeProps(...args) {
+ const ret = {};
+ for (let i = 0; i < args.length; i++) {
+ const toMerge = args[i];
+ for (const key in toMerge) {
+ if (key === "class") {
+ if (ret.class !== toMerge.class) {
+ ret.class = normalizeClass([ret.class, toMerge.class]);
+ }
+ } else if (key === "style") {
+ ret.style = normalizeStyle([ret.style, toMerge.style]);
+ } else if (isOn(key)) {
+ const existing = ret[key];
+ const incoming = toMerge[key];
+ if (incoming && existing !== incoming && !(isArray$4(existing) && existing.includes(incoming))) {
+ ret[key] = existing ? [].concat(existing, incoming) : incoming;
+ }
+ } else if (key !== "") {
+ ret[key] = toMerge[key];
+ }
+ }
+ }
+ return ret;
+}
+function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
+ callWithAsyncErrorHandling(hook, instance, 7, [
+ vnode,
+ prevVNode
+ ]);
+}
+const emptyAppContext = createAppContext();
+let uid = 0;
+function createComponentInstance(vnode, parent, suspense) {
+ const type = vnode.type;
+ const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
+ const instance = {
+ uid: uid++,
+ vnode,
+ type,
+ parent,
+ appContext,
+ root: null,
+ next: null,
+ subTree: null,
+ effect: null,
+ update: null,
+ scope: new EffectScope(true),
+ render: null,
+ proxy: null,
+ exposed: null,
+ exposeProxy: null,
+ withProxy: null,
+ provides: parent ? parent.provides : Object.create(appContext.provides),
+ accessCache: null,
+ renderCache: [],
+ components: null,
+ directives: null,
+ propsOptions: normalizePropsOptions(type, appContext),
+ emitsOptions: normalizeEmitsOptions(type, appContext),
+ emit: null,
+ emitted: null,
+ propsDefaults: EMPTY_OBJ,
+ inheritAttrs: type.inheritAttrs,
+ ctx: EMPTY_OBJ,
+ data: EMPTY_OBJ,
+ props: EMPTY_OBJ,
+ attrs: EMPTY_OBJ,
+ slots: EMPTY_OBJ,
+ refs: EMPTY_OBJ,
+ setupState: EMPTY_OBJ,
+ setupContext: null,
+ attrsProxy: null,
+ slotsProxy: null,
+ suspense,
+ suspenseId: suspense ? suspense.pendingId : 0,
+ asyncDep: null,
+ asyncResolved: false,
+ isMounted: false,
+ isUnmounted: false,
+ isDeactivated: false,
+ bc: null,
+ c: null,
+ bm: null,
+ m: null,
+ bu: null,
+ u: null,
+ um: null,
+ bum: null,
+ da: null,
+ a: null,
+ rtg: null,
+ rtc: null,
+ ec: null,
+ sp: null
+ };
+ {
+ instance.ctx = { _: instance };
+ }
+ instance.root = parent ? parent.root : instance;
+ instance.emit = emit.bind(null, instance);
+ if (vnode.ce) {
+ vnode.ce(instance);
+ }
+ return instance;
+}
+let currentInstance = null;
+const getCurrentInstance = () => currentInstance || currentRenderingInstance;
+let internalSetCurrentInstance;
+let globalCurrentInstanceSetters;
+let settersKey = "__VUE_INSTANCE_SETTERS__";
+{
+ if (!(globalCurrentInstanceSetters = getGlobalThis()[settersKey])) {
+ globalCurrentInstanceSetters = getGlobalThis()[settersKey] = [];
+ }
+ globalCurrentInstanceSetters.push((i) => currentInstance = i);
+ internalSetCurrentInstance = (instance) => {
+ if (globalCurrentInstanceSetters.length > 1) {
+ globalCurrentInstanceSetters.forEach((s2) => s2(instance));
+ } else {
+ globalCurrentInstanceSetters[0](instance);
+ }
+ };
+}
+const setCurrentInstance = (instance) => {
+ internalSetCurrentInstance(instance);
+ instance.scope.on();
+};
+const unsetCurrentInstance = () => {
+ currentInstance && currentInstance.scope.off();
+ internalSetCurrentInstance(null);
+};
+function isStatefulComponent(instance) {
+ return instance.vnode.shapeFlag & 4;
+}
+let isInSSRComponentSetup = false;
+function setupComponent(instance, isSSR = false) {
+ isInSSRComponentSetup = isSSR;
+ const { props: props2, children } = instance.vnode;
+ const isStateful = isStatefulComponent(instance);
+ initProps(instance, props2, isStateful, isSSR);
+ initSlots(instance, children);
+ const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
+ isInSSRComponentSetup = false;
+ return setupResult;
+}
+function setupStatefulComponent(instance, isSSR) {
+ const Component = instance.type;
+ instance.accessCache = /* @__PURE__ */ Object.create(null);
+ instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
+ const { setup } = Component;
+ if (setup) {
+ const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
+ setCurrentInstance(instance);
+ pauseTracking();
+ const setupResult = callWithErrorHandling(setup, instance, 0, [instance.props, setupContext]);
+ resetTracking();
+ unsetCurrentInstance();
+ if (isPromise(setupResult)) {
+ setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
+ if (isSSR) {
+ return setupResult.then((resolvedResult) => {
+ handleSetupResult(instance, resolvedResult, isSSR);
+ }).catch((e2) => {
+ handleError(e2, instance, 0);
+ });
+ } else {
+ instance.asyncDep = setupResult;
+ }
+ } else {
+ handleSetupResult(instance, setupResult, isSSR);
+ }
+ } else {
+ finishComponentSetup(instance, isSSR);
+ }
+}
+function handleSetupResult(instance, setupResult, isSSR) {
+ if (isFunction$1(setupResult)) {
+ if (instance.type.__ssrInlineRender) {
+ instance.ssrRender = setupResult;
+ } else {
+ instance.render = setupResult;
+ }
+ } else if (isObject$2(setupResult)) {
+ instance.setupState = proxyRefs(setupResult);
+ } else
+ ;
+ finishComponentSetup(instance, isSSR);
+}
+let compile;
+function finishComponentSetup(instance, isSSR, skipOptions) {
+ const Component = instance.type;
+ if (!instance.render) {
+ if (!isSSR && compile && !Component.render) {
+ const template = Component.template || resolveMergedOptions(instance).template;
+ if (template) {
+ const { isCustomElement, compilerOptions } = instance.appContext.config;
+ const { delimiters, compilerOptions: componentCompilerOptions } = Component;
+ const finalCompilerOptions = extend(extend({
+ isCustomElement,
+ delimiters
+ }, compilerOptions), componentCompilerOptions);
+ Component.render = compile(template, finalCompilerOptions);
+ }
+ }
+ instance.render = Component.render || NOOP;
+ }
+ {
+ setCurrentInstance(instance);
+ pauseTracking();
+ applyOptions(instance);
+ resetTracking();
+ unsetCurrentInstance();
+ }
+}
+function getAttrsProxy(instance) {
+ return instance.attrsProxy || (instance.attrsProxy = new Proxy(instance.attrs, {
+ get(target, key) {
+ track(instance, "get", "$attrs");
+ return target[key];
+ }
+ }));
+}
+function createSetupContext(instance) {
+ const expose = (exposed) => {
+ instance.exposed = exposed || {};
+ };
+ {
+ return {
+ get attrs() {
+ return getAttrsProxy(instance);
+ },
+ slots: instance.slots,
+ emit: instance.emit,
+ expose
+ };
+ }
+}
+function getExposeProxy(instance) {
+ if (instance.exposed) {
+ return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
+ get(target, key) {
+ if (key in target) {
+ return target[key];
+ } else if (key in publicPropertiesMap) {
+ return publicPropertiesMap[key](instance);
+ }
+ },
+ has(target, key) {
+ return key in target || key in publicPropertiesMap;
+ }
+ }));
+ }
+}
+function getComponentName(Component, includeInferred = true) {
+ return isFunction$1(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
+}
+function isClassComponent(value) {
+ return isFunction$1(value) && "__vccOpts" in value;
+}
+const computed = (getterOrOptions, debugOptions) => {
+ return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
+};
+function h$1(type, propsOrChildren, children) {
+ const l2 = arguments.length;
+ if (l2 === 2) {
+ if (isObject$2(propsOrChildren) && !isArray$4(propsOrChildren)) {
+ if (isVNode(propsOrChildren)) {
+ return createVNode(type, null, [propsOrChildren]);
+ }
+ return createVNode(type, propsOrChildren);
+ } else {
+ return createVNode(type, null, propsOrChildren);
+ }
+ } else {
+ if (l2 > 3) {
+ children = Array.prototype.slice.call(arguments, 2);
+ } else if (l2 === 3 && isVNode(children)) {
+ children = [children];
+ }
+ return createVNode(type, propsOrChildren, children);
+ }
+}
+const ssrContextKey = Symbol.for("v-scx");
+const useSSRContext = () => {
+ {
+ const ctx = inject$1(ssrContextKey);
+ return ctx;
+ }
+};
+const version = "3.3.4";
+const svgNS = "http://www.w3.org/2000/svg";
+const doc = typeof document !== "undefined" ? document : null;
+const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
+const nodeOps = {
+ insert: (child, parent, anchor) => {
+ parent.insertBefore(child, anchor || null);
+ },
+ remove: (child) => {
+ const parent = child.parentNode;
+ if (parent) {
+ parent.removeChild(child);
+ }
+ },
+ createElement: (tag, isSVG, is, props2) => {
+ const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
+ if (tag === "select" && props2 && props2.multiple != null) {
+ el.setAttribute("multiple", props2.multiple);
+ }
+ return el;
+ },
+ createText: (text) => doc.createTextNode(text),
+ createComment: (text) => doc.createComment(text),
+ setText: (node, text) => {
+ node.nodeValue = text;
+ },
+ setElementText: (el, text) => {
+ el.textContent = text;
+ },
+ parentNode: (node) => node.parentNode,
+ nextSibling: (node) => node.nextSibling,
+ querySelector: (selector) => doc.querySelector(selector),
+ setScopeId(el, id) {
+ el.setAttribute(id, "");
+ },
+ insertStaticContent(content, parent, anchor, isSVG, start, end) {
+ const before = anchor ? anchor.previousSibling : parent.lastChild;
+ if (start && (start === end || start.nextSibling)) {
+ while (true) {
+ parent.insertBefore(start.cloneNode(true), anchor);
+ if (start === end || !(start = start.nextSibling))
+ break;
+ }
+ } else {
+ templateContainer.innerHTML = isSVG ? `` : content;
+ const template = templateContainer.content;
+ if (isSVG) {
+ const wrapper = template.firstChild;
+ while (wrapper.firstChild) {
+ template.appendChild(wrapper.firstChild);
+ }
+ template.removeChild(wrapper);
+ }
+ parent.insertBefore(template, anchor);
+ }
+ return [
+ before ? before.nextSibling : parent.firstChild,
+ anchor ? anchor.previousSibling : parent.lastChild
+ ];
+ }
+};
+function patchClass(el, value, isSVG) {
+ const transitionClasses = el._vtc;
+ if (transitionClasses) {
+ value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
+ }
+ if (value == null) {
+ el.removeAttribute("class");
+ } else if (isSVG) {
+ el.setAttribute("class", value);
+ } else {
+ el.className = value;
+ }
+}
+function patchStyle(el, prev, next) {
+ const style = el.style;
+ const isCssString = isString$2(next);
+ if (next && !isCssString) {
+ if (prev && !isString$2(prev)) {
+ for (const key in prev) {
+ if (next[key] == null) {
+ setStyle(style, key, "");
+ }
+ }
+ }
+ for (const key in next) {
+ setStyle(style, key, next[key]);
+ }
+ } else {
+ const currentDisplay = style.display;
+ if (isCssString) {
+ if (prev !== next) {
+ style.cssText = next;
+ }
+ } else if (prev) {
+ el.removeAttribute("style");
+ }
+ if ("_vod" in el) {
+ style.display = currentDisplay;
+ }
+ }
+}
+const importantRE = /\s*!important$/;
+function setStyle(style, name, val) {
+ if (isArray$4(val)) {
+ val.forEach((v2) => setStyle(style, name, v2));
+ } else {
+ if (val == null)
+ val = "";
+ if (name.startsWith("--")) {
+ style.setProperty(name, val);
+ } else {
+ const prefixed = autoPrefix(style, name);
+ if (importantRE.test(val)) {
+ style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
+ } else {
+ style[prefixed] = val;
+ }
+ }
+ }
+}
+const prefixes = ["Webkit", "Moz", "ms"];
+const prefixCache = {};
+function autoPrefix(style, rawName) {
+ const cached = prefixCache[rawName];
+ if (cached) {
+ return cached;
+ }
+ let name = camelize(rawName);
+ if (name !== "filter" && name in style) {
+ return prefixCache[rawName] = name;
+ }
+ name = capitalize(name);
+ for (let i = 0; i < prefixes.length; i++) {
+ const prefixed = prefixes[i] + name;
+ if (prefixed in style) {
+ return prefixCache[rawName] = prefixed;
+ }
+ }
+ return rawName;
+}
+const xlinkNS = "http://www.w3.org/1999/xlink";
+function patchAttr(el, key, value, isSVG, instance) {
+ if (isSVG && key.startsWith("xlink:")) {
+ if (value == null) {
+ el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
+ } else {
+ el.setAttributeNS(xlinkNS, key, value);
+ }
+ } else {
+ const isBoolean2 = isSpecialBooleanAttr(key);
+ if (value == null || isBoolean2 && !includeBooleanAttr(value)) {
+ el.removeAttribute(key);
+ } else {
+ el.setAttribute(key, isBoolean2 ? "" : value);
+ }
+ }
+}
+function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
+ if (key === "innerHTML" || key === "textContent") {
+ if (prevChildren) {
+ unmountChildren(prevChildren, parentComponent, parentSuspense);
+ }
+ el[key] = value == null ? "" : value;
+ return;
+ }
+ const tag = el.tagName;
+ if (key === "value" && tag !== "PROGRESS" && !tag.includes("-")) {
+ el._value = value;
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
+ const newValue = value == null ? "" : value;
+ if (oldValue !== newValue) {
+ el.value = newValue;
+ }
+ if (value == null) {
+ el.removeAttribute(key);
+ }
+ return;
+ }
+ let needRemove = false;
+ if (value === "" || value == null) {
+ const type = typeof el[key];
+ if (type === "boolean") {
+ value = includeBooleanAttr(value);
+ } else if (value == null && type === "string") {
+ value = "";
+ needRemove = true;
+ } else if (type === "number") {
+ value = 0;
+ needRemove = true;
+ }
+ }
+ try {
+ el[key] = value;
+ } catch (e2) {
+ }
+ needRemove && el.removeAttribute(key);
+}
+function addEventListener(el, event, handler, options) {
+ el.addEventListener(event, handler, options);
+}
+function removeEventListener(el, event, handler, options) {
+ el.removeEventListener(event, handler, options);
+}
+function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
+ const invokers = el._vei || (el._vei = {});
+ const existingInvoker = invokers[rawName];
+ if (nextValue && existingInvoker) {
+ existingInvoker.value = nextValue;
+ } else {
+ const [name, options] = parseName(rawName);
+ if (nextValue) {
+ const invoker = invokers[rawName] = createInvoker(nextValue, instance);
+ addEventListener(el, name, invoker, options);
+ } else if (existingInvoker) {
+ removeEventListener(el, name, existingInvoker, options);
+ invokers[rawName] = void 0;
+ }
+ }
+}
+const optionsModifierRE = /(?:Once|Passive|Capture)$/;
+function parseName(name) {
+ let options;
+ if (optionsModifierRE.test(name)) {
+ options = {};
+ let m2;
+ while (m2 = name.match(optionsModifierRE)) {
+ name = name.slice(0, name.length - m2[0].length);
+ options[m2[0].toLowerCase()] = true;
+ }
+ }
+ const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
+ return [event, options];
+}
+let cachedNow = 0;
+const p$4 = /* @__PURE__ */ Promise.resolve();
+const getNow = () => cachedNow || (p$4.then(() => cachedNow = 0), cachedNow = Date.now());
+function createInvoker(initialValue, instance) {
+ const invoker = (e2) => {
+ if (!e2._vts) {
+ e2._vts = Date.now();
+ } else if (e2._vts <= invoker.attached) {
+ return;
+ }
+ callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, invoker.value), instance, 5, [e2]);
+ };
+ invoker.value = initialValue;
+ invoker.attached = getNow();
+ return invoker;
+}
+function patchStopImmediatePropagation(e2, value) {
+ if (isArray$4(value)) {
+ const originalStop = e2.stopImmediatePropagation;
+ e2.stopImmediatePropagation = () => {
+ originalStop.call(e2);
+ e2._stopped = true;
+ };
+ return value.map((fn) => (e22) => !e22._stopped && fn && fn(e22));
+ } else {
+ return value;
+ }
+}
+const nativeOnRE = /^on[a-z]/;
+const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
+ if (key === "class") {
+ patchClass(el, nextValue, isSVG);
+ } else if (key === "style") {
+ patchStyle(el, prevValue, nextValue);
+ } else if (isOn(key)) {
+ if (!isModelListener(key)) {
+ patchEvent(el, key, prevValue, nextValue, parentComponent);
+ }
+ } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
+ patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren);
+ } else {
+ if (key === "true-value") {
+ el._trueValue = nextValue;
+ } else if (key === "false-value") {
+ el._falseValue = nextValue;
+ }
+ patchAttr(el, key, nextValue, isSVG);
+ }
+};
+function shouldSetAsProp(el, key, value, isSVG) {
+ if (isSVG) {
+ if (key === "innerHTML" || key === "textContent") {
+ return true;
+ }
+ if (key in el && nativeOnRE.test(key) && isFunction$1(value)) {
+ return true;
+ }
+ return false;
+ }
+ if (key === "spellcheck" || key === "draggable" || key === "translate") {
+ return false;
+ }
+ if (key === "form") {
+ return false;
+ }
+ if (key === "list" && el.tagName === "INPUT") {
+ return false;
+ }
+ if (key === "type" && el.tagName === "TEXTAREA") {
+ return false;
+ }
+ if (nativeOnRE.test(key) && isString$2(value)) {
+ return false;
+ }
+ return key in el;
+}
+const TRANSITION = "transition";
+const ANIMATION = "animation";
+const Transition = (props2, { slots }) => h$1(BaseTransition, resolveTransitionProps(props2), slots);
+Transition.displayName = "Transition";
+const DOMTransitionPropsValidators = {
+ name: String,
+ type: String,
+ css: {
+ type: Boolean,
+ default: true
+ },
+ duration: [String, Number, Object],
+ enterFromClass: String,
+ enterActiveClass: String,
+ enterToClass: String,
+ appearFromClass: String,
+ appearActiveClass: String,
+ appearToClass: String,
+ leaveFromClass: String,
+ leaveActiveClass: String,
+ leaveToClass: String
+};
+Transition.props = /* @__PURE__ */ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
+const callHook = (hook, args = []) => {
+ if (isArray$4(hook)) {
+ hook.forEach((h2) => h2(...args));
+ } else if (hook) {
+ hook(...args);
+ }
+};
+const hasExplicitCallback = (hook) => {
+ return hook ? isArray$4(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
+};
+function resolveTransitionProps(rawProps) {
+ const baseProps = {};
+ for (const key in rawProps) {
+ if (!(key in DOMTransitionPropsValidators)) {
+ baseProps[key] = rawProps[key];
+ }
+ }
+ if (rawProps.css === false) {
+ return baseProps;
+ }
+ const {
+ name = "v",
+ type,
+ duration,
+ enterFromClass = `${name}-enter-from`,
+ enterActiveClass = `${name}-enter-active`,
+ enterToClass = `${name}-enter-to`,
+ appearFromClass = enterFromClass,
+ appearActiveClass = enterActiveClass,
+ appearToClass = enterToClass,
+ leaveFromClass = `${name}-leave-from`,
+ leaveActiveClass = `${name}-leave-active`,
+ leaveToClass = `${name}-leave-to`
+ } = rawProps;
+ const durations = normalizeDuration(duration);
+ const enterDuration = durations && durations[0];
+ const leaveDuration = durations && durations[1];
+ const {
+ onBeforeEnter,
+ onEnter,
+ onEnterCancelled,
+ onLeave,
+ onLeaveCancelled,
+ onBeforeAppear = onBeforeEnter,
+ onAppear = onEnter,
+ onAppearCancelled = onEnterCancelled
+ } = baseProps;
+ const finishEnter = (el, isAppear, done) => {
+ removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
+ removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
+ done && done();
+ };
+ const finishLeave = (el, done) => {
+ el._isLeaving = false;
+ removeTransitionClass(el, leaveFromClass);
+ removeTransitionClass(el, leaveToClass);
+ removeTransitionClass(el, leaveActiveClass);
+ done && done();
+ };
+ const makeEnterHook = (isAppear) => {
+ return (el, done) => {
+ const hook = isAppear ? onAppear : onEnter;
+ const resolve2 = () => finishEnter(el, isAppear, done);
+ callHook(hook, [el, resolve2]);
+ nextFrame(() => {
+ removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
+ addTransitionClass(el, isAppear ? appearToClass : enterToClass);
+ if (!hasExplicitCallback(hook)) {
+ whenTransitionEnds(el, type, enterDuration, resolve2);
+ }
+ });
+ };
+ };
+ return extend(baseProps, {
+ onBeforeEnter(el) {
+ callHook(onBeforeEnter, [el]);
+ addTransitionClass(el, enterFromClass);
+ addTransitionClass(el, enterActiveClass);
+ },
+ onBeforeAppear(el) {
+ callHook(onBeforeAppear, [el]);
+ addTransitionClass(el, appearFromClass);
+ addTransitionClass(el, appearActiveClass);
+ },
+ onEnter: makeEnterHook(false),
+ onAppear: makeEnterHook(true),
+ onLeave(el, done) {
+ el._isLeaving = true;
+ const resolve2 = () => finishLeave(el, done);
+ addTransitionClass(el, leaveFromClass);
+ forceReflow();
+ addTransitionClass(el, leaveActiveClass);
+ nextFrame(() => {
+ if (!el._isLeaving) {
+ return;
+ }
+ removeTransitionClass(el, leaveFromClass);
+ addTransitionClass(el, leaveToClass);
+ if (!hasExplicitCallback(onLeave)) {
+ whenTransitionEnds(el, type, leaveDuration, resolve2);
+ }
+ });
+ callHook(onLeave, [el, resolve2]);
+ },
+ onEnterCancelled(el) {
+ finishEnter(el, false);
+ callHook(onEnterCancelled, [el]);
+ },
+ onAppearCancelled(el) {
+ finishEnter(el, true);
+ callHook(onAppearCancelled, [el]);
+ },
+ onLeaveCancelled(el) {
+ finishLeave(el);
+ callHook(onLeaveCancelled, [el]);
+ }
+ });
+}
+function normalizeDuration(duration) {
+ if (duration == null) {
+ return null;
+ } else if (isObject$2(duration)) {
+ return [NumberOf(duration.enter), NumberOf(duration.leave)];
+ } else {
+ const n2 = NumberOf(duration);
+ return [n2, n2];
+ }
+}
+function NumberOf(val) {
+ const res = toNumber(val);
+ return res;
+}
+function addTransitionClass(el, cls) {
+ cls.split(/\s+/).forEach((c2) => c2 && el.classList.add(c2));
+ (el._vtc || (el._vtc = /* @__PURE__ */ new Set())).add(cls);
+}
+function removeTransitionClass(el, cls) {
+ cls.split(/\s+/).forEach((c2) => c2 && el.classList.remove(c2));
+ const { _vtc } = el;
+ if (_vtc) {
+ _vtc.delete(cls);
+ if (!_vtc.size) {
+ el._vtc = void 0;
+ }
+ }
+}
+function nextFrame(cb) {
+ requestAnimationFrame(() => {
+ requestAnimationFrame(cb);
+ });
+}
+let endId = 0;
+function whenTransitionEnds(el, expectedType, explicitTimeout, resolve2) {
+ const id = el._endId = ++endId;
+ const resolveIfNotStale = () => {
+ if (id === el._endId) {
+ resolve2();
+ }
+ };
+ if (explicitTimeout) {
+ return setTimeout(resolveIfNotStale, explicitTimeout);
+ }
+ const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
+ if (!type) {
+ return resolve2();
+ }
+ const endEvent = type + "end";
+ let ended = 0;
+ const end = () => {
+ el.removeEventListener(endEvent, onEnd);
+ resolveIfNotStale();
+ };
+ const onEnd = (e2) => {
+ if (e2.target === el && ++ended >= propCount) {
+ end();
+ }
+ };
+ setTimeout(() => {
+ if (ended < propCount) {
+ end();
+ }
+ }, timeout + 1);
+ el.addEventListener(endEvent, onEnd);
+}
+function getTransitionInfo(el, expectedType) {
+ const styles = window.getComputedStyle(el);
+ const getStyleProperties = (key) => (styles[key] || "").split(", ");
+ const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
+ const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
+ const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
+ const animationTimeout = getTimeout(animationDelays, animationDurations);
+ let type = null;
+ let timeout = 0;
+ let propCount = 0;
+ if (expectedType === TRANSITION) {
+ if (transitionTimeout > 0) {
+ type = TRANSITION;
+ timeout = transitionTimeout;
+ propCount = transitionDurations.length;
+ }
+ } else if (expectedType === ANIMATION) {
+ if (animationTimeout > 0) {
+ type = ANIMATION;
+ timeout = animationTimeout;
+ propCount = animationDurations.length;
+ }
+ } else {
+ timeout = Math.max(transitionTimeout, animationTimeout);
+ type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
+ propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
+ }
+ const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
+ return {
+ type,
+ timeout,
+ propCount,
+ hasTransform
+ };
+}
+function getTimeout(delays, durations) {
+ while (delays.length < durations.length) {
+ delays = delays.concat(delays);
+ }
+ return Math.max(...durations.map((d2, i) => toMs(d2) + toMs(delays[i])));
+}
+function toMs(s2) {
+ return Number(s2.slice(0, -1).replace(",", ".")) * 1e3;
+}
+function forceReflow() {
+ return document.body.offsetHeight;
+}
+const getModelAssigner = (vnode) => {
+ const fn = vnode.props["onUpdate:modelValue"] || false;
+ return isArray$4(fn) ? (value) => invokeArrayFns(fn, value) : fn;
+};
+function onCompositionStart(e2) {
+ e2.target.composing = true;
+}
+function onCompositionEnd(e2) {
+ const target = e2.target;
+ if (target.composing) {
+ target.composing = false;
+ target.dispatchEvent(new Event("input"));
+ }
+}
+const vModelText = {
+ created(el, { modifiers: { lazy, trim, number } }, vnode) {
+ el._assign = getModelAssigner(vnode);
+ const castToNumber = number || vnode.props && vnode.props.type === "number";
+ addEventListener(el, lazy ? "change" : "input", (e2) => {
+ if (e2.target.composing)
+ return;
+ let domValue = el.value;
+ if (trim) {
+ domValue = domValue.trim();
+ }
+ if (castToNumber) {
+ domValue = looseToNumber(domValue);
+ }
+ el._assign(domValue);
+ });
+ if (trim) {
+ addEventListener(el, "change", () => {
+ el.value = el.value.trim();
+ });
+ }
+ if (!lazy) {
+ addEventListener(el, "compositionstart", onCompositionStart);
+ addEventListener(el, "compositionend", onCompositionEnd);
+ addEventListener(el, "change", onCompositionEnd);
+ }
+ },
+ mounted(el, { value }) {
+ el.value = value == null ? "" : value;
+ },
+ beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
+ el._assign = getModelAssigner(vnode);
+ if (el.composing)
+ return;
+ if (document.activeElement === el && el.type !== "range") {
+ if (lazy) {
+ return;
+ }
+ if (trim && el.value.trim() === value) {
+ return;
+ }
+ if ((number || el.type === "number") && looseToNumber(el.value) === value) {
+ return;
+ }
+ }
+ const newValue = value == null ? "" : value;
+ if (el.value !== newValue) {
+ el.value = newValue;
+ }
+ }
+};
+const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
+let renderer;
+function ensureRenderer() {
+ return renderer || (renderer = createRenderer(rendererOptions));
+}
+const createApp = (...args) => {
+ const app2 = ensureRenderer().createApp(...args);
+ const { mount } = app2;
+ app2.mount = (containerOrSelector) => {
+ const container = normalizeContainer(containerOrSelector);
+ if (!container)
+ return;
+ const component = app2._component;
+ if (!isFunction$1(component) && !component.render && !component.template) {
+ component.template = container.innerHTML;
+ }
+ container.innerHTML = "";
+ const proxy = mount(container, false, container instanceof SVGElement);
+ if (container instanceof Element) {
+ container.removeAttribute("v-cloak");
+ container.setAttribute("data-v-app", "");
+ }
+ return proxy;
+ };
+ return app2;
+};
+function normalizeContainer(container) {
+ if (isString$2(container)) {
+ const res = document.querySelector(container);
+ return res;
+ }
+ return container;
+}
+/*!
+ * vue-router v4.2.2
+ * (c) 2023 Eduardo San Martin Morote
+ * @license MIT
+ */
+const isBrowser = typeof window !== "undefined";
+function isESModule(obj) {
+ return obj.__esModule || obj[Symbol.toStringTag] === "Module";
+}
+const assign$1 = Object.assign;
+function applyToParams(fn, params) {
+ const newParams = {};
+ for (const key in params) {
+ const value = params[key];
+ newParams[key] = isArray$3(value) ? value.map(fn) : fn(value);
+ }
+ return newParams;
+}
+const noop$1 = () => {
+};
+const isArray$3 = Array.isArray;
+const TRAILING_SLASH_RE$1 = /\/$/;
+const removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE$1, "");
+function parseURL$1(parseQuery2, location2, currentLocation = "/") {
+ let path, query = {}, searchString = "", hash = "";
+ const hashPos = location2.indexOf("#");
+ let searchPos = location2.indexOf("?");
+ if (hashPos < searchPos && hashPos >= 0) {
+ searchPos = -1;
+ }
+ if (searchPos > -1) {
+ path = location2.slice(0, searchPos);
+ searchString = location2.slice(searchPos + 1, hashPos > -1 ? hashPos : location2.length);
+ query = parseQuery2(searchString);
+ }
+ if (hashPos > -1) {
+ path = path || location2.slice(0, hashPos);
+ hash = location2.slice(hashPos, location2.length);
+ }
+ path = resolveRelativePath(path != null ? path : location2, currentLocation);
+ return {
+ fullPath: path + (searchString && "?") + searchString + hash,
+ path,
+ query,
+ hash
+ };
+}
+function stringifyURL(stringifyQuery2, location2) {
+ const query = location2.query ? stringifyQuery2(location2.query) : "";
+ return location2.path + (query && "?") + query + (location2.hash || "");
+}
+function stripBase(pathname, base2) {
+ if (!base2 || !pathname.toLowerCase().startsWith(base2.toLowerCase()))
+ return pathname;
+ return pathname.slice(base2.length) || "/";
+}
+function isSameRouteLocation(stringifyQuery2, a2, b3) {
+ const aLastIndex = a2.matched.length - 1;
+ const bLastIndex = b3.matched.length - 1;
+ return aLastIndex > -1 && aLastIndex === bLastIndex && isSameRouteRecord(a2.matched[aLastIndex], b3.matched[bLastIndex]) && isSameRouteLocationParams(a2.params, b3.params) && stringifyQuery2(a2.query) === stringifyQuery2(b3.query) && a2.hash === b3.hash;
+}
+function isSameRouteRecord(a2, b3) {
+ return (a2.aliasOf || a2) === (b3.aliasOf || b3);
+}
+function isSameRouteLocationParams(a2, b3) {
+ if (Object.keys(a2).length !== Object.keys(b3).length)
+ return false;
+ for (const key in a2) {
+ if (!isSameRouteLocationParamsValue(a2[key], b3[key]))
+ return false;
+ }
+ return true;
+}
+function isSameRouteLocationParamsValue(a2, b3) {
+ return isArray$3(a2) ? isEquivalentArray(a2, b3) : isArray$3(b3) ? isEquivalentArray(b3, a2) : a2 === b3;
+}
+function isEquivalentArray(a2, b3) {
+ return isArray$3(b3) ? a2.length === b3.length && a2.every((value, i) => value === b3[i]) : a2.length === 1 && a2[0] === b3;
+}
+function resolveRelativePath(to, from) {
+ if (to.startsWith("/"))
+ return to;
+ if (!to)
+ return from;
+ const fromSegments = from.split("/");
+ const toSegments = to.split("/");
+ const lastToSegment = toSegments[toSegments.length - 1];
+ if (lastToSegment === ".." || lastToSegment === ".") {
+ toSegments.push("");
+ }
+ let position = fromSegments.length - 1;
+ let toPosition;
+ let segment;
+ for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
+ segment = toSegments[toPosition];
+ if (segment === ".")
+ continue;
+ if (segment === "..") {
+ if (position > 1)
+ position--;
+ } else
+ break;
+ }
+ return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition - (toPosition === toSegments.length ? 1 : 0)).join("/");
+}
+var NavigationType;
+(function(NavigationType2) {
+ NavigationType2["pop"] = "pop";
+ NavigationType2["push"] = "push";
+})(NavigationType || (NavigationType = {}));
+var NavigationDirection;
+(function(NavigationDirection2) {
+ NavigationDirection2["back"] = "back";
+ NavigationDirection2["forward"] = "forward";
+ NavigationDirection2["unknown"] = "";
+})(NavigationDirection || (NavigationDirection = {}));
+function normalizeBase(base2) {
+ if (!base2) {
+ if (isBrowser) {
+ const baseEl = document.querySelector("base");
+ base2 = baseEl && baseEl.getAttribute("href") || "/";
+ base2 = base2.replace(/^\w+:\/\/[^\/]+/, "");
+ } else {
+ base2 = "/";
+ }
+ }
+ if (base2[0] !== "/" && base2[0] !== "#")
+ base2 = "/" + base2;
+ return removeTrailingSlash(base2);
+}
+const BEFORE_HASH_RE = /^[^#]+#/;
+function createHref(base2, location2) {
+ return base2.replace(BEFORE_HASH_RE, "#") + location2;
+}
+function getElementPosition(el, offset) {
+ const docRect = document.documentElement.getBoundingClientRect();
+ const elRect = el.getBoundingClientRect();
+ return {
+ behavior: offset.behavior,
+ left: elRect.left - docRect.left - (offset.left || 0),
+ top: elRect.top - docRect.top - (offset.top || 0)
+ };
+}
+const computeScrollPosition = () => ({
+ left: window.pageXOffset,
+ top: window.pageYOffset
+});
+function scrollToPosition(position) {
+ let scrollToOptions;
+ if ("el" in position) {
+ const positionEl = position.el;
+ const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
+ const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
+ if (!el) {
+ return;
+ }
+ scrollToOptions = getElementPosition(el, position);
+ } else {
+ scrollToOptions = position;
+ }
+ if ("scrollBehavior" in document.documentElement.style)
+ window.scrollTo(scrollToOptions);
+ else {
+ window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.pageXOffset, scrollToOptions.top != null ? scrollToOptions.top : window.pageYOffset);
+ }
+}
+function getScrollKey(path, delta) {
+ const position = history.state ? history.state.position - delta : -1;
+ return position + path;
+}
+const scrollPositions = /* @__PURE__ */ new Map();
+function saveScrollPosition(key, scrollPosition) {
+ scrollPositions.set(key, scrollPosition);
+}
+function getSavedScrollPosition(key) {
+ const scroll = scrollPositions.get(key);
+ scrollPositions.delete(key);
+ return scroll;
+}
+let createBaseLocation = () => location.protocol + "//" + location.host;
+function createCurrentLocation(base2, location2) {
+ const { pathname, search: search2, hash } = location2;
+ const hashPos = base2.indexOf("#");
+ if (hashPos > -1) {
+ let slicePos = hash.includes(base2.slice(hashPos)) ? base2.slice(hashPos).length : 1;
+ let pathFromHash = hash.slice(slicePos);
+ if (pathFromHash[0] !== "/")
+ pathFromHash = "/" + pathFromHash;
+ return stripBase(pathFromHash, "");
+ }
+ const path = stripBase(pathname, base2);
+ return path + search2 + hash;
+}
+function useHistoryListeners(base2, historyState, currentLocation, replace) {
+ let listeners = [];
+ let teardowns = [];
+ let pauseState = null;
+ const popStateHandler = ({ state }) => {
+ const to = createCurrentLocation(base2, location);
+ const from = currentLocation.value;
+ const fromState = historyState.value;
+ let delta = 0;
+ if (state) {
+ currentLocation.value = to;
+ historyState.value = state;
+ if (pauseState && pauseState === from) {
+ pauseState = null;
+ return;
+ }
+ delta = fromState ? state.position - fromState.position : 0;
+ } else {
+ replace(to);
+ }
+ listeners.forEach((listener) => {
+ listener(currentLocation.value, from, {
+ delta,
+ type: NavigationType.pop,
+ direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
+ });
+ });
+ };
+ function pauseListeners() {
+ pauseState = currentLocation.value;
+ }
+ function listen(callback) {
+ listeners.push(callback);
+ const teardown = () => {
+ const index = listeners.indexOf(callback);
+ if (index > -1)
+ listeners.splice(index, 1);
+ };
+ teardowns.push(teardown);
+ return teardown;
+ }
+ function beforeUnloadListener() {
+ const { history: history2 } = window;
+ if (!history2.state)
+ return;
+ history2.replaceState(assign$1({}, history2.state, { scroll: computeScrollPosition() }), "");
+ }
+ function destroy() {
+ for (const teardown of teardowns)
+ teardown();
+ teardowns = [];
+ window.removeEventListener("popstate", popStateHandler);
+ window.removeEventListener("beforeunload", beforeUnloadListener);
+ }
+ window.addEventListener("popstate", popStateHandler);
+ window.addEventListener("beforeunload", beforeUnloadListener, {
+ passive: true
+ });
+ return {
+ pauseListeners,
+ listen,
+ destroy
+ };
+}
+function buildState(back, current, forward, replaced = false, computeScroll = false) {
+ return {
+ back,
+ current,
+ forward,
+ replaced,
+ position: window.history.length,
+ scroll: computeScroll ? computeScrollPosition() : null
+ };
+}
+function useHistoryStateNavigation(base2) {
+ const { history: history2, location: location2 } = window;
+ const currentLocation = {
+ value: createCurrentLocation(base2, location2)
+ };
+ const historyState = { value: history2.state };
+ if (!historyState.value) {
+ changeLocation(currentLocation.value, {
+ back: null,
+ current: currentLocation.value,
+ forward: null,
+ position: history2.length - 1,
+ replaced: true,
+ scroll: null
+ }, true);
+ }
+ function changeLocation(to, state, replace2) {
+ const hashIndex = base2.indexOf("#");
+ const url = hashIndex > -1 ? (location2.host && document.querySelector("base") ? base2 : base2.slice(hashIndex)) + to : createBaseLocation() + base2 + to;
+ try {
+ history2[replace2 ? "replaceState" : "pushState"](state, "", url);
+ historyState.value = state;
+ } catch (err) {
+ {
+ console.error(err);
+ }
+ location2[replace2 ? "replace" : "assign"](url);
+ }
+ }
+ function replace(to, data) {
+ const state = assign$1({}, history2.state, buildState(historyState.value.back, to, historyState.value.forward, true), data, { position: historyState.value.position });
+ changeLocation(to, state, true);
+ currentLocation.value = to;
+ }
+ function push(to, data) {
+ const currentState = assign$1({}, historyState.value, history2.state, {
+ forward: to,
+ scroll: computeScrollPosition()
+ });
+ changeLocation(currentState.current, currentState, true);
+ const state = assign$1({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data);
+ changeLocation(to, state, false);
+ currentLocation.value = to;
+ }
+ return {
+ location: currentLocation,
+ state: historyState,
+ push,
+ replace
+ };
+}
+function createWebHistory(base2) {
+ base2 = normalizeBase(base2);
+ const historyNavigation = useHistoryStateNavigation(base2);
+ const historyListeners = useHistoryListeners(base2, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
+ function go(delta, triggerListeners = true) {
+ if (!triggerListeners)
+ historyListeners.pauseListeners();
+ history.go(delta);
+ }
+ const routerHistory = assign$1({
+ location: "",
+ base: base2,
+ go,
+ createHref: createHref.bind(null, base2)
+ }, historyNavigation, historyListeners);
+ Object.defineProperty(routerHistory, "location", {
+ enumerable: true,
+ get: () => historyNavigation.location.value
+ });
+ Object.defineProperty(routerHistory, "state", {
+ enumerable: true,
+ get: () => historyNavigation.state.value
+ });
+ return routerHistory;
+}
+function isRouteLocation(route) {
+ return typeof route === "string" || route && typeof route === "object";
+}
+function isRouteName(name) {
+ return typeof name === "string" || typeof name === "symbol";
+}
+const START_LOCATION_NORMALIZED = {
+ path: "/",
+ name: void 0,
+ params: {},
+ query: {},
+ hash: "",
+ fullPath: "/",
+ matched: [],
+ meta: {},
+ redirectedFrom: void 0
+};
+const NavigationFailureSymbol = Symbol("");
+var NavigationFailureType;
+(function(NavigationFailureType2) {
+ NavigationFailureType2[NavigationFailureType2["aborted"] = 4] = "aborted";
+ NavigationFailureType2[NavigationFailureType2["cancelled"] = 8] = "cancelled";
+ NavigationFailureType2[NavigationFailureType2["duplicated"] = 16] = "duplicated";
+})(NavigationFailureType || (NavigationFailureType = {}));
+function createRouterError(type, params) {
+ {
+ return assign$1(new Error(), {
+ type,
+ [NavigationFailureSymbol]: true
+ }, params);
+ }
+}
+function isNavigationFailure(error, type) {
+ return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
+}
+const BASE_PARAM_PATTERN = "[^/]+?";
+const BASE_PATH_PARSER_OPTIONS = {
+ sensitive: false,
+ strict: false,
+ start: true,
+ end: true
+};
+const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
+function tokensToParser(segments, extraOptions) {
+ const options = assign$1({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
+ const score = [];
+ let pattern = options.start ? "^" : "";
+ const keys2 = [];
+ for (const segment of segments) {
+ const segmentScores = segment.length ? [] : [90];
+ if (options.strict && !segment.length)
+ pattern += "/";
+ for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
+ const token = segment[tokenIndex];
+ let subSegmentScore = 40 + (options.sensitive ? 0.25 : 0);
+ if (token.type === 0) {
+ if (!tokenIndex)
+ pattern += "/";
+ pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
+ subSegmentScore += 40;
+ } else if (token.type === 1) {
+ const { value, repeatable, optional, regexp } = token;
+ keys2.push({
+ name: value,
+ repeatable,
+ optional
+ });
+ const re2 = regexp ? regexp : BASE_PARAM_PATTERN;
+ if (re2 !== BASE_PARAM_PATTERN) {
+ subSegmentScore += 10;
+ try {
+ new RegExp(`(${re2})`);
+ } catch (err) {
+ throw new Error(`Invalid custom RegExp for param "${value}" (${re2}): ` + err.message);
+ }
+ }
+ let subPattern = repeatable ? `((?:${re2})(?:/(?:${re2}))*)` : `(${re2})`;
+ if (!tokenIndex)
+ subPattern = optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
+ if (optional)
+ subPattern += "?";
+ pattern += subPattern;
+ subSegmentScore += 20;
+ if (optional)
+ subSegmentScore += -8;
+ if (repeatable)
+ subSegmentScore += -20;
+ if (re2 === ".*")
+ subSegmentScore += -50;
+ }
+ segmentScores.push(subSegmentScore);
+ }
+ score.push(segmentScores);
+ }
+ if (options.strict && options.end) {
+ const i = score.length - 1;
+ score[i][score[i].length - 1] += 0.7000000000000001;
+ }
+ if (!options.strict)
+ pattern += "/?";
+ if (options.end)
+ pattern += "$";
+ else if (options.strict)
+ pattern += "(?:/|$)";
+ const re = new RegExp(pattern, options.sensitive ? "" : "i");
+ function parse2(path) {
+ const match2 = path.match(re);
+ const params = {};
+ if (!match2)
+ return null;
+ for (let i = 1; i < match2.length; i++) {
+ const value = match2[i] || "";
+ const key = keys2[i - 1];
+ params[key.name] = value && key.repeatable ? value.split("/") : value;
+ }
+ return params;
+ }
+ function stringify(params) {
+ let path = "";
+ let avoidDuplicatedSlash = false;
+ for (const segment of segments) {
+ if (!avoidDuplicatedSlash || !path.endsWith("/"))
+ path += "/";
+ avoidDuplicatedSlash = false;
+ for (const token of segment) {
+ if (token.type === 0) {
+ path += token.value;
+ } else if (token.type === 1) {
+ const { value, repeatable, optional } = token;
+ const param = value in params ? params[value] : "";
+ if (isArray$3(param) && !repeatable) {
+ throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
+ }
+ const text = isArray$3(param) ? param.join("/") : param;
+ if (!text) {
+ if (optional) {
+ if (segment.length < 2) {
+ if (path.endsWith("/"))
+ path = path.slice(0, -1);
+ else
+ avoidDuplicatedSlash = true;
+ }
+ } else
+ throw new Error(`Missing required param "${value}"`);
+ }
+ path += text;
+ }
+ }
+ }
+ return path || "/";
+ }
+ return {
+ re,
+ score,
+ keys: keys2,
+ parse: parse2,
+ stringify
+ };
+}
+function compareScoreArray(a2, b3) {
+ let i = 0;
+ while (i < a2.length && i < b3.length) {
+ const diff = b3[i] - a2[i];
+ if (diff)
+ return diff;
+ i++;
+ }
+ if (a2.length < b3.length) {
+ return a2.length === 1 && a2[0] === 40 + 40 ? -1 : 1;
+ } else if (a2.length > b3.length) {
+ return b3.length === 1 && b3[0] === 40 + 40 ? 1 : -1;
+ }
+ return 0;
+}
+function comparePathParserScore(a2, b3) {
+ let i = 0;
+ const aScore = a2.score;
+ const bScore = b3.score;
+ while (i < aScore.length && i < bScore.length) {
+ const comp = compareScoreArray(aScore[i], bScore[i]);
+ if (comp)
+ return comp;
+ i++;
+ }
+ if (Math.abs(bScore.length - aScore.length) === 1) {
+ if (isLastScoreNegative(aScore))
+ return 1;
+ if (isLastScoreNegative(bScore))
+ return -1;
+ }
+ return bScore.length - aScore.length;
+}
+function isLastScoreNegative(score) {
+ const last = score[score.length - 1];
+ return score.length > 0 && last[last.length - 1] < 0;
+}
+const ROOT_TOKEN = {
+ type: 0,
+ value: ""
+};
+const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
+function tokenizePath(path) {
+ if (!path)
+ return [[]];
+ if (path === "/")
+ return [[ROOT_TOKEN]];
+ if (!path.startsWith("/")) {
+ throw new Error(`Invalid path "${path}"`);
+ }
+ function crash(message) {
+ throw new Error(`ERR (${state})/"${buffer}": ${message}`);
+ }
+ let state = 0;
+ let previousState = state;
+ const tokens = [];
+ let segment;
+ function finalizeSegment() {
+ if (segment)
+ tokens.push(segment);
+ segment = [];
+ }
+ let i = 0;
+ let char;
+ let buffer = "";
+ let customRe = "";
+ function consumeBuffer() {
+ if (!buffer)
+ return;
+ if (state === 0) {
+ segment.push({
+ type: 0,
+ value: buffer
+ });
+ } else if (state === 1 || state === 2 || state === 3) {
+ if (segment.length > 1 && (char === "*" || char === "+"))
+ crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
+ segment.push({
+ type: 1,
+ value: buffer,
+ regexp: customRe,
+ repeatable: char === "*" || char === "+",
+ optional: char === "*" || char === "?"
+ });
+ } else {
+ crash("Invalid state to consume buffer");
+ }
+ buffer = "";
+ }
+ function addCharToBuffer() {
+ buffer += char;
+ }
+ while (i < path.length) {
+ char = path[i++];
+ if (char === "\\" && state !== 2) {
+ previousState = state;
+ state = 4;
+ continue;
+ }
+ switch (state) {
+ case 0:
+ if (char === "/") {
+ if (buffer) {
+ consumeBuffer();
+ }
+ finalizeSegment();
+ } else if (char === ":") {
+ consumeBuffer();
+ state = 1;
+ } else {
+ addCharToBuffer();
+ }
+ break;
+ case 4:
+ addCharToBuffer();
+ state = previousState;
+ break;
+ case 1:
+ if (char === "(") {
+ state = 2;
+ } else if (VALID_PARAM_RE.test(char)) {
+ addCharToBuffer();
+ } else {
+ consumeBuffer();
+ state = 0;
+ if (char !== "*" && char !== "?" && char !== "+")
+ i--;
+ }
+ break;
+ case 2:
+ if (char === ")") {
+ if (customRe[customRe.length - 1] == "\\")
+ customRe = customRe.slice(0, -1) + char;
+ else
+ state = 3;
+ } else {
+ customRe += char;
+ }
+ break;
+ case 3:
+ consumeBuffer();
+ state = 0;
+ if (char !== "*" && char !== "?" && char !== "+")
+ i--;
+ customRe = "";
+ break;
+ default:
+ crash("Unknown state");
+ break;
+ }
+ }
+ if (state === 2)
+ crash(`Unfinished custom RegExp for param "${buffer}"`);
+ consumeBuffer();
+ finalizeSegment();
+ return tokens;
+}
+function createRouteRecordMatcher(record, parent, options) {
+ const parser = tokensToParser(tokenizePath(record.path), options);
+ const matcher = assign$1(parser, {
+ record,
+ parent,
+ children: [],
+ alias: []
+ });
+ if (parent) {
+ if (!matcher.record.aliasOf === !parent.record.aliasOf)
+ parent.children.push(matcher);
+ }
+ return matcher;
+}
+function createRouterMatcher(routes2, globalOptions) {
+ const matchers = [];
+ const matcherMap = /* @__PURE__ */ new Map();
+ globalOptions = mergeOptions({ strict: false, end: true, sensitive: false }, globalOptions);
+ function getRecordMatcher(name) {
+ return matcherMap.get(name);
+ }
+ function addRoute(record, parent, originalRecord) {
+ const isRootAdd = !originalRecord;
+ const mainNormalizedRecord = normalizeRouteRecord(record);
+ mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
+ const options = mergeOptions(globalOptions, record);
+ const normalizedRecords = [
+ mainNormalizedRecord
+ ];
+ if ("alias" in record) {
+ const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
+ for (const alias of aliases) {
+ normalizedRecords.push(assign$1({}, mainNormalizedRecord, {
+ components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
+ path: alias,
+ aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
+ }));
+ }
+ }
+ let matcher;
+ let originalMatcher;
+ for (const normalizedRecord of normalizedRecords) {
+ const { path } = normalizedRecord;
+ if (parent && path[0] !== "/") {
+ const parentPath = parent.record.path;
+ const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
+ normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
+ }
+ matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
+ if (originalRecord) {
+ originalRecord.alias.push(matcher);
+ } else {
+ originalMatcher = originalMatcher || matcher;
+ if (originalMatcher !== matcher)
+ originalMatcher.alias.push(matcher);
+ if (isRootAdd && record.name && !isAliasRecord(matcher))
+ removeRoute(record.name);
+ }
+ if (mainNormalizedRecord.children) {
+ const children = mainNormalizedRecord.children;
+ for (let i = 0; i < children.length; i++) {
+ addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);
+ }
+ }
+ originalRecord = originalRecord || matcher;
+ if (matcher.record.components && Object.keys(matcher.record.components).length || matcher.record.name || matcher.record.redirect) {
+ insertMatcher(matcher);
+ }
+ }
+ return originalMatcher ? () => {
+ removeRoute(originalMatcher);
+ } : noop$1;
+ }
+ function removeRoute(matcherRef) {
+ if (isRouteName(matcherRef)) {
+ const matcher = matcherMap.get(matcherRef);
+ if (matcher) {
+ matcherMap.delete(matcherRef);
+ matchers.splice(matchers.indexOf(matcher), 1);
+ matcher.children.forEach(removeRoute);
+ matcher.alias.forEach(removeRoute);
+ }
+ } else {
+ const index = matchers.indexOf(matcherRef);
+ if (index > -1) {
+ matchers.splice(index, 1);
+ if (matcherRef.record.name)
+ matcherMap.delete(matcherRef.record.name);
+ matcherRef.children.forEach(removeRoute);
+ matcherRef.alias.forEach(removeRoute);
+ }
+ }
+ }
+ function getRoutes() {
+ return matchers;
+ }
+ function insertMatcher(matcher) {
+ let i = 0;
+ while (i < matchers.length && comparePathParserScore(matcher, matchers[i]) >= 0 && (matcher.record.path !== matchers[i].record.path || !isRecordChildOf(matcher, matchers[i])))
+ i++;
+ matchers.splice(i, 0, matcher);
+ if (matcher.record.name && !isAliasRecord(matcher))
+ matcherMap.set(matcher.record.name, matcher);
+ }
+ function resolve2(location2, currentLocation) {
+ let matcher;
+ let params = {};
+ let path;
+ let name;
+ if ("name" in location2 && location2.name) {
+ matcher = matcherMap.get(location2.name);
+ if (!matcher)
+ throw createRouterError(1, {
+ location: location2
+ });
+ name = matcher.record.name;
+ params = assign$1(paramsFromLocation(currentLocation.params, matcher.keys.filter((k2) => !k2.optional).map((k2) => k2.name)), location2.params && paramsFromLocation(location2.params, matcher.keys.map((k2) => k2.name)));
+ path = matcher.stringify(params);
+ } else if ("path" in location2) {
+ path = location2.path;
+ matcher = matchers.find((m2) => m2.re.test(path));
+ if (matcher) {
+ params = matcher.parse(path);
+ name = matcher.record.name;
+ }
+ } else {
+ matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m2) => m2.re.test(currentLocation.path));
+ if (!matcher)
+ throw createRouterError(1, {
+ location: location2,
+ currentLocation
+ });
+ name = matcher.record.name;
+ params = assign$1({}, currentLocation.params, location2.params);
+ path = matcher.stringify(params);
+ }
+ const matched = [];
+ let parentMatcher = matcher;
+ while (parentMatcher) {
+ matched.unshift(parentMatcher.record);
+ parentMatcher = parentMatcher.parent;
+ }
+ return {
+ name,
+ path,
+ params,
+ matched,
+ meta: mergeMetaFields(matched)
+ };
+ }
+ routes2.forEach((route) => addRoute(route));
+ return { addRoute, resolve: resolve2, removeRoute, getRoutes, getRecordMatcher };
+}
+function paramsFromLocation(params, keys2) {
+ const newParams = {};
+ for (const key of keys2) {
+ if (key in params)
+ newParams[key] = params[key];
+ }
+ return newParams;
+}
+function normalizeRouteRecord(record) {
+ return {
+ path: record.path,
+ redirect: record.redirect,
+ name: record.name,
+ meta: record.meta || {},
+ aliasOf: void 0,
+ beforeEnter: record.beforeEnter,
+ props: normalizeRecordProps(record),
+ children: record.children || [],
+ instances: {},
+ leaveGuards: /* @__PURE__ */ new Set(),
+ updateGuards: /* @__PURE__ */ new Set(),
+ enterCallbacks: {},
+ components: "components" in record ? record.components || null : record.component && { default: record.component }
+ };
+}
+function normalizeRecordProps(record) {
+ const propsObject = {};
+ const props2 = record.props || false;
+ if ("component" in record) {
+ propsObject.default = props2;
+ } else {
+ for (const name in record.components)
+ propsObject[name] = typeof props2 === "boolean" ? props2 : props2[name];
+ }
+ return propsObject;
+}
+function isAliasRecord(record) {
+ while (record) {
+ if (record.record.aliasOf)
+ return true;
+ record = record.parent;
+ }
+ return false;
+}
+function mergeMetaFields(matched) {
+ return matched.reduce((meta, record) => assign$1(meta, record.meta), {});
+}
+function mergeOptions(defaults, partialOptions) {
+ const options = {};
+ for (const key in defaults) {
+ options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
+ }
+ return options;
+}
+function isRecordChildOf(record, parent) {
+ return parent.children.some((child) => child === record || isRecordChildOf(record, child));
+}
+const HASH_RE$1 = /#/g;
+const AMPERSAND_RE$1 = /&/g;
+const SLASH_RE = /\//g;
+const EQUAL_RE$1 = /=/g;
+const IM_RE$1 = /\?/g;
+const PLUS_RE$1 = /\+/g;
+const ENC_BRACKET_OPEN_RE$1 = /%5B/g;
+const ENC_BRACKET_CLOSE_RE$1 = /%5D/g;
+const ENC_CARET_RE$1 = /%5E/g;
+const ENC_BACKTICK_RE$1 = /%60/g;
+const ENC_CURLY_OPEN_RE$1 = /%7B/g;
+const ENC_PIPE_RE$1 = /%7C/g;
+const ENC_CURLY_CLOSE_RE$1 = /%7D/g;
+const ENC_SPACE_RE$1 = /%20/g;
+function commonEncode(text) {
+ return encodeURI("" + text).replace(ENC_PIPE_RE$1, "|").replace(ENC_BRACKET_OPEN_RE$1, "[").replace(ENC_BRACKET_CLOSE_RE$1, "]");
+}
+function encodeHash$1(text) {
+ return commonEncode(text).replace(ENC_CURLY_OPEN_RE$1, "{").replace(ENC_CURLY_CLOSE_RE$1, "}").replace(ENC_CARET_RE$1, "^");
+}
+function encodeQueryValue$1(text) {
+ return commonEncode(text).replace(PLUS_RE$1, "%2B").replace(ENC_SPACE_RE$1, "+").replace(HASH_RE$1, "%23").replace(AMPERSAND_RE$1, "%26").replace(ENC_BACKTICK_RE$1, "`").replace(ENC_CURLY_OPEN_RE$1, "{").replace(ENC_CURLY_CLOSE_RE$1, "}").replace(ENC_CARET_RE$1, "^");
+}
+function encodeQueryKey$1(text) {
+ return encodeQueryValue$1(text).replace(EQUAL_RE$1, "%3D");
+}
+function encodePath$1(text) {
+ return commonEncode(text).replace(HASH_RE$1, "%23").replace(IM_RE$1, "%3F");
+}
+function encodeParam(text) {
+ return text == null ? "" : encodePath$1(text).replace(SLASH_RE, "%2F");
+}
+function decode$1(text) {
+ try {
+ return decodeURIComponent("" + text);
+ } catch (err) {
+ }
+ return "" + text;
+}
+function parseQuery$2(search2) {
+ const query = {};
+ if (search2 === "" || search2 === "?")
+ return query;
+ const hasLeadingIM = search2[0] === "?";
+ const searchParams = (hasLeadingIM ? search2.slice(1) : search2).split("&");
+ for (let i = 0; i < searchParams.length; ++i) {
+ const searchParam = searchParams[i].replace(PLUS_RE$1, " ");
+ const eqPos = searchParam.indexOf("=");
+ const key = decode$1(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
+ const value = eqPos < 0 ? null : decode$1(searchParam.slice(eqPos + 1));
+ if (key in query) {
+ let currentValue = query[key];
+ if (!isArray$3(currentValue)) {
+ currentValue = query[key] = [currentValue];
+ }
+ currentValue.push(value);
+ } else {
+ query[key] = value;
+ }
+ }
+ return query;
+}
+function stringifyQuery$1(query) {
+ let search2 = "";
+ for (let key in query) {
+ const value = query[key];
+ key = encodeQueryKey$1(key);
+ if (value == null) {
+ if (value !== void 0) {
+ search2 += (search2.length ? "&" : "") + key;
+ }
+ continue;
+ }
+ const values = isArray$3(value) ? value.map((v2) => v2 && encodeQueryValue$1(v2)) : [value && encodeQueryValue$1(value)];
+ values.forEach((value2) => {
+ if (value2 !== void 0) {
+ search2 += (search2.length ? "&" : "") + key;
+ if (value2 != null)
+ search2 += "=" + value2;
+ }
+ });
+ }
+ return search2;
+}
+function normalizeQuery(query) {
+ const normalizedQuery = {};
+ for (const key in query) {
+ const value = query[key];
+ if (value !== void 0) {
+ normalizedQuery[key] = isArray$3(value) ? value.map((v2) => v2 == null ? null : "" + v2) : value == null ? value : "" + value;
+ }
+ }
+ return normalizedQuery;
+}
+const matchedRouteKey = Symbol("");
+const viewDepthKey = Symbol("");
+const routerKey = Symbol("");
+const routeLocationKey = Symbol("");
+const routerViewLocationKey = Symbol("");
+function useCallbacks() {
+ let handlers2 = [];
+ function add2(handler) {
+ handlers2.push(handler);
+ return () => {
+ const i = handlers2.indexOf(handler);
+ if (i > -1)
+ handlers2.splice(i, 1);
+ };
+ }
+ function reset() {
+ handlers2 = [];
+ }
+ return {
+ add: add2,
+ list: () => handlers2,
+ reset
+ };
+}
+function guardToPromiseFn(guard, to, from, record, name) {
+ const enterCallbackArray = record && (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
+ return () => new Promise((resolve2, reject) => {
+ const next = (valid) => {
+ if (valid === false) {
+ reject(createRouterError(4, {
+ from,
+ to
+ }));
+ } else if (valid instanceof Error) {
+ reject(valid);
+ } else if (isRouteLocation(valid)) {
+ reject(createRouterError(2, {
+ from: to,
+ to: valid
+ }));
+ } else {
+ if (enterCallbackArray && record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") {
+ enterCallbackArray.push(valid);
+ }
+ resolve2();
+ }
+ };
+ const guardReturn = guard.call(record && record.instances[name], to, from, next);
+ let guardCall = Promise.resolve(guardReturn);
+ if (guard.length < 3)
+ guardCall = guardCall.then(next);
+ guardCall.catch((err) => reject(err));
+ });
+}
+function extractComponentsGuards(matched, guardType, to, from) {
+ const guards = [];
+ for (const record of matched) {
+ for (const name in record.components) {
+ let rawComponent = record.components[name];
+ if (guardType !== "beforeRouteEnter" && !record.instances[name])
+ continue;
+ if (isRouteComponent(rawComponent)) {
+ const options = rawComponent.__vccOpts || rawComponent;
+ const guard = options[guardType];
+ guard && guards.push(guardToPromiseFn(guard, to, from, record, name));
+ } else {
+ let componentPromise = rawComponent();
+ guards.push(() => componentPromise.then((resolved) => {
+ if (!resolved)
+ return Promise.reject(new Error(`Couldn't resolve component "${name}" at "${record.path}"`));
+ const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
+ record.components[name] = resolvedComponent;
+ const options = resolvedComponent.__vccOpts || resolvedComponent;
+ const guard = options[guardType];
+ return guard && guardToPromiseFn(guard, to, from, record, name)();
+ }));
+ }
+ }
+ }
+ return guards;
+}
+function isRouteComponent(component) {
+ return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
+}
+function useLink(props2) {
+ const router2 = inject$1(routerKey);
+ const currentRoute = inject$1(routeLocationKey);
+ const route = computed(() => router2.resolve(unref(props2.to)));
+ const activeRecordIndex = computed(() => {
+ const { matched } = route.value;
+ const { length } = matched;
+ const routeMatched = matched[length - 1];
+ const currentMatched = currentRoute.matched;
+ if (!routeMatched || !currentMatched.length)
+ return -1;
+ const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
+ if (index > -1)
+ return index;
+ const parentRecordPath = getOriginalPath(matched[length - 2]);
+ return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index;
+ });
+ const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
+ const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
+ function navigate(e2 = {}) {
+ if (guardEvent(e2)) {
+ return router2[unref(props2.replace) ? "replace" : "push"](unref(props2.to)).catch(noop$1);
+ }
+ return Promise.resolve();
+ }
+ return {
+ route,
+ href: computed(() => route.value.href),
+ isActive,
+ isExactActive,
+ navigate
+ };
+}
+const RouterLinkImpl = /* @__PURE__ */ defineComponent({
+ name: "RouterLink",
+ compatConfig: { MODE: 3 },
+ props: {
+ to: {
+ type: [String, Object],
+ required: true
+ },
+ replace: Boolean,
+ activeClass: String,
+ exactActiveClass: String,
+ custom: Boolean,
+ ariaCurrentValue: {
+ type: String,
+ default: "page"
+ }
+ },
+ useLink,
+ setup(props2, { slots }) {
+ const link = reactive(useLink(props2));
+ const { options } = inject$1(routerKey);
+ const elClass = computed(() => ({
+ [getLinkClass(props2.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
+ [getLinkClass(props2.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
+ }));
+ return () => {
+ const children = slots.default && slots.default(link);
+ return props2.custom ? children : h$1("a", {
+ "aria-current": link.isExactActive ? props2.ariaCurrentValue : null,
+ href: link.href,
+ onClick: link.navigate,
+ class: elClass.value
+ }, children);
+ };
+ }
+});
+const RouterLink = RouterLinkImpl;
+function guardEvent(e2) {
+ if (e2.metaKey || e2.altKey || e2.ctrlKey || e2.shiftKey)
+ return;
+ if (e2.defaultPrevented)
+ return;
+ if (e2.button !== void 0 && e2.button !== 0)
+ return;
+ if (e2.currentTarget && e2.currentTarget.getAttribute) {
+ const target = e2.currentTarget.getAttribute("target");
+ if (/\b_blank\b/i.test(target))
+ return;
+ }
+ if (e2.preventDefault)
+ e2.preventDefault();
+ return true;
+}
+function includesParams(outer, inner) {
+ for (const key in inner) {
+ const innerValue = inner[key];
+ const outerValue = outer[key];
+ if (typeof innerValue === "string") {
+ if (innerValue !== outerValue)
+ return false;
+ } else {
+ if (!isArray$3(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value !== outerValue[i]))
+ return false;
+ }
+ }
+ return true;
+}
+function getOriginalPath(record) {
+ return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
+}
+const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
+const RouterViewImpl = /* @__PURE__ */ defineComponent({
+ name: "RouterView",
+ inheritAttrs: false,
+ props: {
+ name: {
+ type: String,
+ default: "default"
+ },
+ route: Object
+ },
+ compatConfig: { MODE: 3 },
+ setup(props2, { attrs, slots }) {
+ const injectedRoute = inject$1(routerViewLocationKey);
+ const routeToDisplay = computed(() => props2.route || injectedRoute.value);
+ const injectedDepth = inject$1(viewDepthKey, 0);
+ const depth = computed(() => {
+ let initialDepth = unref(injectedDepth);
+ const { matched } = routeToDisplay.value;
+ let matchedRoute;
+ while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) {
+ initialDepth++;
+ }
+ return initialDepth;
+ });
+ const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
+ provide(viewDepthKey, computed(() => depth.value + 1));
+ provide(matchedRouteKey, matchedRouteRef);
+ provide(routerViewLocationKey, routeToDisplay);
+ const viewRef = ref();
+ watch(() => [viewRef.value, matchedRouteRef.value, props2.name], ([instance, to, name], [oldInstance, from, oldName]) => {
+ if (to) {
+ to.instances[name] = instance;
+ if (from && from !== to && instance && instance === oldInstance) {
+ if (!to.leaveGuards.size) {
+ to.leaveGuards = from.leaveGuards;
+ }
+ if (!to.updateGuards.size) {
+ to.updateGuards = from.updateGuards;
+ }
+ }
+ }
+ if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance)) {
+ (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
+ }
+ }, { flush: "post" });
+ return () => {
+ const route = routeToDisplay.value;
+ const currentName = props2.name;
+ const matchedRoute = matchedRouteRef.value;
+ const ViewComponent = matchedRoute && matchedRoute.components[currentName];
+ if (!ViewComponent) {
+ return normalizeSlot(slots.default, { Component: ViewComponent, route });
+ }
+ const routePropsOption = matchedRoute.props[currentName];
+ const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
+ const onVnodeUnmounted = (vnode) => {
+ if (vnode.component.isUnmounted) {
+ matchedRoute.instances[currentName] = null;
+ }
+ };
+ const component = h$1(ViewComponent, assign$1({}, routeProps, attrs, {
+ onVnodeUnmounted,
+ ref: viewRef
+ }));
+ return normalizeSlot(slots.default, { Component: component, route }) || component;
+ };
+ }
+});
+function normalizeSlot(slot, data) {
+ if (!slot)
+ return null;
+ const slotContent = slot(data);
+ return slotContent.length === 1 ? slotContent[0] : slotContent;
+}
+const RouterView = RouterViewImpl;
+function createRouter(options) {
+ const matcher = createRouterMatcher(options.routes, options);
+ const parseQuery$12 = options.parseQuery || parseQuery$2;
+ const stringifyQuery$1$1 = options.stringifyQuery || stringifyQuery$1;
+ const routerHistory = options.history;
+ const beforeGuards = useCallbacks();
+ const beforeResolveGuards = useCallbacks();
+ const afterGuards = useCallbacks();
+ const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
+ let pendingLocation = START_LOCATION_NORMALIZED;
+ if (isBrowser && options.scrollBehavior && "scrollRestoration" in history) {
+ history.scrollRestoration = "manual";
+ }
+ const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
+ const encodeParams = applyToParams.bind(null, encodeParam);
+ const decodeParams = applyToParams.bind(null, decode$1);
+ function addRoute(parentOrRoute, route) {
+ let parent;
+ let record;
+ if (isRouteName(parentOrRoute)) {
+ parent = matcher.getRecordMatcher(parentOrRoute);
+ record = route;
+ } else {
+ record = parentOrRoute;
+ }
+ return matcher.addRoute(record, parent);
+ }
+ function removeRoute(name) {
+ const recordMatcher = matcher.getRecordMatcher(name);
+ if (recordMatcher) {
+ matcher.removeRoute(recordMatcher);
+ }
+ }
+ function getRoutes() {
+ return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
+ }
+ function hasRoute(name) {
+ return !!matcher.getRecordMatcher(name);
+ }
+ function resolve2(rawLocation, currentLocation) {
+ currentLocation = assign$1({}, currentLocation || currentRoute.value);
+ if (typeof rawLocation === "string") {
+ const locationNormalized = parseURL$1(parseQuery$12, rawLocation, currentLocation.path);
+ const matchedRoute2 = matcher.resolve({ path: locationNormalized.path }, currentLocation);
+ const href2 = routerHistory.createHref(locationNormalized.fullPath);
+ return assign$1(locationNormalized, matchedRoute2, {
+ params: decodeParams(matchedRoute2.params),
+ hash: decode$1(locationNormalized.hash),
+ redirectedFrom: void 0,
+ href: href2
+ });
+ }
+ let matcherLocation;
+ if ("path" in rawLocation) {
+ matcherLocation = assign$1({}, rawLocation, {
+ path: parseURL$1(parseQuery$12, rawLocation.path, currentLocation.path).path
+ });
+ } else {
+ const targetParams = assign$1({}, rawLocation.params);
+ for (const key in targetParams) {
+ if (targetParams[key] == null) {
+ delete targetParams[key];
+ }
+ }
+ matcherLocation = assign$1({}, rawLocation, {
+ params: encodeParams(targetParams)
+ });
+ currentLocation.params = encodeParams(currentLocation.params);
+ }
+ const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
+ const hash = rawLocation.hash || "";
+ matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
+ const fullPath = stringifyURL(stringifyQuery$1$1, assign$1({}, rawLocation, {
+ hash: encodeHash$1(hash),
+ path: matchedRoute.path
+ }));
+ const href = routerHistory.createHref(fullPath);
+ return assign$1({
+ fullPath,
+ hash,
+ query: stringifyQuery$1$1 === stringifyQuery$1 ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
+ }, matchedRoute, {
+ redirectedFrom: void 0,
+ href
+ });
+ }
+ function locationAsObject(to) {
+ return typeof to === "string" ? parseURL$1(parseQuery$12, to, currentRoute.value.path) : assign$1({}, to);
+ }
+ function checkCanceledNavigation(to, from) {
+ if (pendingLocation !== to) {
+ return createRouterError(8, {
+ from,
+ to
+ });
+ }
+ }
+ function push(to) {
+ return pushWithRedirect(to);
+ }
+ function replace(to) {
+ return push(assign$1(locationAsObject(to), { replace: true }));
+ }
+ function handleRedirectRecord(to) {
+ const lastMatched = to.matched[to.matched.length - 1];
+ if (lastMatched && lastMatched.redirect) {
+ const { redirect } = lastMatched;
+ let newTargetLocation = typeof redirect === "function" ? redirect(to) : redirect;
+ if (typeof newTargetLocation === "string") {
+ newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : { path: newTargetLocation };
+ newTargetLocation.params = {};
+ }
+ return assign$1({
+ query: to.query,
+ hash: to.hash,
+ params: "path" in newTargetLocation ? {} : to.params
+ }, newTargetLocation);
+ }
+ }
+ function pushWithRedirect(to, redirectedFrom) {
+ const targetLocation = pendingLocation = resolve2(to);
+ const from = currentRoute.value;
+ const data = to.state;
+ const force = to.force;
+ const replace2 = to.replace === true;
+ const shouldRedirect = handleRedirectRecord(targetLocation);
+ if (shouldRedirect)
+ return pushWithRedirect(assign$1(locationAsObject(shouldRedirect), {
+ state: typeof shouldRedirect === "object" ? assign$1({}, data, shouldRedirect.state) : data,
+ force,
+ replace: replace2
+ }), redirectedFrom || targetLocation);
+ const toLocation = targetLocation;
+ toLocation.redirectedFrom = redirectedFrom;
+ let failure;
+ if (!force && isSameRouteLocation(stringifyQuery$1$1, from, targetLocation)) {
+ failure = createRouterError(16, { to: toLocation, from });
+ handleScroll(from, from, true, false);
+ }
+ return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, 2) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure2) => {
+ if (failure2) {
+ if (isNavigationFailure(failure2, 2)) {
+ return pushWithRedirect(assign$1({
+ replace: replace2
+ }, locationAsObject(failure2.to), {
+ state: typeof failure2.to === "object" ? assign$1({}, data, failure2.to.state) : data,
+ force
+ }), redirectedFrom || toLocation);
+ }
+ } else {
+ failure2 = finalizeNavigation(toLocation, from, true, replace2, data);
+ }
+ triggerAfterEach(toLocation, from, failure2);
+ return failure2;
+ });
+ }
+ function checkCanceledNavigationAndReject(to, from) {
+ const error = checkCanceledNavigation(to, from);
+ return error ? Promise.reject(error) : Promise.resolve();
+ }
+ function runWithContext(fn) {
+ const app2 = installedApps.values().next().value;
+ return app2 && typeof app2.runWithContext === "function" ? app2.runWithContext(fn) : fn();
+ }
+ function navigate(to, from) {
+ let guards;
+ const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
+ guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
+ for (const record of leavingRecords) {
+ record.leaveGuards.forEach((guard) => {
+ guards.push(guardToPromiseFn(guard, to, from));
+ });
+ }
+ const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
+ guards.push(canceledNavigationCheck);
+ return runGuardQueue(guards).then(() => {
+ guards = [];
+ for (const guard of beforeGuards.list()) {
+ guards.push(guardToPromiseFn(guard, to, from));
+ }
+ guards.push(canceledNavigationCheck);
+ return runGuardQueue(guards);
+ }).then(() => {
+ guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
+ for (const record of updatingRecords) {
+ record.updateGuards.forEach((guard) => {
+ guards.push(guardToPromiseFn(guard, to, from));
+ });
+ }
+ guards.push(canceledNavigationCheck);
+ return runGuardQueue(guards);
+ }).then(() => {
+ guards = [];
+ for (const record of to.matched) {
+ if (record.beforeEnter && !from.matched.includes(record)) {
+ if (isArray$3(record.beforeEnter)) {
+ for (const beforeEnter of record.beforeEnter)
+ guards.push(guardToPromiseFn(beforeEnter, to, from));
+ } else {
+ guards.push(guardToPromiseFn(record.beforeEnter, to, from));
+ }
+ }
+ }
+ guards.push(canceledNavigationCheck);
+ return runGuardQueue(guards);
+ }).then(() => {
+ to.matched.forEach((record) => record.enterCallbacks = {});
+ guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from);
+ guards.push(canceledNavigationCheck);
+ return runGuardQueue(guards);
+ }).then(() => {
+ guards = [];
+ for (const guard of beforeResolveGuards.list()) {
+ guards.push(guardToPromiseFn(guard, to, from));
+ }
+ guards.push(canceledNavigationCheck);
+ return runGuardQueue(guards);
+ }).catch((err) => isNavigationFailure(err, 8) ? err : Promise.reject(err));
+ }
+ function triggerAfterEach(to, from, failure) {
+ for (const guard of afterGuards.list()) {
+ runWithContext(() => guard(to, from, failure));
+ }
+ }
+ function finalizeNavigation(toLocation, from, isPush, replace2, data) {
+ const error = checkCanceledNavigation(toLocation, from);
+ if (error)
+ return error;
+ const isFirstNavigation = from === START_LOCATION_NORMALIZED;
+ const state = !isBrowser ? {} : history.state;
+ if (isPush) {
+ if (replace2 || isFirstNavigation)
+ routerHistory.replace(toLocation.fullPath, assign$1({
+ scroll: isFirstNavigation && state && state.scroll
+ }, data));
+ else
+ routerHistory.push(toLocation.fullPath, data);
+ }
+ currentRoute.value = toLocation;
+ handleScroll(toLocation, from, isPush, isFirstNavigation);
+ markAsReady();
+ }
+ let removeHistoryListener;
+ function setupListeners() {
+ if (removeHistoryListener)
+ return;
+ removeHistoryListener = routerHistory.listen((to, _from, info) => {
+ if (!router2.listening)
+ return;
+ const toLocation = resolve2(to);
+ const shouldRedirect = handleRedirectRecord(toLocation);
+ if (shouldRedirect) {
+ pushWithRedirect(assign$1(shouldRedirect, { replace: true }), toLocation).catch(noop$1);
+ return;
+ }
+ pendingLocation = toLocation;
+ const from = currentRoute.value;
+ if (isBrowser) {
+ saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
+ }
+ navigate(toLocation, from).catch((error) => {
+ if (isNavigationFailure(error, 4 | 8)) {
+ return error;
+ }
+ if (isNavigationFailure(error, 2)) {
+ pushWithRedirect(error.to, toLocation).then((failure) => {
+ if (isNavigationFailure(failure, 4 | 16) && !info.delta && info.type === NavigationType.pop) {
+ routerHistory.go(-1, false);
+ }
+ }).catch(noop$1);
+ return Promise.reject();
+ }
+ if (info.delta) {
+ routerHistory.go(-info.delta, false);
+ }
+ return triggerError(error, toLocation, from);
+ }).then((failure) => {
+ failure = failure || finalizeNavigation(toLocation, from, false);
+ if (failure) {
+ if (info.delta && !isNavigationFailure(failure, 8)) {
+ routerHistory.go(-info.delta, false);
+ } else if (info.type === NavigationType.pop && isNavigationFailure(failure, 4 | 16)) {
+ routerHistory.go(-1, false);
+ }
+ }
+ triggerAfterEach(toLocation, from, failure);
+ }).catch(noop$1);
+ });
+ }
+ let readyHandlers = useCallbacks();
+ let errorHandlers = useCallbacks();
+ let ready;
+ function triggerError(error, to, from) {
+ markAsReady(error);
+ const list = errorHandlers.list();
+ if (list.length) {
+ list.forEach((handler) => handler(error, to, from));
+ } else {
+ console.error(error);
+ }
+ return Promise.reject(error);
+ }
+ function isReady() {
+ if (ready && currentRoute.value !== START_LOCATION_NORMALIZED)
+ return Promise.resolve();
+ return new Promise((resolve3, reject) => {
+ readyHandlers.add([resolve3, reject]);
+ });
+ }
+ function markAsReady(err) {
+ if (!ready) {
+ ready = !err;
+ setupListeners();
+ readyHandlers.list().forEach(([resolve3, reject]) => err ? reject(err) : resolve3());
+ readyHandlers.reset();
+ }
+ return err;
+ }
+ function handleScroll(to, from, isPush, isFirstNavigation) {
+ const { scrollBehavior } = options;
+ if (!isBrowser || !scrollBehavior)
+ return Promise.resolve();
+ const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
+ return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
+ }
+ const go = (delta) => routerHistory.go(delta);
+ let started;
+ const installedApps = /* @__PURE__ */ new Set();
+ const router2 = {
+ currentRoute,
+ listening: true,
+ addRoute,
+ removeRoute,
+ hasRoute,
+ getRoutes,
+ resolve: resolve2,
+ options,
+ push,
+ replace,
+ go,
+ back: () => go(-1),
+ forward: () => go(1),
+ beforeEach: beforeGuards.add,
+ beforeResolve: beforeResolveGuards.add,
+ afterEach: afterGuards.add,
+ onError: errorHandlers.add,
+ isReady,
+ install(app2) {
+ const router3 = this;
+ app2.component("RouterLink", RouterLink);
+ app2.component("RouterView", RouterView);
+ app2.config.globalProperties.$router = router3;
+ Object.defineProperty(app2.config.globalProperties, "$route", {
+ enumerable: true,
+ get: () => unref(currentRoute)
+ });
+ if (isBrowser && !started && currentRoute.value === START_LOCATION_NORMALIZED) {
+ started = true;
+ push(routerHistory.location).catch((err) => {
+ });
+ }
+ const reactiveRoute = {};
+ for (const key in START_LOCATION_NORMALIZED) {
+ reactiveRoute[key] = computed(() => currentRoute.value[key]);
+ }
+ app2.provide(routerKey, router3);
+ app2.provide(routeLocationKey, reactive(reactiveRoute));
+ app2.provide(routerViewLocationKey, currentRoute);
+ const unmountApp = app2.unmount;
+ installedApps.add(app2);
+ app2.unmount = function() {
+ installedApps.delete(app2);
+ if (installedApps.size < 1) {
+ pendingLocation = START_LOCATION_NORMALIZED;
+ removeHistoryListener && removeHistoryListener();
+ removeHistoryListener = null;
+ currentRoute.value = START_LOCATION_NORMALIZED;
+ started = false;
+ ready = false;
+ }
+ unmountApp();
+ };
+ }
+ };
+ function runGuardQueue(guards) {
+ return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
+ }
+ return router2;
+}
+function extractChangingRecords(to, from) {
+ const leavingRecords = [];
+ const updatingRecords = [];
+ const enteringRecords = [];
+ const len = Math.max(from.matched.length, to.matched.length);
+ for (let i = 0; i < len; i++) {
+ const recordFrom = from.matched[i];
+ if (recordFrom) {
+ if (to.matched.find((record) => isSameRouteRecord(record, recordFrom)))
+ updatingRecords.push(recordFrom);
+ else
+ leavingRecords.push(recordFrom);
+ }
+ const recordTo = to.matched[i];
+ if (recordTo) {
+ if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) {
+ enteringRecords.push(recordTo);
+ }
+ }
+ }
+ return [leavingRecords, updatingRecords, enteringRecords];
+}
+const scriptRel = "modulepreload";
+const seen = {};
+const base = "/omnidash/feat/major-revamp/";
+const __vitePreload = function preload(baseModule, deps) {
+ if (!deps || deps.length === 0) {
+ return baseModule();
+ }
+ return Promise.all(deps.map((dep) => {
+ dep = `${base}${dep}`;
+ if (dep in seen)
+ return;
+ seen[dep] = true;
+ const isCss = dep.endsWith(".css");
+ const cssSelector = isCss ? '[rel="stylesheet"]' : "";
+ if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
+ return;
+ }
+ const link = document.createElement("link");
+ link.rel = isCss ? "stylesheet" : scriptRel;
+ if (!isCss) {
+ link.as = "script";
+ link.crossOrigin = "";
+ }
+ link.href = dep;
+ document.head.appendChild(link);
+ if (isCss) {
+ return new Promise((res, rej) => {
+ link.addEventListener("load", res);
+ link.addEventListener("error", () => rej(new Error(`Unable to preload CSS for ${dep}`)));
+ });
+ }
+ })).then(() => baseModule());
+};
+function u$4(r2, n2, ...a2) {
+ if (r2 in n2) {
+ let e2 = n2[r2];
+ return typeof e2 == "function" ? e2(...a2) : e2;
+ }
+ let t2 = new Error(`Tried to handle "${r2}" but there is no handler defined. Only defined handlers are: ${Object.keys(n2).map((e2) => `"${e2}"`).join(", ")}.`);
+ throw Error.captureStackTrace && Error.captureStackTrace(t2, u$4), t2;
+}
+var N$3 = ((o2) => (o2[o2.None = 0] = "None", o2[o2.RenderStrategy = 1] = "RenderStrategy", o2[o2.Static = 2] = "Static", o2))(N$3 || {}), S$2 = ((e2) => (e2[e2.Unmount = 0] = "Unmount", e2[e2.Hidden = 1] = "Hidden", e2))(S$2 || {});
+function H$2(_a2) {
+ var _b2 = _a2, { visible: r2 = true, features: t2 = 0, ourProps: e2, theirProps: o2 } = _b2, i = __objRest(_b2, ["visible", "features", "ourProps", "theirProps"]);
+ var a2;
+ let n2 = j$2(o2, e2), l2 = Object.assign(i, { props: n2 });
+ if (r2 || t2 & 2 && n2.static)
+ return y$2(l2);
+ if (t2 & 1) {
+ let d2 = (a2 = n2.unmount) == null || a2 ? 0 : 1;
+ return u$4(d2, { [0]() {
+ return null;
+ }, [1]() {
+ return y$2(__spreadProps(__spreadValues({}, i), { props: __spreadProps(__spreadValues({}, n2), { hidden: true, style: { display: "none" } }) }));
+ } });
+ }
+ return y$2(l2);
+}
+function y$2({ props: r2, attrs: t2, slots: e2, slot: o2, name: i }) {
+ var m2, h2;
+ let _a2 = T$1(r2, ["unmount", "static"]), { as: n2 } = _a2, l2 = __objRest(_a2, ["as"]), a2 = (m2 = e2.default) == null ? void 0 : m2.call(e2, o2), d2 = {};
+ if (o2) {
+ let u2 = false, c2 = [];
+ for (let [p2, f2] of Object.entries(o2))
+ typeof f2 == "boolean" && (u2 = true), f2 === true && c2.push(p2);
+ u2 && (d2["data-headlessui-state"] = c2.join(" "));
+ }
+ if (n2 === "template") {
+ if (a2 = b$2(a2 != null ? a2 : []), Object.keys(l2).length > 0 || Object.keys(t2).length > 0) {
+ let [u2, ...c2] = a2 != null ? a2 : [];
+ if (!v$1(u2) || c2.length > 0)
+ throw new Error(['Passing props on "template"!', "", `The current component <${i} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(l2).concat(Object.keys(t2)).map((s2) => s2.trim()).filter((s2, g2, R2) => R2.indexOf(s2) === g2).sort((s2, g2) => s2.localeCompare(g2)).map((s2) => ` - ${s2}`).join(`
+`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((s2) => ` - ${s2}`).join(`
+`)].join(`
+`));
+ let p2 = j$2((h2 = u2.props) != null ? h2 : {}, l2), f2 = cloneVNode(u2, p2);
+ for (let s2 in p2)
+ s2.startsWith("on") && (f2.props || (f2.props = {}), f2.props[s2] = p2[s2]);
+ return f2;
+ }
+ return Array.isArray(a2) && a2.length === 1 ? a2[0] : a2;
+ }
+ return h$1(n2, Object.assign({}, l2, d2), { default: () => a2 });
+}
+function b$2(r2) {
+ return r2.flatMap((t2) => t2.type === Fragment ? b$2(t2.children) : [t2]);
+}
+function j$2(...r2) {
+ if (r2.length === 0)
+ return {};
+ if (r2.length === 1)
+ return r2[0];
+ let t2 = {}, e2 = {};
+ for (let i of r2)
+ for (let n2 in i)
+ n2.startsWith("on") && typeof i[n2] == "function" ? (e2[n2] != null || (e2[n2] = []), e2[n2].push(i[n2])) : t2[n2] = i[n2];
+ if (t2.disabled || t2["aria-disabled"])
+ return Object.assign(t2, Object.fromEntries(Object.keys(e2).map((i) => [i, void 0])));
+ for (let i in e2)
+ Object.assign(t2, { [i](n2, ...l2) {
+ let a2 = e2[i];
+ for (let d2 of a2) {
+ if (n2 instanceof Event && n2.defaultPrevented)
+ return;
+ d2(n2, ...l2);
+ }
+ } });
+ return t2;
+}
+function T$1(r2, t2 = []) {
+ let e2 = Object.assign({}, r2);
+ for (let o2 of t2)
+ o2 in e2 && delete e2[o2];
+ return e2;
+}
+function v$1(r2) {
+ return r2 == null ? false : typeof r2.type == "string" || typeof r2.type == "object" || typeof r2.type == "function";
+}
+let e$2 = 0;
+function n$4() {
+ return ++e$2;
+}
+function t$5() {
+ return n$4();
+}
+var o$2 = ((r2) => (r2.Space = " ", r2.Enter = "Enter", r2.Escape = "Escape", r2.Backspace = "Backspace", r2.Delete = "Delete", r2.ArrowLeft = "ArrowLeft", r2.ArrowUp = "ArrowUp", r2.ArrowRight = "ArrowRight", r2.ArrowDown = "ArrowDown", r2.Home = "Home", r2.End = "End", r2.PageUp = "PageUp", r2.PageDown = "PageDown", r2.Tab = "Tab", r2))(o$2 || {});
+function o$1(n2) {
+ var l2;
+ return n2 == null || n2.value == null ? null : (l2 = n2.value.$el) != null ? l2 : n2.value;
+}
+let n$3 = Symbol("Context");
+var l$2 = ((e2) => (e2[e2.Open = 1] = "Open", e2[e2.Closed = 2] = "Closed", e2[e2.Closing = 4] = "Closing", e2[e2.Opening = 8] = "Opening", e2))(l$2 || {});
+function C() {
+ return p$3() !== null;
+}
+function p$3() {
+ return inject$1(n$3, null);
+}
+function c$5(o2) {
+ provide(n$3, o2);
+}
+function r$2(t2, e2) {
+ if (t2)
+ return t2;
+ let n2 = e2 != null ? e2 : "button";
+ if (typeof n2 == "string" && n2.toLowerCase() === "button")
+ return "button";
+}
+function b$1(t2, e2) {
+ let n2 = ref(r$2(t2.value.type, t2.value.as));
+ return onMounted(() => {
+ n2.value = r$2(t2.value.type, t2.value.as);
+ }), watchEffect(() => {
+ var o2;
+ n2.value || o$1(e2) && o$1(e2) instanceof HTMLButtonElement && !((o2 = o$1(e2)) != null && o2.hasAttribute("type")) && (n2.value = "button");
+ }), n2;
+}
+var i$2 = Object.defineProperty;
+var d$4 = (t2, e2, r2) => e2 in t2 ? i$2(t2, e2, { enumerable: true, configurable: true, writable: true, value: r2 }) : t2[e2] = r2;
+var n$2 = (t2, e2, r2) => (d$4(t2, typeof e2 != "symbol" ? e2 + "" : e2, r2), r2);
+class s$1 {
+ constructor() {
+ n$2(this, "current", this.detect());
+ n$2(this, "currentId", 0);
+ }
+ set(e2) {
+ this.current !== e2 && (this.currentId = 0, this.current = e2);
+ }
+ reset() {
+ this.set(this.detect());
+ }
+ nextId() {
+ return ++this.currentId;
+ }
+ get isServer() {
+ return this.current === "server";
+ }
+ get isClient() {
+ return this.current === "client";
+ }
+ detect() {
+ return typeof window == "undefined" || typeof document == "undefined" ? "server" : "client";
+ }
+}
+let c$4 = new s$1();
+function m$3(r2) {
+ if (c$4.isServer)
+ return null;
+ if (r2 instanceof Node)
+ return r2.ownerDocument;
+ if (r2 != null && r2.hasOwnProperty("value")) {
+ let n2 = o$1(r2);
+ if (n2)
+ return n2.ownerDocument;
+ }
+ return document;
+}
+let c$3 = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e2) => `${e2}:not([tabindex='-1'])`).join(",");
+var N$2 = ((n2) => (n2[n2.First = 1] = "First", n2[n2.Previous = 2] = "Previous", n2[n2.Next = 4] = "Next", n2[n2.Last = 8] = "Last", n2[n2.WrapAround = 16] = "WrapAround", n2[n2.NoScroll = 32] = "NoScroll", n2))(N$2 || {}), T = ((o2) => (o2[o2.Error = 0] = "Error", o2[o2.Overflow = 1] = "Overflow", o2[o2.Success = 2] = "Success", o2[o2.Underflow = 3] = "Underflow", o2))(T || {}), F$1 = ((t2) => (t2[t2.Previous = -1] = "Previous", t2[t2.Next = 1] = "Next", t2))(F$1 || {});
+function E$4(e2 = document.body) {
+ return e2 == null ? [] : Array.from(e2.querySelectorAll(c$3)).sort((r2, t2) => Math.sign((r2.tabIndex || Number.MAX_SAFE_INTEGER) - (t2.tabIndex || Number.MAX_SAFE_INTEGER)));
+}
+var h = ((t2) => (t2[t2.Strict = 0] = "Strict", t2[t2.Loose = 1] = "Loose", t2))(h || {});
+function w$1(e2, r2 = 0) {
+ var t2;
+ return e2 === ((t2 = m$3(e2)) == null ? void 0 : t2.body) ? false : u$4(r2, { [0]() {
+ return e2.matches(c$3);
+ }, [1]() {
+ let l2 = e2;
+ for (; l2 !== null; ) {
+ if (l2.matches(c$3))
+ return true;
+ l2 = l2.parentElement;
+ }
+ return false;
+ } });
+}
+var y$1 = ((t2) => (t2[t2.Keyboard = 0] = "Keyboard", t2[t2.Mouse = 1] = "Mouse", t2))(y$1 || {});
+typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("keydown", (e2) => {
+ e2.metaKey || e2.altKey || e2.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
+}, true), document.addEventListener("click", (e2) => {
+ e2.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e2.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
+}, true));
+function S$1(e2) {
+ e2 == null || e2.focus({ preventScroll: true });
+}
+let H$1 = ["textarea", "input"].join(",");
+function I$1(e2) {
+ var r2, t2;
+ return (t2 = (r2 = e2 == null ? void 0 : e2.matches) == null ? void 0 : r2.call(e2, H$1)) != null ? t2 : false;
+}
+function O(e2, r2 = (t2) => t2) {
+ return e2.slice().sort((t2, l2) => {
+ let o2 = r2(t2), i = r2(l2);
+ if (o2 === null || i === null)
+ return 0;
+ let n2 = o2.compareDocumentPosition(i);
+ return n2 & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n2 & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
+ });
+}
+function P$1(e2, r2, { sorted: t2 = true, relativeTo: l2 = null, skipElements: o2 = [] } = {}) {
+ var m2;
+ let i = (m2 = Array.isArray(e2) ? e2.length > 0 ? e2[0].ownerDocument : document : e2 == null ? void 0 : e2.ownerDocument) != null ? m2 : document, n2 = Array.isArray(e2) ? t2 ? O(e2) : e2 : E$4(e2);
+ o2.length > 0 && n2.length > 1 && (n2 = n2.filter((s2) => !o2.includes(s2))), l2 = l2 != null ? l2 : i.activeElement;
+ let x = (() => {
+ if (r2 & 5)
+ return 1;
+ if (r2 & 10)
+ return -1;
+ throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
+ })(), p2 = (() => {
+ if (r2 & 1)
+ return 0;
+ if (r2 & 2)
+ return Math.max(0, n2.indexOf(l2)) - 1;
+ if (r2 & 4)
+ return Math.max(0, n2.indexOf(l2)) + 1;
+ if (r2 & 8)
+ return n2.length - 1;
+ throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
+ })(), L2 = r2 & 32 ? { preventScroll: true } : {}, a2 = 0, d2 = n2.length, u2;
+ do {
+ if (a2 >= d2 || a2 + d2 <= 0)
+ return 0;
+ let s2 = p2 + a2;
+ if (r2 & 16)
+ s2 = (s2 + d2) % d2;
+ else {
+ if (s2 < 0)
+ return 3;
+ if (s2 >= d2)
+ return 1;
+ }
+ u2 = n2[s2], u2 == null || u2.focus(L2), a2 += x;
+ } while (u2 !== i.activeElement);
+ return r2 & 6 && I$1(u2) && u2.select(), 2;
+}
+function u$3(e2, t2, n2) {
+ c$4.isServer || watchEffect((o2) => {
+ document.addEventListener(e2, t2, n2), o2(() => document.removeEventListener(e2, t2, n2));
+ });
+}
+function y(f2, m2, i = computed(() => true)) {
+ function a2(e2, u2) {
+ if (!i.value || e2.defaultPrevented)
+ return;
+ let n2 = u2(e2);
+ if (n2 === null || !n2.getRootNode().contains(n2))
+ return;
+ let c2 = function o2(t2) {
+ return typeof t2 == "function" ? o2(t2()) : Array.isArray(t2) || t2 instanceof Set ? t2 : [t2];
+ }(f2);
+ for (let o2 of c2) {
+ if (o2 === null)
+ continue;
+ let t2 = o2 instanceof HTMLElement ? o2 : o$1(o2);
+ if (t2 != null && t2.contains(n2) || e2.composed && e2.composedPath().includes(t2))
+ return;
+ }
+ return !w$1(n2, h.Loose) && n2.tabIndex !== -1 && e2.preventDefault(), m2(e2, n2);
+ }
+ let r2 = ref(null);
+ u$3("mousedown", (e2) => {
+ var u2, n2;
+ i.value && (r2.value = ((n2 = (u2 = e2.composedPath) == null ? void 0 : u2.call(e2)) == null ? void 0 : n2[0]) || e2.target);
+ }, true), u$3("click", (e2) => {
+ r2.value && (a2(e2, () => r2.value), r2.value = null);
+ }, true), u$3("blur", (e2) => a2(e2, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), true);
+}
+var a$2 = ((e2) => (e2[e2.None = 1] = "None", e2[e2.Focusable = 2] = "Focusable", e2[e2.Hidden = 4] = "Hidden", e2))(a$2 || {});
+let f = defineComponent({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(r2, { slots: t2, attrs: d2 }) {
+ return () => {
+ let _a2 = r2, { features: e2 } = _a2, o2 = __objRest(_a2, ["features"]), n2 = { "aria-hidden": (e2 & 2) === 2 ? true : void 0, style: __spreadValues({ position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" }, (e2 & 4) === 4 && (e2 & 2) !== 2 && { display: "none" }) };
+ return H$2({ ourProps: n2, theirProps: o2, slot: {}, attrs: d2, slots: t2, name: "Hidden" });
+ };
+} });
+function t$4() {
+ return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
+}
+function w(e2, n2, t2) {
+ c$4.isServer || watchEffect((o2) => {
+ window.addEventListener(e2, n2, t2), o2(() => window.removeEventListener(e2, n2, t2));
+ });
+}
+var d$3 = ((r2) => (r2[r2.Forwards = 0] = "Forwards", r2[r2.Backwards = 1] = "Backwards", r2))(d$3 || {});
+function n$1() {
+ let o2 = ref(0);
+ return w("keydown", (e2) => {
+ e2.key === "Tab" && (o2.value = e2.shiftKey ? 1 : 0);
+ }), o2;
+}
+function E$3(n2, e2, o2, r2) {
+ c$4.isServer || watchEffect((t2) => {
+ n2 = n2 != null ? n2 : window, n2.addEventListener(e2, o2, r2), t2(() => n2.removeEventListener(e2, o2, r2));
+ });
+}
+function t$3(e2) {
+ typeof queueMicrotask == "function" ? queueMicrotask(e2) : Promise.resolve().then(e2).catch((o2) => setTimeout(() => {
+ throw o2;
+ }));
+}
+function t$2(n2) {
+ function e2() {
+ document.readyState !== "loading" && (n2(), document.removeEventListener("DOMContentLoaded", e2));
+ }
+ typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("DOMContentLoaded", e2), e2());
+}
+function B$1(e2) {
+ if (!e2)
+ return /* @__PURE__ */ new Set();
+ if (typeof e2 == "function")
+ return new Set(e2());
+ let t2 = /* @__PURE__ */ new Set();
+ for (let l2 of e2.value) {
+ let o2 = o$1(l2);
+ o2 instanceof HTMLElement && t2.add(o2);
+ }
+ return t2;
+}
+var A = ((n2) => (n2[n2.None = 1] = "None", n2[n2.InitialFocus = 2] = "InitialFocus", n2[n2.TabLock = 4] = "TabLock", n2[n2.FocusLock = 8] = "FocusLock", n2[n2.RestoreFocus = 16] = "RestoreFocus", n2[n2.All = 30] = "All", n2))(A || {});
+let ce$2 = Object.assign(defineComponent({ name: "FocusTrap", props: { as: { type: [Object, String], default: "div" }, initialFocus: { type: Object, default: null }, features: { type: Number, default: 30 }, containers: { type: [Object, Function], default: ref(/* @__PURE__ */ new Set()) } }, inheritAttrs: false, setup(e2, { attrs: t2, slots: l2, expose: o2 }) {
+ let r2 = ref(null);
+ o2({ el: r2, $el: r2 });
+ let i = computed(() => m$3(r2)), n2 = ref(false);
+ onMounted(() => n2.value = true), onUnmounted(() => n2.value = false), z({ ownerDocument: i }, computed(() => n2.value && Boolean(e2.features & 16)));
+ let m2 = J({ ownerDocument: i, container: r2, initialFocus: computed(() => e2.initialFocus) }, computed(() => n2.value && Boolean(e2.features & 2)));
+ Q$2({ ownerDocument: i, container: r2, containers: e2.containers, previousActiveElement: m2 }, computed(() => n2.value && Boolean(e2.features & 8)));
+ let c2 = n$1();
+ function u2(a2) {
+ let d2 = o$1(r2);
+ if (!d2)
+ return;
+ ((g2) => g2())(() => {
+ u$4(c2.value, { [d$3.Forwards]: () => {
+ P$1(d2, N$2.First, { skipElements: [a2.relatedTarget] });
+ }, [d$3.Backwards]: () => {
+ P$1(d2, N$2.Last, { skipElements: [a2.relatedTarget] });
+ } });
+ });
+ }
+ let s2 = ref(false);
+ function H2(a2) {
+ a2.key === "Tab" && (s2.value = true, requestAnimationFrame(() => {
+ s2.value = false;
+ }));
+ }
+ function M2(a2) {
+ if (!n2.value)
+ return;
+ let d2 = B$1(e2.containers);
+ o$1(r2) instanceof HTMLElement && d2.add(o$1(r2));
+ let E2 = a2.relatedTarget;
+ E2 instanceof HTMLElement && E2.dataset.headlessuiFocusGuard !== "true" && (N$1(d2, E2) || (s2.value ? P$1(o$1(r2), u$4(c2.value, { [d$3.Forwards]: () => N$2.Next, [d$3.Backwards]: () => N$2.Previous }) | N$2.WrapAround, { relativeTo: a2.target }) : a2.target instanceof HTMLElement && S$1(a2.target)));
+ }
+ return () => {
+ let a2 = {}, d2 = { ref: r2, onKeydown: H2, onFocusout: M2 }, _a2 = e2, { features: E2, initialFocus: g2, containers: X2 } = _a2, O2 = __objRest(_a2, ["features", "initialFocus", "containers"]);
+ return h$1(Fragment, [Boolean(E2 & 4) && h$1(f, { as: "button", type: "button", "data-headlessui-focus-guard": true, onFocus: u2, features: a$2.Focusable }), H$2({ ourProps: d2, theirProps: __spreadValues(__spreadValues({}, t2), O2), slot: a2, attrs: t2, slots: l2, name: "FocusTrap" }), Boolean(E2 & 4) && h$1(f, { as: "button", type: "button", "data-headlessui-focus-guard": true, onFocus: u2, features: a$2.Focusable })]);
+ };
+} }), { features: A }), L$3 = [];
+t$2(() => {
+ function e2(t2) {
+ t2.target instanceof HTMLElement && t2.target !== document.body && L$3[0] !== t2.target && (L$3.unshift(t2.target), L$3 = L$3.filter((l2) => l2 != null && l2.isConnected), L$3.splice(10));
+ }
+ window.addEventListener("click", e2, { capture: true }), window.addEventListener("mousedown", e2, { capture: true }), window.addEventListener("focus", e2, { capture: true }), document.body.addEventListener("click", e2, { capture: true }), document.body.addEventListener("mousedown", e2, { capture: true }), document.body.addEventListener("focus", e2, { capture: true });
+});
+function x$2(e2) {
+ let t2 = ref(L$3.slice());
+ return watch([e2], ([l2], [o2]) => {
+ o2 === true && l2 === false ? t$3(() => {
+ t2.value.splice(0);
+ }) : o2 === false && l2 === true && (t2.value = L$3.slice());
+ }, { flush: "post" }), () => {
+ var l2;
+ return (l2 = t2.value.find((o2) => o2 != null && o2.isConnected)) != null ? l2 : null;
+ };
+}
+function z({ ownerDocument: e2 }, t2) {
+ let l2 = x$2(t2);
+ onMounted(() => {
+ watchEffect(() => {
+ var o2, r2;
+ t2.value || ((o2 = e2.value) == null ? void 0 : o2.activeElement) === ((r2 = e2.value) == null ? void 0 : r2.body) && S$1(l2());
+ }, { flush: "post" });
+ }), onUnmounted(() => {
+ S$1(l2());
+ });
+}
+function J({ ownerDocument: e2, container: t2, initialFocus: l2 }, o2) {
+ let r2 = ref(null), i = ref(false);
+ return onMounted(() => i.value = true), onUnmounted(() => i.value = false), onMounted(() => {
+ watch([t2, l2, o2], (n2, m2) => {
+ if (n2.every((u2, s2) => (m2 == null ? void 0 : m2[s2]) === u2) || !o2.value)
+ return;
+ let c2 = o$1(t2);
+ c2 && t$3(() => {
+ var H2, M2;
+ if (!i.value)
+ return;
+ let u2 = o$1(l2), s2 = (H2 = e2.value) == null ? void 0 : H2.activeElement;
+ if (u2) {
+ if (u2 === s2) {
+ r2.value = s2;
+ return;
+ }
+ } else if (c2.contains(s2)) {
+ r2.value = s2;
+ return;
+ }
+ u2 ? S$1(u2) : P$1(c2, N$2.First | N$2.NoScroll) === T.Error && console.warn("There are no focusable elements inside the "), r2.value = (M2 = e2.value) == null ? void 0 : M2.activeElement;
+ });
+ }, { immediate: true, flush: "post" });
+ }), r2;
+}
+function Q$2({ ownerDocument: e2, container: t2, containers: l2, previousActiveElement: o2 }, r2) {
+ var i;
+ E$3((i = e2.value) == null ? void 0 : i.defaultView, "focus", (n2) => {
+ if (!r2.value)
+ return;
+ let m2 = B$1(l2);
+ o$1(t2) instanceof HTMLElement && m2.add(o$1(t2));
+ let c2 = o2.value;
+ if (!c2)
+ return;
+ let u2 = n2.target;
+ u2 && u2 instanceof HTMLElement ? N$1(m2, u2) ? (o2.value = u2, S$1(u2)) : (n2.preventDefault(), n2.stopPropagation(), S$1(c2)) : S$1(o2.value);
+ }, true);
+}
+function N$1(e2, t2) {
+ for (let l2 of e2)
+ if (l2.contains(t2))
+ return true;
+ return false;
+}
+let i$1 = /* @__PURE__ */ new Map(), t$1 = /* @__PURE__ */ new Map();
+function E$2(d2, f2 = ref(true)) {
+ watchEffect((o2) => {
+ var a2;
+ if (!f2.value)
+ return;
+ let e2 = o$1(d2);
+ if (!e2)
+ return;
+ o2(function() {
+ var u2;
+ if (!e2)
+ return;
+ let r2 = (u2 = t$1.get(e2)) != null ? u2 : 1;
+ if (r2 === 1 ? t$1.delete(e2) : t$1.set(e2, r2 - 1), r2 !== 1)
+ return;
+ let n2 = i$1.get(e2);
+ n2 && (n2["aria-hidden"] === null ? e2.removeAttribute("aria-hidden") : e2.setAttribute("aria-hidden", n2["aria-hidden"]), e2.inert = n2.inert, i$1.delete(e2));
+ });
+ let l2 = (a2 = t$1.get(e2)) != null ? a2 : 0;
+ t$1.set(e2, l2 + 1), l2 === 0 && (i$1.set(e2, { "aria-hidden": e2.getAttribute("aria-hidden"), inert: e2.inert }), e2.setAttribute("aria-hidden", "true"), e2.inert = true);
+ });
+}
+let e$1 = Symbol("ForcePortalRootContext");
+function u$2() {
+ return inject$1(e$1, false);
+}
+let P = defineComponent({ name: "ForcePortalRoot", props: { as: { type: [Object, String], default: "template" }, force: { type: Boolean, default: false } }, setup(o2, { slots: t2, attrs: r2 }) {
+ return provide(e$1, o2.force), () => {
+ let _a2 = o2, { force: f2 } = _a2, n2 = __objRest(_a2, ["force"]);
+ return H$2({ theirProps: n2, ourProps: {}, slot: {}, slots: t2, attrs: r2, name: "ForcePortalRoot" });
+ };
+} });
+function c$2(t2) {
+ let r2 = m$3(t2);
+ if (!r2) {
+ if (t2 === null)
+ return null;
+ throw new Error(`[Headless UI]: Cannot find ownerDocument for contextElement: ${t2}`);
+ }
+ let o2 = r2.getElementById("headlessui-portal-root");
+ if (o2)
+ return o2;
+ let e2 = r2.createElement("div");
+ return e2.setAttribute("id", "headlessui-portal-root"), r2.body.appendChild(e2);
+}
+let R$1 = defineComponent({ name: "Portal", props: { as: { type: [Object, String], default: "div" } }, setup(t2, { slots: r2, attrs: o2 }) {
+ let e2 = ref(null), p2 = computed(() => m$3(e2)), n2 = u$2(), u2 = inject$1(g$3, null), l2 = ref(n2 === true || u2 == null ? c$2(e2.value) : u2.resolveTarget());
+ return watchEffect(() => {
+ n2 || u2 != null && (l2.value = u2.resolveTarget());
+ }), onUnmounted(() => {
+ var i, m2;
+ let a2 = (i = p2.value) == null ? void 0 : i.getElementById("headlessui-portal-root");
+ a2 && l2.value === a2 && l2.value.children.length <= 0 && ((m2 = l2.value.parentElement) == null || m2.removeChild(l2.value));
+ }), () => {
+ if (l2.value === null)
+ return null;
+ let a2 = { ref: e2, "data-headlessui-portal": "" };
+ return h$1(Teleport, { to: l2.value }, H$2({ ourProps: a2, theirProps: t2, slot: {}, attrs: o2, slots: r2, name: "Portal" }));
+ };
+} }), g$3 = Symbol("PortalGroupContext"), L$2 = defineComponent({ name: "PortalGroup", props: { as: { type: [Object, String], default: "template" }, target: { type: Object, default: null } }, setup(t2, { attrs: r2, slots: o2 }) {
+ let e2 = reactive({ resolveTarget() {
+ return t2.target;
+ } });
+ return provide(g$3, e2), () => {
+ let _a2 = t2, { target: p2 } = _a2, n2 = __objRest(_a2, ["target"]);
+ return H$2({ theirProps: n2, ourProps: {}, slot: {}, attrs: r2, slots: o2, name: "PortalGroup" });
+ };
+} });
+let u$1 = Symbol("StackContext");
+var p$2 = ((e2) => (e2[e2.Add = 0] = "Add", e2[e2.Remove = 1] = "Remove", e2))(p$2 || {});
+function v() {
+ return inject$1(u$1, () => {
+ });
+}
+function S({ type: o2, enabled: r2, element: e2, onUpdate: i }) {
+ let a2 = v();
+ function t2(...n2) {
+ i == null || i(...n2), a2(...n2);
+ }
+ onMounted(() => {
+ watch(r2, (n2, d2) => {
+ n2 ? t2(0, o2, e2) : d2 === true && t2(1, o2, e2);
+ }, { immediate: true, flush: "sync" });
+ }), onUnmounted(() => {
+ r2.value && t2(1, o2, e2);
+ }), provide(u$1, t2);
+}
+let p$1 = Symbol("DescriptionContext");
+function b() {
+ let t2 = inject$1(p$1, null);
+ if (t2 === null)
+ throw new Error("Missing parent");
+ return t2;
+}
+function M({ slot: t2 = ref({}), name: i = "Description", props: o2 = {} } = {}) {
+ let e2 = ref([]);
+ function s2(n2) {
+ return e2.value.push(n2), () => {
+ let r2 = e2.value.indexOf(n2);
+ r2 !== -1 && e2.value.splice(r2, 1);
+ };
+ }
+ return provide(p$1, { register: s2, slot: t2, name: i, props: o2 }), computed(() => e2.value.length > 0 ? e2.value.join(" ") : void 0);
+}
+let E$1 = defineComponent({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: () => `headlessui-description-${t$5()}` } }, setup(t2, { attrs: i, slots: o2 }) {
+ let e2 = b();
+ return onMounted(() => onUnmounted(e2.register(t2.id))), () => {
+ let { name: s2 = "Description", slot: n2 = ref({}), props: r2 = {} } = e2, _a2 = t2, { id: d2 } = _a2, l2 = __objRest(_a2, ["id"]), c2 = __spreadProps(__spreadValues({}, Object.entries(r2).reduce((f2, [a2, g2]) => Object.assign(f2, { [a2]: unref(g2) }), {})), { id: d2 });
+ return H$2({ ourProps: c2, theirProps: l2, slot: n2.value, attrs: i, slots: o2, name: s2 });
+ };
+} });
+function m$2(t2) {
+ let e2 = shallowRef(t2.getSnapshot());
+ return onUnmounted(t2.subscribe(() => {
+ e2.value = t2.getSnapshot();
+ })), e2;
+}
+function r$1() {
+ let n2 = [], s2 = { addEventListener(e2, t2, i, a2) {
+ return e2.addEventListener(t2, i, a2), s2.add(() => e2.removeEventListener(t2, i, a2));
+ }, requestAnimationFrame(...e2) {
+ let t2 = requestAnimationFrame(...e2);
+ s2.add(() => cancelAnimationFrame(t2));
+ }, nextFrame(...e2) {
+ s2.requestAnimationFrame(() => {
+ s2.requestAnimationFrame(...e2);
+ });
+ }, setTimeout(...e2) {
+ let t2 = setTimeout(...e2);
+ s2.add(() => clearTimeout(t2));
+ }, style(e2, t2, i) {
+ let a2 = e2.style.getPropertyValue(t2);
+ return Object.assign(e2.style, { [t2]: i }), this.add(() => {
+ Object.assign(e2.style, { [t2]: a2 });
+ });
+ }, group(e2) {
+ let t2 = r$1();
+ return e2(t2), this.add(() => t2.dispose());
+ }, add(e2) {
+ return n2.push(e2), () => {
+ let t2 = n2.indexOf(e2);
+ if (t2 >= 0)
+ for (let i of n2.splice(t2, 1))
+ i();
+ };
+ }, dispose() {
+ for (let e2 of n2.splice(0))
+ e2();
+ } };
+ return s2;
+}
+function a$1(o2, r2) {
+ let t2 = o2(), n2 = /* @__PURE__ */ new Set();
+ return { getSnapshot() {
+ return t2;
+ }, subscribe(e2) {
+ return n2.add(e2), () => n2.delete(e2);
+ }, dispatch(e2, ...s2) {
+ let i = r2[e2].call(t2, ...s2);
+ i && (t2 = i, n2.forEach((c2) => c2()));
+ } };
+}
+function c$1() {
+ let o2;
+ return { before({ doc: e2 }) {
+ var l2;
+ let n2 = e2.documentElement;
+ o2 = ((l2 = e2.defaultView) != null ? l2 : window).innerWidth - n2.clientWidth;
+ }, after({ doc: e2, d: n2 }) {
+ let t2 = e2.documentElement, l2 = t2.clientWidth - t2.offsetWidth, r2 = o2 - l2;
+ n2.style(t2, "paddingRight", `${r2}px`);
+ } };
+}
+function p() {
+ if (!t$4())
+ return {};
+ let o2;
+ return { before() {
+ o2 = window.pageYOffset;
+ }, after({ doc: r2, d: l2, meta: s2 }) {
+ function i(e2) {
+ return s2.containers.flatMap((t2) => t2()).some((t2) => t2.contains(e2));
+ }
+ l2.style(r2.body, "marginTop", `-${o2}px`), window.scrollTo(0, 0);
+ let n2 = null;
+ l2.addEventListener(r2, "click", (e2) => {
+ if (e2.target instanceof HTMLElement)
+ try {
+ let t2 = e2.target.closest("a");
+ if (!t2)
+ return;
+ let { hash: c2 } = new URL(t2.href), a2 = r2.querySelector(c2);
+ a2 && !i(a2) && (n2 = a2);
+ } catch {
+ }
+ }, true), l2.addEventListener(r2, "touchmove", (e2) => {
+ e2.target instanceof HTMLElement && !i(e2.target) && e2.preventDefault();
+ }, { passive: false }), l2.add(() => {
+ window.scrollTo(0, window.pageYOffset + o2), n2 && n2.isConnected && (n2.scrollIntoView({ block: "nearest" }), n2 = null);
+ });
+ } };
+}
+function l$1() {
+ return { before({ doc: e2, d: o2 }) {
+ o2.style(e2.documentElement, "overflow", "hidden");
+ } };
+}
+function m$1(e2) {
+ let n2 = {};
+ for (let t2 of e2)
+ Object.assign(n2, t2(n2));
+ return n2;
+}
+let a = a$1(() => /* @__PURE__ */ new Map(), { PUSH(e2, n2) {
+ var o2;
+ let t2 = (o2 = this.get(e2)) != null ? o2 : { doc: e2, count: 0, d: r$1(), meta: /* @__PURE__ */ new Set() };
+ return t2.count++, t2.meta.add(n2), this.set(e2, t2), this;
+}, POP(e2, n2) {
+ let t2 = this.get(e2);
+ return t2 && (t2.count--, t2.meta.delete(n2)), this;
+}, SCROLL_PREVENT({ doc: e2, d: n2, meta: t2 }) {
+ let o2 = { doc: e2, d: n2, meta: m$1(t2) }, c2 = [p(), c$1(), l$1()];
+ c2.forEach(({ before: r2 }) => r2 == null ? void 0 : r2(o2)), c2.forEach(({ after: r2 }) => r2 == null ? void 0 : r2(o2));
+}, SCROLL_ALLOW({ d: e2 }) {
+ e2.dispose();
+}, TEARDOWN({ doc: e2 }) {
+ this.delete(e2);
+} });
+a.subscribe(() => {
+ let e2 = a.getSnapshot(), n2 = /* @__PURE__ */ new Map();
+ for (let [t2] of e2)
+ n2.set(t2, t2.documentElement.style.overflow);
+ for (let t2 of e2.values()) {
+ let o2 = n2.get(t2.doc) === "hidden", c2 = t2.count !== 0;
+ (c2 && !o2 || !c2 && o2) && a.dispatch(t2.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", t2), t2.count === 0 && a.dispatch("TEARDOWN", t2);
+ }
+});
+function d$2(t2, a$12, n2) {
+ let i = m$2(a), l2 = computed(() => {
+ let e2 = t2.value ? i.value.get(t2.value) : void 0;
+ return e2 ? e2.count > 0 : false;
+ });
+ return watch([t2, a$12], ([e2, m2], [r2], o2) => {
+ if (!e2 || !m2)
+ return;
+ a.dispatch("PUSH", e2, n2);
+ let f2 = false;
+ o2(() => {
+ f2 || (a.dispatch("POP", r2 != null ? r2 : e2, n2), f2 = true);
+ });
+ }, { immediate: true }), l2;
+}
+var ye$1 = ((l2) => (l2[l2.Open = 0] = "Open", l2[l2.Closed = 1] = "Closed", l2))(ye$1 || {});
+let I = Symbol("DialogContext");
+function E(r2) {
+ let n2 = inject$1(I, null);
+ if (n2 === null) {
+ let l2 = new Error(`<${r2} /> is missing a parent component.`);
+ throw Error.captureStackTrace && Error.captureStackTrace(l2, E), l2;
+ }
+ return n2;
+}
+let H = "DC8F892D-2EBD-447C-A4C8-A03058436FF4", qe = defineComponent({ name: "Dialog", inheritAttrs: false, props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, open: { type: [Boolean, String], default: H }, initialFocus: { type: Object, default: null }, id: { type: String, default: () => `headlessui-dialog-${t$5()}` } }, emits: { close: (r2) => true }, setup(r2, { emit: n2, attrs: l2, slots: p2, expose: i }) {
+ var N2;
+ let a2 = ref(false);
+ onMounted(() => {
+ a2.value = true;
+ });
+ let f$1 = ref(0), d2 = p$3(), m2 = computed(() => r2.open === H && d2 !== null ? (d2.value & l$2.Open) === l$2.Open : r2.open), v2 = ref(null), R2 = ref(null), O2 = computed(() => m$3(v2));
+ if (i({ el: v2, $el: v2 }), !(r2.open !== H || d2 !== null))
+ throw new Error("You forgot to provide an `open` prop to the `Dialog`.");
+ if (typeof m2.value != "boolean")
+ throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${m2.value === H ? void 0 : r2.open}`);
+ let c2 = computed(() => a2.value && m2.value ? 0 : 1), k2 = computed(() => c2.value === 0), w2 = computed(() => f$1.value > 1), $2 = inject$1(I, null) !== null, G = computed(() => w2.value ? "parent" : "leaf"), j2 = computed(() => d2 !== null ? (d2.value & l$2.Closing) === l$2.Closing : false), V2 = computed(() => $2 || j2.value ? false : k2.value), J2 = computed(() => {
+ var e2, t2, u2;
+ return (u2 = Array.from((t2 = (e2 = O2.value) == null ? void 0 : e2.querySelectorAll("body > *")) != null ? t2 : []).find((s2) => s2.id === "headlessui-portal-root" ? false : s2.contains(o$1(R2)) && s2 instanceof HTMLElement)) != null ? u2 : null;
+ });
+ E$2(J2, V2);
+ let Q2 = computed(() => w2.value ? true : k2.value), W2 = computed(() => {
+ var e2, t2, u2;
+ return (u2 = Array.from((t2 = (e2 = O2.value) == null ? void 0 : e2.querySelectorAll("[data-headlessui-portal]")) != null ? t2 : []).find((s2) => s2.contains(o$1(R2)) && s2 instanceof HTMLElement)) != null ? u2 : null;
+ });
+ E$2(W2, Q2), S({ type: "Dialog", enabled: computed(() => c2.value === 0), element: v2, onUpdate: (e2, t2) => {
+ if (t2 === "Dialog")
+ return u$4(e2, { [p$2.Add]: () => f$1.value += 1, [p$2.Remove]: () => f$1.value -= 1 });
+ } });
+ let X2 = M({ name: "DialogDescription", slot: computed(() => ({ open: m2.value })) }), M$1 = ref(null), y$12 = { titleId: M$1, panelRef: ref(null), dialogState: c2, setTitleId(e2) {
+ M$1.value !== e2 && (M$1.value = e2);
+ }, close() {
+ n2("close", false);
+ } };
+ provide(I, y$12);
+ function x() {
+ var t2, u2, s2;
+ return [...Array.from((u2 = (t2 = O2.value) == null ? void 0 : t2.querySelectorAll("html > *, body > *, [data-headlessui-portal]")) != null ? u2 : []).filter((g2) => !(g2 === document.body || g2 === document.head || !(g2 instanceof HTMLElement) || g2.contains(o$1(R2)) || y$12.panelRef.value && g2.contains(y$12.panelRef.value))), (s2 = y$12.panelRef.value) != null ? s2 : v2.value];
+ }
+ let Z = computed(() => !(!k2.value || w2.value));
+ y(() => x(), (e2, t2) => {
+ y$12.close(), nextTick(() => t2 == null ? void 0 : t2.focus());
+ }, Z);
+ let ee = computed(() => !(w2.value || c2.value !== 0));
+ E$3((N2 = O2.value) == null ? void 0 : N2.defaultView, "keydown", (e2) => {
+ ee.value && (e2.defaultPrevented || e2.key === o$2.Escape && (e2.preventDefault(), e2.stopPropagation(), y$12.close()));
+ });
+ let te2 = computed(() => !(j2.value || c2.value !== 0 || $2));
+ return d$2(O2, te2, (e2) => {
+ var t2;
+ return { containers: [...(t2 = e2.containers) != null ? t2 : [], x] };
+ }), watchEffect((e2) => {
+ if (c2.value !== 0)
+ return;
+ let t2 = o$1(v2);
+ if (!t2)
+ return;
+ let u2 = new ResizeObserver((s2) => {
+ for (let g2 of s2) {
+ let h2 = g2.target.getBoundingClientRect();
+ h2.x === 0 && h2.y === 0 && h2.width === 0 && h2.height === 0 && y$12.close();
+ }
+ });
+ u2.observe(t2), e2(() => u2.disconnect());
+ }), () => {
+ let _a2 = r2, { id: e2, open: t2, initialFocus: u2 } = _a2, s2 = __objRest(_a2, ["id", "open", "initialFocus"]), g2 = __spreadProps(__spreadValues({}, l2), { ref: v2, id: e2, role: "dialog", "aria-modal": c2.value === 0 ? true : void 0, "aria-labelledby": M$1.value, "aria-describedby": X2.value }), h2 = { open: c2.value === 0 };
+ return h$1(P, { force: true }, () => [h$1(R$1, () => h$1(L$2, { target: v2.value }, () => h$1(P, { force: false }, () => h$1(ce$2, { initialFocus: u2, containers: x, features: k2.value ? u$4(G.value, { parent: ce$2.features.RestoreFocus, leaf: ce$2.features.All & ~ce$2.features.FocusLock }) : ce$2.features.None }, () => H$2({ ourProps: g2, theirProps: s2, slot: h2, attrs: l2, slots: p2, visible: c2.value === 0, features: N$3.RenderStrategy | N$3.Static, name: "Dialog" }))))), h$1(f, { features: a$2.Hidden, ref: R2 })]);
+ };
+} }), Ke = defineComponent({ name: "DialogOverlay", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: () => `headlessui-dialog-overlay-${t$5()}` } }, setup(r2, { attrs: n2, slots: l2 }) {
+ let p2 = E("DialogOverlay");
+ function i(a2) {
+ a2.target === a2.currentTarget && (a2.preventDefault(), a2.stopPropagation(), p2.close());
+ }
+ return () => {
+ let _a2 = r2, { id: a2 } = _a2, f2 = __objRest(_a2, ["id"]);
+ return H$2({ ourProps: { id: a2, "aria-hidden": true, onClick: i }, theirProps: f2, slot: { open: p2.dialogState.value === 0 }, attrs: n2, slots: l2, name: "DialogOverlay" });
+ };
+} });
+defineComponent({ name: "DialogBackdrop", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: () => `headlessui-dialog-backdrop-${t$5()}` } }, inheritAttrs: false, setup(r2, { attrs: n2, slots: l2, expose: p2 }) {
+ let i = E("DialogBackdrop"), a2 = ref(null);
+ return p2({ el: a2, $el: a2 }), onMounted(() => {
+ if (i.panelRef.value === null)
+ throw new Error("A component is being used, but a component is missing.");
+ }), () => {
+ let _a2 = r2, { id: f2 } = _a2, d2 = __objRest(_a2, ["id"]), m2 = { id: f2, ref: a2, "aria-hidden": true };
+ return h$1(P, { force: true }, () => h$1(R$1, () => H$2({ ourProps: m2, theirProps: __spreadValues(__spreadValues({}, n2), d2), slot: { open: i.dialogState.value === 0 }, attrs: n2, slots: l2, name: "DialogBackdrop" })));
+ };
+} });
+defineComponent({ name: "DialogPanel", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: () => `headlessui-dialog-panel-${t$5()}` } }, setup(r2, { attrs: n2, slots: l2, expose: p2 }) {
+ let i = E("DialogPanel");
+ p2({ el: i.panelRef, $el: i.panelRef });
+ function a2(f2) {
+ f2.stopPropagation();
+ }
+ return () => {
+ let _a2 = r2, { id: f2 } = _a2, d2 = __objRest(_a2, ["id"]), m2 = { id: f2, ref: i.panelRef, onClick: a2 };
+ return H$2({ ourProps: m2, theirProps: d2, slot: { open: i.dialogState.value === 0 }, attrs: n2, slots: l2, name: "DialogPanel" });
+ };
+} });
+defineComponent({ name: "DialogTitle", props: { as: { type: [Object, String], default: "h2" }, id: { type: String, default: () => `headlessui-dialog-title-${t$5()}` } }, setup(r2, { attrs: n2, slots: l2 }) {
+ let p2 = E("DialogTitle");
+ return onMounted(() => {
+ p2.setTitleId(r2.id), onUnmounted(() => p2.setTitleId(null));
+ }), () => {
+ let _a2 = r2, { id: i } = _a2, a2 = __objRest(_a2, ["id"]);
+ return H$2({ ourProps: { id: i }, theirProps: a2, slot: { open: p2.dialogState.value === 0 }, attrs: n2, slots: l2, name: "DialogTitle" });
+ };
+} });
+E$1;
+var j$1 = ((o2) => (o2[o2.Open = 0] = "Open", o2[o2.Closed = 1] = "Closed", o2))(j$1 || {});
+let x$1 = Symbol("DisclosureContext");
+function g$2(t2) {
+ let r2 = inject$1(x$1, null);
+ if (r2 === null) {
+ let o2 = new Error(`<${t2} /> is missing a parent component.`);
+ throw Error.captureStackTrace && Error.captureStackTrace(o2, g$2), o2;
+ }
+ return r2;
+}
+let B = Symbol("DisclosurePanelContext");
+function $() {
+ return inject$1(B, null);
+}
+let Q$1 = defineComponent({ name: "Disclosure", props: { as: { type: [Object, String], default: "template" }, defaultOpen: { type: [Boolean], default: false } }, setup(t2, { slots: r2, attrs: o2 }) {
+ let u2 = ref(t2.defaultOpen ? 0 : 1), e2 = ref(null), i = ref(null), s2 = { buttonId: ref(null), panelId: ref(null), disclosureState: u2, panel: e2, button: i, toggleDisclosure() {
+ u2.value = u$4(u2.value, { [0]: 1, [1]: 0 });
+ }, closeDisclosure() {
+ u2.value !== 1 && (u2.value = 1);
+ }, close(l2) {
+ s2.closeDisclosure();
+ let a2 = (() => l2 ? l2 instanceof HTMLElement ? l2 : l2.value instanceof HTMLElement ? o$1(l2) : o$1(s2.button) : o$1(s2.button))();
+ a2 == null || a2.focus();
+ } };
+ return provide(x$1, s2), c$5(computed(() => u$4(u2.value, { [0]: l$2.Open, [1]: l$2.Closed }))), () => {
+ let _a2 = t2, { defaultOpen: l2 } = _a2, a2 = __objRest(_a2, ["defaultOpen"]), c2 = { open: u2.value === 0, close: s2.close };
+ return H$2({ theirProps: a2, ourProps: {}, slot: c2, slots: r2, attrs: o2, name: "Disclosure" });
+ };
+} }), V = defineComponent({ name: "DisclosureButton", props: { as: { type: [Object, String], default: "button" }, disabled: { type: [Boolean], default: false }, id: { type: String, default: () => `headlessui-disclosure-button-${t$5()}` } }, setup(t2, { attrs: r2, slots: o2, expose: u2 }) {
+ let e2 = g$2("DisclosureButton");
+ onMounted(() => {
+ e2.buttonId.value = t2.id;
+ }), onUnmounted(() => {
+ e2.buttonId.value = null;
+ });
+ let i = $(), s2 = computed(() => i === null ? false : i.value === e2.panelId.value), l2 = ref(null);
+ u2({ el: l2, $el: l2 }), s2.value || watchEffect(() => {
+ e2.button.value = l2.value;
+ });
+ let a2 = b$1(computed(() => ({ as: t2.as, type: r2.type })), l2);
+ function c2() {
+ var n2;
+ t2.disabled || (s2.value ? (e2.toggleDisclosure(), (n2 = o$1(e2.button)) == null || n2.focus()) : e2.toggleDisclosure());
+ }
+ function D(n2) {
+ var S2;
+ if (!t2.disabled)
+ if (s2.value)
+ switch (n2.key) {
+ case o$2.Space:
+ case o$2.Enter:
+ n2.preventDefault(), n2.stopPropagation(), e2.toggleDisclosure(), (S2 = o$1(e2.button)) == null || S2.focus();
+ break;
+ }
+ else
+ switch (n2.key) {
+ case o$2.Space:
+ case o$2.Enter:
+ n2.preventDefault(), n2.stopPropagation(), e2.toggleDisclosure();
+ break;
+ }
+ }
+ function T2(n2) {
+ switch (n2.key) {
+ case o$2.Space:
+ n2.preventDefault();
+ break;
+ }
+ }
+ return () => {
+ let n2 = { open: e2.disclosureState.value === 0 }, _a2 = t2, { id: S2 } = _a2, k2 = __objRest(_a2, ["id"]), K = s2.value ? { ref: l2, type: a2.value, onClick: c2, onKeydown: D } : { id: S2, ref: l2, type: a2.value, "aria-expanded": t2.disabled ? void 0 : e2.disclosureState.value === 0, "aria-controls": o$1(e2.panel) ? e2.panelId.value : void 0, disabled: t2.disabled ? true : void 0, onClick: c2, onKeydown: D, onKeyup: T2 };
+ return H$2({ ourProps: K, theirProps: k2, slot: n2, attrs: r2, slots: o2, name: "DisclosureButton" });
+ };
+} }), X = defineComponent({ name: "DisclosurePanel", props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, id: { type: String, default: () => `headlessui-disclosure-panel-${t$5()}` } }, setup(t2, { attrs: r2, slots: o2, expose: u2 }) {
+ let e2 = g$2("DisclosurePanel");
+ onMounted(() => {
+ e2.panelId.value = t2.id;
+ }), onUnmounted(() => {
+ e2.panelId.value = null;
+ }), u2({ el: e2.panel, $el: e2.panel }), provide(B, e2.panelId);
+ let i = p$3(), s2 = computed(() => i !== null ? (i.value & l$2.Open) === l$2.Open : e2.disclosureState.value === 0);
+ return () => {
+ let l2 = { open: e2.disclosureState.value === 0, close: e2.close }, _a2 = t2, { id: a2 } = _a2, c2 = __objRest(_a2, ["id"]), D = { id: a2, ref: e2.panel };
+ return H$2({ ourProps: D, theirProps: c2, slot: l2, attrs: r2, slots: o2, features: N$3.RenderStrategy | N$3.Static, visible: s2.value, name: "DisclosurePanel" });
+ };
+} });
+var ce$1 = ((p2) => (p2[p2.Open = 0] = "Open", p2[p2.Closed = 1] = "Closed", p2))(ce$1 || {});
+let te$2 = Symbol("PopoverContext");
+function W$1(c2) {
+ let m2 = inject$1(te$2, null);
+ if (m2 === null) {
+ let p2 = new Error(`<${c2} /> is missing a parent <${Pe.name} /> component.`);
+ throw Error.captureStackTrace && Error.captureStackTrace(p2, W$1), p2;
+ }
+ return m2;
+}
+let oe = Symbol("PopoverGroupContext");
+function ne() {
+ return inject$1(oe, null);
+}
+let le$1 = Symbol("PopoverPanelContext");
+function de() {
+ return inject$1(le$1, null);
+}
+let Pe = defineComponent({ name: "Popover", props: { as: { type: [Object, String], default: "div" } }, setup(c2, { slots: m2, attrs: p2, expose: y$12 }) {
+ var n2;
+ let o2 = ref(null);
+ y$12({ el: o2, $el: o2 });
+ let e2 = ref(1), f2 = ref(null), d2 = ref(null), I2 = ref(null), s2 = ref(null), b3 = computed(() => m$3(o2)), P2 = computed(() => {
+ var h2, D;
+ if (!o$1(f2) || !o$1(s2))
+ return false;
+ for (let w2 of document.querySelectorAll("body > *"))
+ if (Number(w2 == null ? void 0 : w2.contains(o$1(f2))) ^ Number(w2 == null ? void 0 : w2.contains(o$1(s2))))
+ return true;
+ let t2 = E$4(), r2 = t2.indexOf(o$1(f2)), u2 = (r2 + t2.length - 1) % t2.length, v2 = (r2 + 1) % t2.length, S2 = t2[u2], $2 = t2[v2];
+ return !((h2 = o$1(s2)) != null && h2.contains(S2)) && !((D = o$1(s2)) != null && D.contains($2));
+ }), a2 = { popoverState: e2, buttonId: ref(null), panelId: ref(null), panel: s2, button: f2, isPortalled: P2, beforePanelSentinel: d2, afterPanelSentinel: I2, togglePopover() {
+ e2.value = u$4(e2.value, { [0]: 1, [1]: 0 });
+ }, closePopover() {
+ e2.value !== 1 && (e2.value = 1);
+ }, close(t2) {
+ a2.closePopover();
+ let r2 = (() => t2 ? t2 instanceof HTMLElement ? t2 : t2.value instanceof HTMLElement ? o$1(t2) : o$1(a2.button) : o$1(a2.button))();
+ r2 == null || r2.focus();
+ } };
+ provide(te$2, a2), c$5(computed(() => u$4(e2.value, { [0]: l$2.Open, [1]: l$2.Closed })));
+ let F2 = { buttonId: a2.buttonId, panelId: a2.panelId, close() {
+ a2.closePopover();
+ } }, g2 = ne(), E2 = g2 == null ? void 0 : g2.registerPopover;
+ function i() {
+ var t2, r2, u2, v2;
+ return (v2 = g2 == null ? void 0 : g2.isFocusWithinPopoverGroup()) != null ? v2 : ((t2 = b3.value) == null ? void 0 : t2.activeElement) && (((r2 = o$1(f2)) == null ? void 0 : r2.contains(b3.value.activeElement)) || ((u2 = o$1(s2)) == null ? void 0 : u2.contains(b3.value.activeElement)));
+ }
+ return watchEffect(() => E2 == null ? void 0 : E2(F2)), E$3((n2 = b3.value) == null ? void 0 : n2.defaultView, "focus", (t2) => {
+ var r2, u2;
+ e2.value === 0 && (i() || f2 && s2 && t2.target !== window && ((r2 = o$1(a2.beforePanelSentinel)) != null && r2.contains(t2.target) || (u2 = o$1(a2.afterPanelSentinel)) != null && u2.contains(t2.target) || a2.closePopover()));
+ }, true), y([f2, s2], (t2, r2) => {
+ var u2;
+ a2.closePopover(), w$1(r2, h.Loose) || (t2.preventDefault(), (u2 = o$1(f2)) == null || u2.focus());
+ }, computed(() => e2.value === 0)), () => {
+ let t2 = { open: e2.value === 0, close: a2.close };
+ return H$2({ theirProps: c2, ourProps: { ref: o2 }, slot: t2, slots: m2, attrs: p2, name: "Popover" });
+ };
+} }), Be = defineComponent({ name: "PopoverButton", props: { as: { type: [Object, String], default: "button" }, disabled: { type: [Boolean], default: false }, id: { type: String, default: () => `headlessui-popover-button-${t$5()}` } }, inheritAttrs: false, setup(c2, { attrs: m2, slots: p2, expose: y2 }) {
+ let o2 = W$1("PopoverButton"), e2 = computed(() => m$3(o2.button));
+ y2({ el: o2.button, $el: o2.button }), onMounted(() => {
+ o2.buttonId.value = c2.id;
+ }), onUnmounted(() => {
+ o2.buttonId.value = null;
+ });
+ let f$1 = ne(), d2 = f$1 == null ? void 0 : f$1.closeOthers, I2 = de(), s2 = computed(() => I2 === null ? false : I2.value === o2.panelId.value), b3 = ref(null), P2 = `headlessui-focus-sentinel-${t$5()}`;
+ s2.value || watchEffect(() => {
+ o2.button.value = b3.value;
+ });
+ let a2 = b$1(computed(() => ({ as: c2.as, type: m2.type })), b3);
+ function F2(n2) {
+ var t2, r2, u2, v2, S2;
+ if (s2.value) {
+ if (o2.popoverState.value === 1)
+ return;
+ switch (n2.key) {
+ case o$2.Space:
+ case o$2.Enter:
+ n2.preventDefault(), (r2 = (t2 = n2.target).click) == null || r2.call(t2), o2.closePopover(), (u2 = o$1(o2.button)) == null || u2.focus();
+ break;
+ }
+ } else
+ switch (n2.key) {
+ case o$2.Space:
+ case o$2.Enter:
+ n2.preventDefault(), n2.stopPropagation(), o2.popoverState.value === 1 && (d2 == null || d2(o2.buttonId.value)), o2.togglePopover();
+ break;
+ case o$2.Escape:
+ if (o2.popoverState.value !== 0)
+ return d2 == null ? void 0 : d2(o2.buttonId.value);
+ if (!o$1(o2.button) || (v2 = e2.value) != null && v2.activeElement && !((S2 = o$1(o2.button)) != null && S2.contains(e2.value.activeElement)))
+ return;
+ n2.preventDefault(), n2.stopPropagation(), o2.closePopover();
+ break;
+ }
+ }
+ function g2(n2) {
+ s2.value || n2.key === o$2.Space && n2.preventDefault();
+ }
+ function E2(n2) {
+ var t2, r2;
+ c2.disabled || (s2.value ? (o2.closePopover(), (t2 = o$1(o2.button)) == null || t2.focus()) : (n2.preventDefault(), n2.stopPropagation(), o2.popoverState.value === 1 && (d2 == null || d2(o2.buttonId.value)), o2.togglePopover(), (r2 = o$1(o2.button)) == null || r2.focus()));
+ }
+ function i(n2) {
+ n2.preventDefault(), n2.stopPropagation();
+ }
+ return () => {
+ let n2 = o2.popoverState.value === 0, t2 = { open: n2 }, _a2 = c2, { id: r2 } = _a2, u2 = __objRest(_a2, ["id"]), v2 = s2.value ? { ref: b3, type: a2.value, onKeydown: F2, onClick: E2 } : { ref: b3, id: r2, type: a2.value, "aria-expanded": c2.disabled ? void 0 : o2.popoverState.value === 0, "aria-controls": o$1(o2.panel) ? o2.panelId.value : void 0, disabled: c2.disabled ? true : void 0, onKeydown: F2, onKeyup: g2, onClick: E2, onMousedown: i }, S2 = n$1();
+ function $2() {
+ let h2 = o$1(o2.panel);
+ if (!h2)
+ return;
+ function D() {
+ u$4(S2.value, { [d$3.Forwards]: () => P$1(h2, N$2.First), [d$3.Backwards]: () => P$1(h2, N$2.Last) }) === T.Error && P$1(E$4().filter((re) => re.dataset.headlessuiFocusGuard !== "true"), u$4(S2.value, { [d$3.Forwards]: N$2.Next, [d$3.Backwards]: N$2.Previous }), { relativeTo: o$1(o2.button) });
+ }
+ D();
+ }
+ return h$1(Fragment, [H$2({ ourProps: v2, theirProps: __spreadValues(__spreadValues({}, m2), u2), slot: t2, attrs: m2, slots: p2, name: "PopoverButton" }), n2 && !s2.value && o2.isPortalled.value && h$1(f, { id: P2, features: a$2.Focusable, "data-headlessui-focus-guard": true, as: "button", type: "button", onFocus: $2 })]);
+ };
+} });
+defineComponent({ name: "PopoverOverlay", props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true } }, setup(c2, { attrs: m2, slots: p2 }) {
+ let y2 = W$1("PopoverOverlay"), o2 = `headlessui-popover-overlay-${t$5()}`, e2 = p$3(), f2 = computed(() => e2 !== null ? (e2.value & l$2.Open) === l$2.Open : y2.popoverState.value === 0);
+ function d2() {
+ y2.closePopover();
+ }
+ return () => {
+ let I2 = { open: y2.popoverState.value === 0 };
+ return H$2({ ourProps: { id: o2, "aria-hidden": true, onClick: d2 }, theirProps: c2, slot: I2, attrs: m2, slots: p2, features: N$3.RenderStrategy | N$3.Static, visible: f2.value, name: "PopoverOverlay" });
+ };
+} });
+let He = defineComponent({ name: "PopoverPanel", props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, focus: { type: Boolean, default: false }, id: { type: String, default: () => `headlessui-popover-panel-${t$5()}` } }, inheritAttrs: false, setup(c2, { attrs: m2, slots: p2, expose: y2 }) {
+ let { focus: o2 } = c2, e2 = W$1("PopoverPanel"), f$1 = computed(() => m$3(e2.panel)), d2 = `headlessui-focus-sentinel-before-${t$5()}`, I2 = `headlessui-focus-sentinel-after-${t$5()}`;
+ y2({ el: e2.panel, $el: e2.panel }), onMounted(() => {
+ e2.panelId.value = c2.id;
+ }), onUnmounted(() => {
+ e2.panelId.value = null;
+ }), provide(le$1, e2.panelId), watchEffect(() => {
+ var n2, t2;
+ if (!o2 || e2.popoverState.value !== 0 || !e2.panel)
+ return;
+ let i = (n2 = f$1.value) == null ? void 0 : n2.activeElement;
+ (t2 = o$1(e2.panel)) != null && t2.contains(i) || P$1(o$1(e2.panel), N$2.First);
+ });
+ let s2 = p$3(), b3 = computed(() => s2 !== null ? (s2.value & l$2.Open) === l$2.Open : e2.popoverState.value === 0);
+ function P2(i) {
+ var n2, t2;
+ switch (i.key) {
+ case o$2.Escape:
+ if (e2.popoverState.value !== 0 || !o$1(e2.panel) || f$1.value && !((n2 = o$1(e2.panel)) != null && n2.contains(f$1.value.activeElement)))
+ return;
+ i.preventDefault(), i.stopPropagation(), e2.closePopover(), (t2 = o$1(e2.button)) == null || t2.focus();
+ break;
+ }
+ }
+ function a2(i) {
+ var t2, r2, u2, v2, S2;
+ let n2 = i.relatedTarget;
+ n2 && o$1(e2.panel) && ((t2 = o$1(e2.panel)) != null && t2.contains(n2) || (e2.closePopover(), ((u2 = (r2 = o$1(e2.beforePanelSentinel)) == null ? void 0 : r2.contains) != null && u2.call(r2, n2) || (S2 = (v2 = o$1(e2.afterPanelSentinel)) == null ? void 0 : v2.contains) != null && S2.call(v2, n2)) && n2.focus({ preventScroll: true })));
+ }
+ let F2 = n$1();
+ function g2() {
+ let i = o$1(e2.panel);
+ if (!i)
+ return;
+ function n2() {
+ u$4(F2.value, { [d$3.Forwards]: () => {
+ var r2;
+ P$1(i, N$2.First) === T.Error && ((r2 = o$1(e2.afterPanelSentinel)) == null || r2.focus());
+ }, [d$3.Backwards]: () => {
+ var t2;
+ (t2 = o$1(e2.button)) == null || t2.focus({ preventScroll: true });
+ } });
+ }
+ n2();
+ }
+ function E2() {
+ let i = o$1(e2.panel);
+ if (!i)
+ return;
+ function n2() {
+ u$4(F2.value, { [d$3.Forwards]: () => {
+ let t2 = o$1(e2.button), r2 = o$1(e2.panel);
+ if (!t2)
+ return;
+ let u2 = E$4(), v2 = u2.indexOf(t2), S2 = u2.slice(0, v2 + 1), h2 = [...u2.slice(v2 + 1), ...S2];
+ for (let D of h2.slice())
+ if (D.dataset.headlessuiFocusGuard === "true" || r2 != null && r2.contains(D)) {
+ let w2 = h2.indexOf(D);
+ w2 !== -1 && h2.splice(w2, 1);
+ }
+ P$1(h2, N$2.First, { sorted: false });
+ }, [d$3.Backwards]: () => {
+ var r2;
+ P$1(i, N$2.Previous) === T.Error && ((r2 = o$1(e2.button)) == null || r2.focus());
+ } });
+ }
+ n2();
+ }
+ return () => {
+ let i = { open: e2.popoverState.value === 0, close: e2.close }, _a2 = c2, { id: n2, focus: t2 } = _a2, r2 = __objRest(_a2, ["id", "focus"]), u2 = { ref: e2.panel, id: n2, onKeydown: P2, onFocusout: o2 && e2.popoverState.value === 0 ? a2 : void 0, tabIndex: -1 };
+ return H$2({ ourProps: u2, theirProps: __spreadValues(__spreadValues({}, m2), r2), attrs: m2, slot: i, slots: __spreadProps(__spreadValues({}, p2), { default: (...v2) => {
+ var S2;
+ return [h$1(Fragment, [b3.value && e2.isPortalled.value && h$1(f, { id: d2, ref: e2.beforePanelSentinel, features: a$2.Focusable, "data-headlessui-focus-guard": true, as: "button", type: "button", onFocus: g2 }), (S2 = p2.default) == null ? void 0 : S2.call(p2, ...v2), b3.value && e2.isPortalled.value && h$1(f, { id: I2, ref: e2.afterPanelSentinel, features: a$2.Focusable, "data-headlessui-focus-guard": true, as: "button", type: "button", onFocus: E2 })])];
+ } }), features: N$3.RenderStrategy | N$3.Static, visible: b3.value, name: "PopoverPanel" });
+ };
+} });
+defineComponent({ name: "PopoverGroup", props: { as: { type: [Object, String], default: "div" } }, setup(c2, { attrs: m2, slots: p2, expose: y2 }) {
+ let o2 = ref(null), e2 = shallowRef([]), f2 = computed(() => m$3(o2));
+ y2({ el: o2, $el: o2 });
+ function d2(P2) {
+ let a2 = e2.value.indexOf(P2);
+ a2 !== -1 && e2.value.splice(a2, 1);
+ }
+ function I2(P2) {
+ return e2.value.push(P2), () => {
+ d2(P2);
+ };
+ }
+ function s2() {
+ var F2;
+ let P2 = f2.value;
+ if (!P2)
+ return false;
+ let a2 = P2.activeElement;
+ return (F2 = o$1(o2)) != null && F2.contains(a2) ? true : e2.value.some((g2) => {
+ var E2, i;
+ return ((E2 = P2.getElementById(g2.buttonId.value)) == null ? void 0 : E2.contains(a2)) || ((i = P2.getElementById(g2.panelId.value)) == null ? void 0 : i.contains(a2));
+ });
+ }
+ function b3(P2) {
+ for (let a2 of e2.value)
+ a2.buttonId.value !== P2 && a2.close();
+ }
+ return provide(oe, { registerPopover: I2, unregisterPopover: d2, isFocusWithinPopoverGroup: s2, closeOthers: b3 }), () => H$2({ ourProps: { ref: o2 }, theirProps: c2, slot: {}, attrs: m2, slots: p2, name: "PopoverGroup" });
+} });
+let d$1 = defineComponent({ props: { onFocus: { type: Function, required: true } }, setup(t2) {
+ let n2 = ref(true);
+ return () => n2.value ? h$1(f, { as: "button", type: "button", features: a$2.Focusable, onFocus(o2) {
+ o2.preventDefault();
+ let e2, a2 = 50;
+ function r2() {
+ var u2;
+ if (a2-- <= 0) {
+ e2 && cancelAnimationFrame(e2);
+ return;
+ }
+ if ((u2 = t2.onFocus) != null && u2.call(t2)) {
+ n2.value = false, cancelAnimationFrame(e2);
+ return;
+ }
+ e2 = requestAnimationFrame(r2);
+ }
+ e2 = requestAnimationFrame(r2);
+ } }) : null;
+} });
+var te$1 = ((i) => (i[i.Forwards = 0] = "Forwards", i[i.Backwards = 1] = "Backwards", i))(te$1 || {}), le = ((s2) => (s2[s2.Less = -1] = "Less", s2[s2.Equal = 0] = "Equal", s2[s2.Greater = 1] = "Greater", s2))(le || {});
+let U = Symbol("TabsContext");
+function k(a2) {
+ let v2 = inject$1(U, null);
+ if (v2 === null) {
+ let i = new Error(`<${a2} /> is missing a parent component.`);
+ throw Error.captureStackTrace && Error.captureStackTrace(i, k), i;
+ }
+ return v2;
+}
+let j = Symbol("TabsSSRContext"), xe = defineComponent({ name: "TabGroup", emits: { change: (a2) => true }, props: { as: { type: [Object, String], default: "template" }, selectedIndex: { type: [Number], default: null }, defaultIndex: { type: [Number], default: 0 }, vertical: { type: [Boolean], default: false }, manual: { type: [Boolean], default: false } }, inheritAttrs: false, setup(a2, { slots: v2, attrs: i, emit: s2 }) {
+ var h2;
+ let l2 = ref((h2 = a2.selectedIndex) != null ? h2 : a2.defaultIndex), n2 = ref([]), o2 = ref([]), T2 = computed(() => a2.selectedIndex !== null), b3 = computed(() => T2.value ? a2.selectedIndex : l2.value);
+ function m2(t2) {
+ var S2;
+ let e2 = O(r2.tabs.value, o$1), u2 = O(r2.panels.value, o$1), f2 = e2.filter((p2) => {
+ var E2;
+ return !((E2 = o$1(p2)) != null && E2.hasAttribute("disabled"));
+ });
+ if (t2 < 0 || t2 > e2.length - 1) {
+ let p2 = u$4(l2.value === null ? 0 : Math.sign(t2 - l2.value), { [-1]: () => 1, [0]: () => u$4(Math.sign(t2), { [-1]: () => 0, [0]: () => 0, [1]: () => 1 }), [1]: () => 0 });
+ l2.value = u$4(p2, { [0]: () => e2.indexOf(f2[0]), [1]: () => e2.indexOf(f2[f2.length - 1]) }), r2.tabs.value = e2, r2.panels.value = u2;
+ } else {
+ let p2 = e2.slice(0, t2), G = [...e2.slice(t2), ...p2].find((W2) => f2.includes(W2));
+ if (!G)
+ return;
+ let B2 = (S2 = e2.indexOf(G)) != null ? S2 : r2.selectedIndex.value;
+ B2 === -1 && (B2 = r2.selectedIndex.value), l2.value = B2, r2.tabs.value = e2, r2.panels.value = u2;
+ }
+ }
+ let r2 = { selectedIndex: computed(() => {
+ var t2, e2;
+ return (e2 = (t2 = l2.value) != null ? t2 : a2.defaultIndex) != null ? e2 : null;
+ }), orientation: computed(() => a2.vertical ? "vertical" : "horizontal"), activation: computed(() => a2.manual ? "manual" : "auto"), tabs: n2, panels: o2, setSelectedIndex(t2) {
+ b3.value !== t2 && s2("change", t2), T2.value || m2(t2);
+ }, registerTab(t2) {
+ var f2;
+ if (n2.value.includes(t2))
+ return;
+ let e2 = n2.value[l2.value];
+ n2.value.push(t2), n2.value = O(n2.value, o$1);
+ let u2 = (f2 = n2.value.indexOf(e2)) != null ? f2 : l2.value;
+ u2 !== -1 && (l2.value = u2);
+ }, unregisterTab(t2) {
+ let e2 = n2.value.indexOf(t2);
+ e2 !== -1 && n2.value.splice(e2, 1);
+ }, registerPanel(t2) {
+ o2.value.includes(t2) || (o2.value.push(t2), o2.value = O(o2.value, o$1));
+ }, unregisterPanel(t2) {
+ let e2 = o2.value.indexOf(t2);
+ e2 !== -1 && o2.value.splice(e2, 1);
+ } };
+ provide(U, r2);
+ let R2 = ref({ tabs: [], panels: [] }), y2 = ref(false);
+ onMounted(() => {
+ y2.value = true;
+ }), provide(j, computed(() => y2.value ? null : R2.value));
+ let w2 = computed(() => a2.selectedIndex);
+ return onMounted(() => {
+ watch([w2], () => {
+ var t2;
+ return m2((t2 = a2.selectedIndex) != null ? t2 : a2.defaultIndex);
+ }, { immediate: true });
+ }), watchEffect(() => {
+ if (!T2.value || b3.value == null || r2.tabs.value.length <= 0)
+ return;
+ let t2 = O(r2.tabs.value, o$1);
+ t2.some((u2, f2) => o$1(r2.tabs.value[f2]) !== o$1(u2)) && r2.setSelectedIndex(t2.findIndex((u2) => o$1(u2) === o$1(r2.tabs.value[b3.value])));
+ }), () => {
+ let t2 = { selectedIndex: l2.value };
+ return h$1(Fragment, [n2.value.length <= 0 && h$1(d$1, { onFocus: () => {
+ for (let e2 of n2.value) {
+ let u2 = o$1(e2);
+ if ((u2 == null ? void 0 : u2.tabIndex) === 0)
+ return u2.focus(), true;
+ }
+ return false;
+ } }), H$2({ theirProps: __spreadValues(__spreadValues({}, i), T$1(a2, ["selectedIndex", "defaultIndex", "manual", "vertical", "onChange"])), ourProps: {}, slot: t2, slots: v2, attrs: i, name: "TabGroup" })]);
+ };
+} }), Ie = defineComponent({ name: "TabList", props: { as: { type: [Object, String], default: "div" } }, setup(a2, { attrs: v2, slots: i }) {
+ let s2 = k("TabList");
+ return () => {
+ let l2 = { selectedIndex: s2.selectedIndex.value }, n2 = { role: "tablist", "aria-orientation": s2.orientation.value };
+ return H$2({ ourProps: n2, theirProps: a2, slot: l2, attrs: v2, slots: i, name: "TabList" });
+ };
+} }), ye = defineComponent({ name: "Tab", props: { as: { type: [Object, String], default: "button" }, disabled: { type: [Boolean], default: false }, id: { type: String, default: () => `headlessui-tabs-tab-${t$5()}` } }, setup(a2, { attrs: v2, slots: i, expose: s2 }) {
+ let l2 = k("Tab"), n2 = ref(null);
+ s2({ el: n2, $el: n2 }), onMounted(() => l2.registerTab(n2)), onUnmounted(() => l2.unregisterTab(n2));
+ let o2 = inject$1(j), T$12 = computed(() => {
+ if (o2.value) {
+ let e2 = o2.value.tabs.indexOf(a2.id);
+ return e2 === -1 ? o2.value.tabs.push(a2.id) - 1 : e2;
+ }
+ return -1;
+ }), b3 = computed(() => {
+ let e2 = l2.tabs.value.indexOf(n2);
+ return e2 === -1 ? T$12.value : e2;
+ }), m2 = computed(() => b3.value === l2.selectedIndex.value);
+ function r2(e2) {
+ var f2;
+ let u2 = e2();
+ if (u2 === T.Success && l2.activation.value === "auto") {
+ let S2 = (f2 = m$3(n2)) == null ? void 0 : f2.activeElement, p2 = l2.tabs.value.findIndex((E2) => o$1(E2) === S2);
+ p2 !== -1 && l2.setSelectedIndex(p2);
+ }
+ return u2;
+ }
+ function R2(e2) {
+ let u2 = l2.tabs.value.map((S2) => o$1(S2)).filter(Boolean);
+ if (e2.key === o$2.Space || e2.key === o$2.Enter) {
+ e2.preventDefault(), e2.stopPropagation(), l2.setSelectedIndex(b3.value);
+ return;
+ }
+ switch (e2.key) {
+ case o$2.Home:
+ case o$2.PageUp:
+ return e2.preventDefault(), e2.stopPropagation(), r2(() => P$1(u2, N$2.First));
+ case o$2.End:
+ case o$2.PageDown:
+ return e2.preventDefault(), e2.stopPropagation(), r2(() => P$1(u2, N$2.Last));
+ }
+ if (r2(() => u$4(l2.orientation.value, { vertical() {
+ return e2.key === o$2.ArrowUp ? P$1(u2, N$2.Previous | N$2.WrapAround) : e2.key === o$2.ArrowDown ? P$1(u2, N$2.Next | N$2.WrapAround) : T.Error;
+ }, horizontal() {
+ return e2.key === o$2.ArrowLeft ? P$1(u2, N$2.Previous | N$2.WrapAround) : e2.key === o$2.ArrowRight ? P$1(u2, N$2.Next | N$2.WrapAround) : T.Error;
+ } })) === T.Success)
+ return e2.preventDefault();
+ }
+ let y2 = ref(false);
+ function w2() {
+ var e2;
+ y2.value || (y2.value = true, !a2.disabled && ((e2 = o$1(n2)) == null || e2.focus(), l2.setSelectedIndex(b3.value), t$3(() => {
+ y2.value = false;
+ })));
+ }
+ function h2(e2) {
+ e2.preventDefault();
+ }
+ let t2 = b$1(computed(() => ({ as: a2.as, type: v2.type })), n2);
+ return () => {
+ var p2;
+ let e2 = { selected: m2.value }, _a2 = a2, { id: u2 } = _a2, f2 = __objRest(_a2, ["id"]), S2 = { ref: n2, onKeydown: R2, onMousedown: h2, onClick: w2, id: u2, role: "tab", type: t2.value, "aria-controls": (p2 = o$1(l2.panels.value[b3.value])) == null ? void 0 : p2.id, "aria-selected": m2.value, tabIndex: m2.value ? 0 : -1, disabled: a2.disabled ? true : void 0 };
+ return H$2({ ourProps: S2, theirProps: f2, slot: e2, attrs: v2, slots: i, name: "Tab" });
+ };
+} });
+defineComponent({ name: "TabPanels", props: { as: { type: [Object, String], default: "div" } }, setup(a2, { slots: v2, attrs: i }) {
+ let s2 = k("TabPanels");
+ return () => {
+ let l2 = { selectedIndex: s2.selectedIndex.value };
+ return H$2({ theirProps: a2, ourProps: {}, slot: l2, attrs: i, slots: v2, name: "TabPanels" });
+ };
+} });
+defineComponent({ name: "TabPanel", props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, id: { type: String, default: () => `headlessui-tabs-panel-${t$5()}` }, tabIndex: { type: Number, default: 0 } }, setup(a2, { attrs: v2, slots: i, expose: s2 }) {
+ let l2 = k("TabPanel"), n2 = ref(null);
+ s2({ el: n2, $el: n2 }), onMounted(() => l2.registerPanel(n2)), onUnmounted(() => l2.unregisterPanel(n2));
+ let o2 = inject$1(j), T2 = computed(() => {
+ if (o2.value) {
+ let r2 = o2.value.panels.indexOf(a2.id);
+ return r2 === -1 ? o2.value.panels.push(a2.id) - 1 : r2;
+ }
+ return -1;
+ }), b3 = computed(() => {
+ let r2 = l2.panels.value.indexOf(n2);
+ return r2 === -1 ? T2.value : r2;
+ }), m2 = computed(() => b3.value === l2.selectedIndex.value);
+ return () => {
+ var t2;
+ let r2 = { selected: m2.value }, _a2 = a2, { id: R2, tabIndex: y2 } = _a2, w2 = __objRest(_a2, ["id", "tabIndex"]), h2 = { ref: n2, id: R2, role: "tabpanel", "aria-labelledby": (t2 = o$1(l2.tabs.value[b3.value])) == null ? void 0 : t2.id, tabIndex: m2.value ? y2 : -1 };
+ return !m2.value && a2.unmount && !a2.static ? h$1(f, __spreadValues({ as: "span" }, h2)) : H$2({ ourProps: h2, theirProps: w2, slot: r2, attrs: v2, slots: i, features: N$3.Static | N$3.RenderStrategy, visible: m2.value, name: "TabPanel" });
+ };
+} });
+function l(r2) {
+ let e2 = { called: false };
+ return (...t2) => {
+ if (!e2.called)
+ return e2.called = true, r2(...t2);
+ };
+}
+function m(e2, ...t2) {
+ e2 && t2.length > 0 && e2.classList.add(...t2);
+}
+function d(e2, ...t2) {
+ e2 && t2.length > 0 && e2.classList.remove(...t2);
+}
+var g$1 = ((i) => (i.Finished = "finished", i.Cancelled = "cancelled", i))(g$1 || {});
+function F(e2, t2) {
+ let i = r$1();
+ if (!e2)
+ return i.dispose;
+ let { transitionDuration: n2, transitionDelay: a2 } = getComputedStyle(e2), [l2, s2] = [n2, a2].map((o2) => {
+ let [u2 = 0] = o2.split(",").filter(Boolean).map((r2) => r2.includes("ms") ? parseFloat(r2) : parseFloat(r2) * 1e3).sort((r2, c2) => c2 - r2);
+ return u2;
+ });
+ return l2 !== 0 ? i.setTimeout(() => t2("finished"), l2 + s2) : t2("finished"), i.add(() => t2("cancelled")), i.dispose;
+}
+function L$1(e2, t2, i, n2, a2, l$12) {
+ let s2 = r$1(), o2 = l$12 !== void 0 ? l(l$12) : () => {
+ };
+ return d(e2, ...a2), m(e2, ...t2, ...i), s2.nextFrame(() => {
+ d(e2, ...i), m(e2, ...n2), s2.add(F(e2, (u2) => (d(e2, ...n2, ...t2), m(e2, ...a2), o2(u2))));
+ }), s2.add(() => d(e2, ...t2, ...i, ...n2, ...a2)), s2.add(() => o2("cancelled")), s2.dispose;
+}
+function g(e2 = "") {
+ return e2.split(" ").filter((t2) => t2.trim().length > 1);
+}
+let R = Symbol("TransitionContext");
+var pe = ((a2) => (a2.Visible = "visible", a2.Hidden = "hidden", a2))(pe || {});
+function me() {
+ return inject$1(R, null) !== null;
+}
+function Te() {
+ let e2 = inject$1(R, null);
+ if (e2 === null)
+ throw new Error("A is used but it is missing a parent .");
+ return e2;
+}
+function ge() {
+ let e2 = inject$1(N, null);
+ if (e2 === null)
+ throw new Error("A is used but it is missing a parent .");
+ return e2;
+}
+let N = Symbol("NestingContext");
+function L(e2) {
+ return "children" in e2 ? L(e2.children) : e2.value.filter(({ state: t2 }) => t2 === "visible").length > 0;
+}
+function Q(e2) {
+ let t2 = ref([]), a2 = ref(false);
+ onMounted(() => a2.value = true), onUnmounted(() => a2.value = false);
+ function s2(n2, r2 = S$2.Hidden) {
+ let l2 = t2.value.findIndex(({ id: f2 }) => f2 === n2);
+ l2 !== -1 && (u$4(r2, { [S$2.Unmount]() {
+ t2.value.splice(l2, 1);
+ }, [S$2.Hidden]() {
+ t2.value[l2].state = "hidden";
+ } }), !L(t2) && a2.value && (e2 == null || e2()));
+ }
+ function h2(n2) {
+ let r2 = t2.value.find(({ id: l2 }) => l2 === n2);
+ return r2 ? r2.state !== "visible" && (r2.state = "visible") : t2.value.push({ id: n2, state: "visible" }), () => s2(n2, S$2.Unmount);
+ }
+ return { children: t2, register: h2, unregister: s2 };
+}
+let W = N$3.RenderStrategy, he = defineComponent({ props: { as: { type: [Object, String], default: "div" }, show: { type: [Boolean], default: null }, unmount: { type: [Boolean], default: true }, appear: { type: [Boolean], default: false }, enter: { type: [String], default: "" }, enterFrom: { type: [String], default: "" }, enterTo: { type: [String], default: "" }, entered: { type: [String], default: "" }, leave: { type: [String], default: "" }, leaveFrom: { type: [String], default: "" }, leaveTo: { type: [String], default: "" } }, emits: { beforeEnter: () => true, afterEnter: () => true, beforeLeave: () => true, afterLeave: () => true }, setup(e2, { emit: t2, attrs: a2, slots: s2, expose: h2 }) {
+ let n2 = ref(0);
+ function r2() {
+ n2.value |= l$2.Opening, t2("beforeEnter");
+ }
+ function l2() {
+ n2.value &= ~l$2.Opening, t2("afterEnter");
+ }
+ function f2() {
+ n2.value |= l$2.Closing, t2("beforeLeave");
+ }
+ function S2() {
+ n2.value &= ~l$2.Closing, t2("afterLeave");
+ }
+ if (!me() && C())
+ return () => h$1(Se, __spreadProps(__spreadValues({}, e2), { onBeforeEnter: r2, onAfterEnter: l2, onBeforeLeave: f2, onAfterLeave: S2 }), s2);
+ let d2 = ref(null), b3 = computed(() => e2.unmount ? S$2.Unmount : S$2.Hidden);
+ h2({ el: d2, $el: d2 });
+ let { show: v2, appear: A2 } = Te(), { register: D, unregister: H2 } = ge(), i = ref(v2.value ? "visible" : "hidden"), I2 = { value: true }, c2 = t$5(), y2 = { value: false }, P2 = Q(() => {
+ !y2.value && i.value !== "hidden" && (i.value = "hidden", H2(c2), S2());
+ });
+ onMounted(() => {
+ let o2 = D(c2);
+ onUnmounted(o2);
+ }), watchEffect(() => {
+ if (b3.value === S$2.Hidden && c2) {
+ if (v2.value && i.value !== "visible") {
+ i.value = "visible";
+ return;
+ }
+ u$4(i.value, { ["hidden"]: () => H2(c2), ["visible"]: () => D(c2) });
+ }
+ });
+ let j2 = g(e2.enter), M2 = g(e2.enterFrom), X2 = g(e2.enterTo), _ = g(e2.entered), Y = g(e2.leave), Z = g(e2.leaveFrom), ee = g(e2.leaveTo);
+ onMounted(() => {
+ watchEffect(() => {
+ if (i.value === "visible") {
+ let o2 = o$1(d2);
+ if (o2 instanceof Comment && o2.data === "")
+ throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
+ }
+ });
+ });
+ function te2(o2) {
+ let E2 = I2.value && !A2.value, p2 = o$1(d2);
+ !p2 || !(p2 instanceof HTMLElement) || E2 || (y2.value = true, v2.value && r2(), v2.value || f2(), o2(v2.value ? L$1(p2, j2, M2, X2, _, (V2) => {
+ y2.value = false, V2 === g$1.Finished && l2();
+ }) : L$1(p2, Y, Z, ee, _, (V2) => {
+ y2.value = false, V2 === g$1.Finished && (L(P2) || (i.value = "hidden", H2(c2), S2()));
+ })));
+ }
+ return onMounted(() => {
+ watch([v2], (o2, E2, p2) => {
+ te2(p2), I2.value = false;
+ }, { immediate: true });
+ }), provide(N, P2), c$5(computed(() => u$4(i.value, { ["visible"]: l$2.Open, ["hidden"]: l$2.Closed }) | n2.value)), () => {
+ let _a2 = e2, { appear: o2, show: E2, enter: p2, enterFrom: V2, enterTo: Ce, entered: be, leave: ye2, leaveFrom: Ee, leaveTo: Ve } = _a2, U2 = __objRest(_a2, ["appear", "show", "enter", "enterFrom", "enterTo", "entered", "leave", "leaveFrom", "leaveTo"]), ne2 = { ref: d2 }, re = __spreadValues(__spreadValues({}, U2), A2.value && v2.value && c$4.isServer ? { class: normalizeClass([a2.class, U2.class, ...j2, ...M2]) } : {});
+ return H$2({ theirProps: re, ourProps: ne2, slot: {}, slots: s2, attrs: a2, features: W, visible: i.value === "visible", name: "TransitionChild" });
+ };
+} }), ce = he, Se = defineComponent({ inheritAttrs: false, props: { as: { type: [Object, String], default: "div" }, show: { type: [Boolean], default: null }, unmount: { type: [Boolean], default: true }, appear: { type: [Boolean], default: false }, enter: { type: [String], default: "" }, enterFrom: { type: [String], default: "" }, enterTo: { type: [String], default: "" }, entered: { type: [String], default: "" }, leave: { type: [String], default: "" }, leaveFrom: { type: [String], default: "" }, leaveTo: { type: [String], default: "" } }, emits: { beforeEnter: () => true, afterEnter: () => true, beforeLeave: () => true, afterLeave: () => true }, setup(e2, { emit: t2, attrs: a2, slots: s2 }) {
+ let h2 = p$3(), n2 = computed(() => e2.show === null && h2 !== null ? (h2.value & l$2.Open) === l$2.Open : e2.show);
+ watchEffect(() => {
+ if (![true, false].includes(n2.value))
+ throw new Error('A is used but it is missing a `:show="true | false"` prop.');
+ });
+ let r2 = ref(n2.value ? "visible" : "hidden"), l2 = Q(() => {
+ r2.value = "hidden";
+ }), f2 = ref(true), S2 = { show: n2, appear: computed(() => e2.appear || !f2.value) };
+ return onMounted(() => {
+ watchEffect(() => {
+ f2.value = false, n2.value ? r2.value = "visible" : L(l2) || (r2.value = "hidden");
+ });
+ }), provide(N, l2), provide(R, S2), () => {
+ let d2 = T$1(e2, ["show", "appear", "unmount", "onBeforeEnter", "onBeforeLeave", "onAfterEnter", "onAfterLeave"]), b3 = { unmount: e2.unmount };
+ return H$2({ ourProps: __spreadProps(__spreadValues({}, b3), { as: "template" }), theirProps: {}, slot: {}, slots: __spreadProps(__spreadValues({}, s2), { default: () => [h$1(ce, __spreadValues(__spreadValues(__spreadValues({ onBeforeEnter: () => t2("beforeEnter"), onAfterEnter: () => t2("afterEnter"), onBeforeLeave: () => t2("beforeLeave"), onAfterLeave: () => t2("afterLeave") }, a2), b3), d2), s2.default)] }), attrs: {}, features: W, visible: r2.value === "visible", name: "Transition" });
+ };
+} });
+const _hoisted_1$M = {
+ viewBox: "0 0 32 32",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$B = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "m16 10l10 10l-1.4 1.4l-8.6-8.6l-8.6 8.6L6 20z"
+}, null, -1);
+const _hoisted_3$x = [
+ _hoisted_2$B
+];
+function render$k(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$M, _hoisted_3$x);
+}
+var __unplugin_components_0$7 = { name: "carbon-chevron-up", render: render$k };
+var _export_sfc = (sfc, props2) => {
+ const target = sfc.__vccOpts || sfc;
+ for (const [key, val] of props2) {
+ target[key] = val;
+ }
+ return target;
+};
+const _sfc_main$A = {};
+function _sfc_render$6(_ctx, _cache) {
+ const _component_i_carbon_chevron_up = __unplugin_components_0$7;
+ const _component_DisclosureButton = V;
+ const _component_DisclosurePanel = X;
+ const _component_Disclosure = Q$1;
+ return openBlock(), createBlock(_component_Disclosure, { "default-open": "" }, {
+ default: withCtx(({ open }) => [
+ createVNode(_component_DisclosureButton, { class: "flex items-center transition justify-between w-full px-2 py-1 my-1 text-sm font-medium text-left border-2 border-blue-900/30 text-blue-900/70 hover:text-blue-700 hover:bg-blue-200 dark:border-none dark:bg-blue-900/30 dark:text-blue-100 dark:hover:bg-blue-900/50 dark:hover:text-blue-50 rounded-lg focus:outline-none focus-visible:ring focus-visible:ring-blue-500 focus-visible:ring-opacity-75" }, {
+ default: withCtx(() => [
+ renderSlot(_ctx.$slots, "label"),
+ createVNode(_component_i_carbon_chevron_up, {
+ class: normalizeClass([open ? "transform rotate-180" : "", "w-5 h-5 color-current transition"])
+ }, null, 8, ["class"])
+ ]),
+ _: 2
+ }, 1024),
+ createVNode(Transition, {
+ "enter-active-class": "transition duration-100 ease-out",
+ "enter-from-class": "transform scale-95 opacity-0",
+ "enter-to-class": "transform scale-100 opacity-100",
+ "leave-active-class": "transition duration-75 ease-out",
+ "leave-from-class": "transform scale-100 opacity-100",
+ "leave-to-class": "transform scale-95 opacity-0"
+ }, {
+ default: withCtx(() => [
+ createVNode(_component_DisclosurePanel, { class: "bg-teal-50 dark:bg-transparent" }, {
+ default: withCtx(() => [
+ renderSlot(_ctx.$slots, "default")
+ ]),
+ _: 3
+ })
+ ]),
+ _: 3
+ })
+ ]),
+ _: 3
+ });
+}
+var __unplugin_components_3$1 = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$6]]);
+const _hoisted_1$L = {
+ role: "tooltip",
+ class: "max-w-[500px] z-500 flex -left-80px absolute w-auto min-w-320px max-h-[500px] overflow-y-auto z-10 top-[99%] inline-block bg-gray-900/99 font-medium shadow-sm text-white py-2 px-3 text-sm rounded-lg"
+};
+const _sfc_main$z = defineComponent({
+ __name: "Tooltip",
+ setup(__props) {
+ const isShowing = ref(false);
+ return (_ctx, _cache) => {
+ const _component_TransitionRoot = Se;
+ return _ctx.$slots.tooltip ? (openBlock(), createElementBlock("div", {
+ key: 0,
+ class: "relative",
+ onMouseleave: _cache[1] || (_cache[1] = ($event) => isShowing.value = false)
+ }, [
+ createVNode(_component_TransitionRoot, {
+ appear: "",
+ show: unref(isShowing),
+ as: "template",
+ enter: "transform transition duration-[400ms]",
+ "enter-from": "opacity-0 scale-50",
+ "enter-to": "opacity-100 scale-100",
+ leave: "transform duration-200 transition ease-in-out",
+ "leave-from": "opacity-100 scale-100 ",
+ "leave-to": "opacity-0 scale-95 "
+ }, {
+ default: withCtx(() => [
+ createBaseVNode("div", _hoisted_1$L, [
+ createBaseVNode("div", null, [
+ renderSlot(_ctx.$slots, "tooltip")
+ ])
+ ])
+ ]),
+ _: 3
+ }, 8, ["show"]),
+ createBaseVNode("span", {
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => isShowing.value = true)
+ }, [
+ renderSlot(_ctx.$slots, "default")
+ ], 32)
+ ], 32)) : createCommentVNode("", true);
+ };
+ }
+});
+var AuditResult_vue_vue_type_style_index_0_scoped_true_lang = "";
+const _hoisted_1$K = {
+ key: 0,
+ class: "text-base"
+};
+const _sfc_main$y = defineComponent({
+ __name: "AuditResult",
+ props: {
+ value: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const mark = computed(() => {
+ if (props2.value.score === null)
+ return "na";
+ if (props2.value.score >= 0.9)
+ return "pass";
+ if (props2.value.score >= 0.5)
+ return "average";
+ return "fail";
+ });
+ return (_ctx, _cache) => {
+ return openBlock(), createElementBlock("div", {
+ class: normalizeClass(["flex items-center text-mono font-mono", [unref(mark)]])
+ }, [
+ createBaseVNode("div", {
+ class: normalizeClass(["icon w-2 h-2 mr-2", typeof _ctx.value.displayValue !== "undefined" && _ctx.value.displayValue ? ["hidden", "md:inline"] : []])
+ }, null, 2),
+ typeof _ctx.value.displayValue !== "undefined" ? (openBlock(), createElementBlock("div", _hoisted_1$K, toDisplayString(_ctx.value.displayValue), 1)) : createCommentVNode("", true)
+ ], 2);
+ };
+ }
+});
+var __unplugin_components_0$6 = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-61b2e920"]]);
+const _sfc_main$x = defineComponent({
+ __name: "AuditResultItemsLength",
+ props: {
+ value: {}
+ },
+ setup(__props) {
+ return (_ctx, _cache) => {
+ const _component_audit_result = __unplugin_components_0$6;
+ return openBlock(), createElementBlock("div", null, [
+ createVNode(_component_audit_result, {
+ value: { score: _ctx.value.score, displayValue: _ctx.value.details.items.length }
+ }, null, 8, ["value"])
+ ]);
+ };
+ }
+});
+var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
+var freeGlobal$1 = freeGlobal;
+var freeSelf = typeof self == "object" && self && self.Object === Object && self;
+var root = freeGlobal$1 || freeSelf || Function("return this")();
+var root$1 = root;
+var Symbol$1 = root$1.Symbol;
+var Symbol$2 = Symbol$1;
+var objectProto$d = Object.prototype;
+var hasOwnProperty$a = objectProto$d.hasOwnProperty;
+var nativeObjectToString$1 = objectProto$d.toString;
+var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
+function getRawTag(value) {
+ var isOwn = hasOwnProperty$a.call(value, symToStringTag$1), tag = value[symToStringTag$1];
+ try {
+ value[symToStringTag$1] = void 0;
+ var unmasked = true;
+ } catch (e2) {
+ }
+ var result = nativeObjectToString$1.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag$1] = tag;
+ } else {
+ delete value[symToStringTag$1];
+ }
+ }
+ return result;
+}
+var objectProto$c = Object.prototype;
+var nativeObjectToString = objectProto$c.toString;
+function objectToString(value) {
+ return nativeObjectToString.call(value);
+}
+var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
+var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
+function baseGetTag(value) {
+ if (value == null) {
+ return value === void 0 ? undefinedTag : nullTag;
+ }
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
+}
+function isObjectLike$1(value) {
+ return value != null && typeof value == "object";
+}
+var symbolTag$1 = "[object Symbol]";
+function isSymbol(value) {
+ return typeof value == "symbol" || isObjectLike$1(value) && baseGetTag(value) == symbolTag$1;
+}
+function arrayMap(array, iteratee) {
+ var index = -1, length = array == null ? 0 : array.length, result = Array(length);
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+var isArray$1 = Array.isArray;
+var isArray$2 = isArray$1;
+var INFINITY$2 = 1 / 0;
+var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
+function baseToString$1(value) {
+ if (typeof value == "string") {
+ return value;
+ }
+ if (isArray$2(value)) {
+ return arrayMap(value, baseToString$1) + "";
+ }
+ if (isSymbol(value)) {
+ return symbolToString ? symbolToString.call(value) : "";
+ }
+ var result = value + "";
+ return result == "0" && 1 / value == -INFINITY$2 ? "-0" : result;
+}
+function isObject$1(value) {
+ var type = typeof value;
+ return value != null && (type == "object" || type == "function");
+}
+function identity(value) {
+ return value;
+}
+var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
+function isFunction(value) {
+ if (!isObject$1(value)) {
+ return false;
+ }
+ var tag = baseGetTag(value);
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
+}
+var coreJsData = root$1["__core-js_shared__"];
+var coreJsData$1 = coreJsData;
+var maskSrcKey = function() {
+ var uid2 = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
+ return uid2 ? "Symbol(src)_1." + uid2 : "";
+}();
+function isMasked(func) {
+ return !!maskSrcKey && maskSrcKey in func;
+}
+var funcProto$1 = Function.prototype;
+var funcToString$1 = funcProto$1.toString;
+function toSource(func) {
+ if (func != null) {
+ try {
+ return funcToString$1.call(func);
+ } catch (e2) {
+ }
+ try {
+ return func + "";
+ } catch (e2) {
+ }
+ }
+ return "";
+}
+var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+var funcProto = Function.prototype, objectProto$b = Object.prototype;
+var funcToString = funcProto.toString;
+var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
+var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty$9).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
+function baseIsNative(value) {
+ if (!isObject$1(value) || isMasked(value)) {
+ return false;
+ }
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
+ return pattern.test(toSource(value));
+}
+function getValue(object, key) {
+ return object == null ? void 0 : object[key];
+}
+function getNative(object, key) {
+ var value = getValue(object, key);
+ return baseIsNative(value) ? value : void 0;
+}
+var WeakMap$1 = getNative(root$1, "WeakMap");
+var WeakMap$2 = WeakMap$1;
+var defineProperty = function() {
+ try {
+ var func = getNative(Object, "defineProperty");
+ func({}, "", {});
+ return func;
+ } catch (e2) {
+ }
+}();
+var defineProperty$1 = defineProperty;
+var MAX_SAFE_INTEGER$1 = 9007199254740991;
+var reIsUint = /^(?:0|[1-9]\d*)$/;
+function isIndex(value, length) {
+ var type = typeof value;
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
+}
+function baseAssignValue(object, key, value) {
+ if (key == "__proto__" && defineProperty$1) {
+ defineProperty$1(object, key, {
+ "configurable": true,
+ "enumerable": true,
+ "value": value,
+ "writable": true
+ });
+ } else {
+ object[key] = value;
+ }
+}
+function eq(value, other) {
+ return value === other || value !== value && other !== other;
+}
+var MAX_SAFE_INTEGER = 9007199254740991;
+function isLength(value) {
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+function isArrayLike(value) {
+ return value != null && isLength(value.length) && !isFunction(value);
+}
+var objectProto$a = Object.prototype;
+function isPrototype(value) {
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$a;
+ return value === proto;
+}
+function baseTimes(n2, iteratee) {
+ var index = -1, result = Array(n2);
+ while (++index < n2) {
+ result[index] = iteratee(index);
+ }
+ return result;
+}
+var argsTag$2 = "[object Arguments]";
+function baseIsArguments(value) {
+ return isObjectLike$1(value) && baseGetTag(value) == argsTag$2;
+}
+var objectProto$9 = Object.prototype;
+var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
+var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
+var isArguments = baseIsArguments(function() {
+ return arguments;
+}()) ? baseIsArguments : function(value) {
+ return isObjectLike$1(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
+};
+var isArguments$1 = isArguments;
+function stubFalse() {
+ return false;
+}
+var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
+var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
+var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
+var Buffer2 = moduleExports$1 ? root$1.Buffer : void 0;
+var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
+var isBuffer = nativeIsBuffer || stubFalse;
+var isBuffer$1 = isBuffer;
+var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", mapTag$3 = "[object Map]", numberTag$1 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$1 = "[object String]", weakMapTag$1 = "[object WeakMap]";
+var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$3] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$3] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
+function baseIsTypedArray(value) {
+ return isObjectLike$1(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
+}
+function baseUnary(func) {
+ return function(value) {
+ return func(value);
+ };
+}
+var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
+var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
+var moduleExports = freeModule && freeModule.exports === freeExports;
+var freeProcess = moduleExports && freeGlobal$1.process;
+var nodeUtil = function() {
+ try {
+ var types = freeModule && freeModule.require && freeModule.require("util").types;
+ if (types) {
+ return types;
+ }
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
+ } catch (e2) {
+ }
+}();
+var nodeUtil$1 = nodeUtil;
+var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
+var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
+var isTypedArray$1 = isTypedArray;
+var objectProto$8 = Object.prototype;
+var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
+function arrayLikeKeys(value, inherited) {
+ var isArr = isArray$2(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
+ for (var key in value) {
+ if ((inherited || hasOwnProperty$7.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+function overArg(func, transform) {
+ return function(arg) {
+ return func(transform(arg));
+ };
+}
+var nativeKeys = overArg(Object.keys, Object);
+var nativeKeys$1 = nativeKeys;
+var objectProto$7 = Object.prototype;
+var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
+function baseKeys(object) {
+ if (!isPrototype(object)) {
+ return nativeKeys$1(object);
+ }
+ var result = [];
+ for (var key in Object(object)) {
+ if (hasOwnProperty$6.call(object, key) && key != "constructor") {
+ result.push(key);
+ }
+ }
+ return result;
+}
+function keys(object) {
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
+}
+var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
+function isKey(value, object) {
+ if (isArray$2(value)) {
+ return false;
+ }
+ var type = typeof value;
+ if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
+ return true;
+ }
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
+}
+var nativeCreate = getNative(Object, "create");
+var nativeCreate$1 = nativeCreate;
+function hashClear() {
+ this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
+ this.size = 0;
+}
+function hashDelete(key) {
+ var result = this.has(key) && delete this.__data__[key];
+ this.size -= result ? 1 : 0;
+ return result;
+}
+var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
+var objectProto$6 = Object.prototype;
+var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
+function hashGet(key) {
+ var data = this.__data__;
+ if (nativeCreate$1) {
+ var result = data[key];
+ return result === HASH_UNDEFINED$2 ? void 0 : result;
+ }
+ return hasOwnProperty$5.call(data, key) ? data[key] : void 0;
+}
+var objectProto$5 = Object.prototype;
+var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
+function hashHas(key) {
+ var data = this.__data__;
+ return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$4.call(data, key);
+}
+var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
+function hashSet(key, value) {
+ var data = this.__data__;
+ this.size += this.has(key) ? 0 : 1;
+ data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED$1 : value;
+ return this;
+}
+function Hash(entries) {
+ var index = -1, length = entries == null ? 0 : entries.length;
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+}
+Hash.prototype.clear = hashClear;
+Hash.prototype["delete"] = hashDelete;
+Hash.prototype.get = hashGet;
+Hash.prototype.has = hashHas;
+Hash.prototype.set = hashSet;
+function listCacheClear() {
+ this.__data__ = [];
+ this.size = 0;
+}
+function assocIndexOf(array, key) {
+ var length = array.length;
+ while (length--) {
+ if (eq(array[length][0], key)) {
+ return length;
+ }
+ }
+ return -1;
+}
+var arrayProto = Array.prototype;
+var splice = arrayProto.splice;
+function listCacheDelete(key) {
+ var data = this.__data__, index = assocIndexOf(data, key);
+ if (index < 0) {
+ return false;
+ }
+ var lastIndex = data.length - 1;
+ if (index == lastIndex) {
+ data.pop();
+ } else {
+ splice.call(data, index, 1);
+ }
+ --this.size;
+ return true;
+}
+function listCacheGet(key) {
+ var data = this.__data__, index = assocIndexOf(data, key);
+ return index < 0 ? void 0 : data[index][1];
+}
+function listCacheHas(key) {
+ return assocIndexOf(this.__data__, key) > -1;
+}
+function listCacheSet(key, value) {
+ var data = this.__data__, index = assocIndexOf(data, key);
+ if (index < 0) {
+ ++this.size;
+ data.push([key, value]);
+ } else {
+ data[index][1] = value;
+ }
+ return this;
+}
+function ListCache(entries) {
+ var index = -1, length = entries == null ? 0 : entries.length;
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+}
+ListCache.prototype.clear = listCacheClear;
+ListCache.prototype["delete"] = listCacheDelete;
+ListCache.prototype.get = listCacheGet;
+ListCache.prototype.has = listCacheHas;
+ListCache.prototype.set = listCacheSet;
+var Map$1 = getNative(root$1, "Map");
+var Map$2 = Map$1;
+function mapCacheClear() {
+ this.size = 0;
+ this.__data__ = {
+ "hash": new Hash(),
+ "map": new (Map$2 || ListCache)(),
+ "string": new Hash()
+ };
+}
+function isKeyable(value) {
+ var type = typeof value;
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
+}
+function getMapData(map, key) {
+ var data = map.__data__;
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
+}
+function mapCacheDelete(key) {
+ var result = getMapData(this, key)["delete"](key);
+ this.size -= result ? 1 : 0;
+ return result;
+}
+function mapCacheGet(key) {
+ return getMapData(this, key).get(key);
+}
+function mapCacheHas(key) {
+ return getMapData(this, key).has(key);
+}
+function mapCacheSet(key, value) {
+ var data = getMapData(this, key), size2 = data.size;
+ data.set(key, value);
+ this.size += data.size == size2 ? 0 : 1;
+ return this;
+}
+function MapCache(entries) {
+ var index = -1, length = entries == null ? 0 : entries.length;
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+}
+MapCache.prototype.clear = mapCacheClear;
+MapCache.prototype["delete"] = mapCacheDelete;
+MapCache.prototype.get = mapCacheGet;
+MapCache.prototype.has = mapCacheHas;
+MapCache.prototype.set = mapCacheSet;
+var FUNC_ERROR_TEXT = "Expected a function";
+function memoize(func, resolver) {
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var memoized = function() {
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
+ if (cache.has(key)) {
+ return cache.get(key);
+ }
+ var result = func.apply(this, args);
+ memoized.cache = cache.set(key, result) || cache;
+ return result;
+ };
+ memoized.cache = new (memoize.Cache || MapCache)();
+ return memoized;
+}
+memoize.Cache = MapCache;
+var MAX_MEMOIZE_SIZE = 500;
+function memoizeCapped(func) {
+ var result = memoize(func, function(key) {
+ if (cache.size === MAX_MEMOIZE_SIZE) {
+ cache.clear();
+ }
+ return key;
+ });
+ var cache = result.cache;
+ return result;
+}
+var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
+var reEscapeChar = /\\(\\)?/g;
+var stringToPath = memoizeCapped(function(string) {
+ var result = [];
+ if (string.charCodeAt(0) === 46) {
+ result.push("");
+ }
+ string.replace(rePropName, function(match2, number, quote, subString) {
+ result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match2);
+ });
+ return result;
+});
+var stringToPath$1 = stringToPath;
+function toString$1(value) {
+ return value == null ? "" : baseToString$1(value);
+}
+function castPath(value, object) {
+ if (isArray$2(value)) {
+ return value;
+ }
+ return isKey(value, object) ? [value] : stringToPath$1(toString$1(value));
+}
+var INFINITY$1 = 1 / 0;
+function toKey(value) {
+ if (typeof value == "string" || isSymbol(value)) {
+ return value;
+ }
+ var result = value + "";
+ return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
+}
+function baseGet(object, path) {
+ path = castPath(path, object);
+ var index = 0, length = path.length;
+ while (object != null && index < length) {
+ object = object[toKey(path[index++])];
+ }
+ return index && index == length ? object : void 0;
+}
+function get$1(object, path, defaultValue) {
+ var result = object == null ? void 0 : baseGet(object, path);
+ return result === void 0 ? defaultValue : result;
+}
+function arrayPush(array, values) {
+ var index = -1, length = values.length, offset = array.length;
+ while (++index < length) {
+ array[offset + index] = values[index];
+ }
+ return array;
+}
+function baseSlice(array, start, end) {
+ var index = -1, length = array.length;
+ if (start < 0) {
+ start = -start > length ? 0 : length + start;
+ }
+ end = end > length ? length : end;
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : end - start >>> 0;
+ start >>>= 0;
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+}
+function castSlice(array, start, end) {
+ var length = array.length;
+ end = end === void 0 ? length : end;
+ return !start && end >= length ? array : baseSlice(array, start, end);
+}
+var rsAstralRange$2 = "\\ud800-\\udfff", rsComboMarksRange$3 = "\\u0300-\\u036f", reComboHalfMarksRange$3 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$3 = "\\u20d0-\\u20ff", rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3, rsVarRange$2 = "\\ufe0e\\ufe0f";
+var rsZWJ$2 = "\\u200d";
+var reHasUnicode = RegExp("[" + rsZWJ$2 + rsAstralRange$2 + rsComboRange$3 + rsVarRange$2 + "]");
+function hasUnicode(string) {
+ return reHasUnicode.test(string);
+}
+function asciiToArray(string) {
+ return string.split("");
+}
+var rsAstralRange$1 = "\\ud800-\\udfff", rsComboMarksRange$2 = "\\u0300-\\u036f", reComboHalfMarksRange$2 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$2 = "\\u20d0-\\u20ff", rsComboRange$2 = rsComboMarksRange$2 + reComboHalfMarksRange$2 + rsComboSymbolsRange$2, rsVarRange$1 = "\\ufe0e\\ufe0f";
+var rsAstral = "[" + rsAstralRange$1 + "]", rsCombo$2 = "[" + rsComboRange$2 + "]", rsFitz$1 = "\\ud83c[\\udffb-\\udfff]", rsModifier$1 = "(?:" + rsCombo$2 + "|" + rsFitz$1 + ")", rsNonAstral$1 = "[^" + rsAstralRange$1 + "]", rsRegional$1 = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair$1 = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ$1 = "\\u200d";
+var reOptMod$1 = rsModifier$1 + "?", rsOptVar$1 = "[" + rsVarRange$1 + "]?", rsOptJoin$1 = "(?:" + rsZWJ$1 + "(?:" + [rsNonAstral$1, rsRegional$1, rsSurrPair$1].join("|") + ")" + rsOptVar$1 + reOptMod$1 + ")*", rsSeq$1 = rsOptVar$1 + reOptMod$1 + rsOptJoin$1, rsSymbol = "(?:" + [rsNonAstral$1 + rsCombo$2 + "?", rsCombo$2, rsRegional$1, rsSurrPair$1, rsAstral].join("|") + ")";
+var reUnicode = RegExp(rsFitz$1 + "(?=" + rsFitz$1 + ")|" + rsSymbol + rsSeq$1, "g");
+function unicodeToArray(string) {
+ return string.match(reUnicode) || [];
+}
+function stringToArray(string) {
+ return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
+}
+function createCaseFirst(methodName) {
+ return function(string) {
+ string = toString$1(string);
+ var strSymbols = hasUnicode(string) ? stringToArray(string) : void 0;
+ var chr = strSymbols ? strSymbols[0] : string.charAt(0);
+ var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
+ return chr[methodName]() + trailing;
+ };
+}
+var upperFirst = createCaseFirst("toUpperCase");
+var upperFirst$1 = upperFirst;
+function arrayReduce(array, iteratee, accumulator, initAccum) {
+ var index = -1, length = array == null ? 0 : array.length;
+ if (initAccum && length) {
+ accumulator = array[++index];
+ }
+ while (++index < length) {
+ accumulator = iteratee(accumulator, array[index], index, array);
+ }
+ return accumulator;
+}
+function basePropertyOf(object) {
+ return function(key) {
+ return object == null ? void 0 : object[key];
+ };
+}
+var deburredLetters = {
+ "\xC0": "A",
+ "\xC1": "A",
+ "\xC2": "A",
+ "\xC3": "A",
+ "\xC4": "A",
+ "\xC5": "A",
+ "\xE0": "a",
+ "\xE1": "a",
+ "\xE2": "a",
+ "\xE3": "a",
+ "\xE4": "a",
+ "\xE5": "a",
+ "\xC7": "C",
+ "\xE7": "c",
+ "\xD0": "D",
+ "\xF0": "d",
+ "\xC8": "E",
+ "\xC9": "E",
+ "\xCA": "E",
+ "\xCB": "E",
+ "\xE8": "e",
+ "\xE9": "e",
+ "\xEA": "e",
+ "\xEB": "e",
+ "\xCC": "I",
+ "\xCD": "I",
+ "\xCE": "I",
+ "\xCF": "I",
+ "\xEC": "i",
+ "\xED": "i",
+ "\xEE": "i",
+ "\xEF": "i",
+ "\xD1": "N",
+ "\xF1": "n",
+ "\xD2": "O",
+ "\xD3": "O",
+ "\xD4": "O",
+ "\xD5": "O",
+ "\xD6": "O",
+ "\xD8": "O",
+ "\xF2": "o",
+ "\xF3": "o",
+ "\xF4": "o",
+ "\xF5": "o",
+ "\xF6": "o",
+ "\xF8": "o",
+ "\xD9": "U",
+ "\xDA": "U",
+ "\xDB": "U",
+ "\xDC": "U",
+ "\xF9": "u",
+ "\xFA": "u",
+ "\xFB": "u",
+ "\xFC": "u",
+ "\xDD": "Y",
+ "\xFD": "y",
+ "\xFF": "y",
+ "\xC6": "Ae",
+ "\xE6": "ae",
+ "\xDE": "Th",
+ "\xFE": "th",
+ "\xDF": "ss",
+ "\u0100": "A",
+ "\u0102": "A",
+ "\u0104": "A",
+ "\u0101": "a",
+ "\u0103": "a",
+ "\u0105": "a",
+ "\u0106": "C",
+ "\u0108": "C",
+ "\u010A": "C",
+ "\u010C": "C",
+ "\u0107": "c",
+ "\u0109": "c",
+ "\u010B": "c",
+ "\u010D": "c",
+ "\u010E": "D",
+ "\u0110": "D",
+ "\u010F": "d",
+ "\u0111": "d",
+ "\u0112": "E",
+ "\u0114": "E",
+ "\u0116": "E",
+ "\u0118": "E",
+ "\u011A": "E",
+ "\u0113": "e",
+ "\u0115": "e",
+ "\u0117": "e",
+ "\u0119": "e",
+ "\u011B": "e",
+ "\u011C": "G",
+ "\u011E": "G",
+ "\u0120": "G",
+ "\u0122": "G",
+ "\u011D": "g",
+ "\u011F": "g",
+ "\u0121": "g",
+ "\u0123": "g",
+ "\u0124": "H",
+ "\u0126": "H",
+ "\u0125": "h",
+ "\u0127": "h",
+ "\u0128": "I",
+ "\u012A": "I",
+ "\u012C": "I",
+ "\u012E": "I",
+ "\u0130": "I",
+ "\u0129": "i",
+ "\u012B": "i",
+ "\u012D": "i",
+ "\u012F": "i",
+ "\u0131": "i",
+ "\u0134": "J",
+ "\u0135": "j",
+ "\u0136": "K",
+ "\u0137": "k",
+ "\u0138": "k",
+ "\u0139": "L",
+ "\u013B": "L",
+ "\u013D": "L",
+ "\u013F": "L",
+ "\u0141": "L",
+ "\u013A": "l",
+ "\u013C": "l",
+ "\u013E": "l",
+ "\u0140": "l",
+ "\u0142": "l",
+ "\u0143": "N",
+ "\u0145": "N",
+ "\u0147": "N",
+ "\u014A": "N",
+ "\u0144": "n",
+ "\u0146": "n",
+ "\u0148": "n",
+ "\u014B": "n",
+ "\u014C": "O",
+ "\u014E": "O",
+ "\u0150": "O",
+ "\u014D": "o",
+ "\u014F": "o",
+ "\u0151": "o",
+ "\u0154": "R",
+ "\u0156": "R",
+ "\u0158": "R",
+ "\u0155": "r",
+ "\u0157": "r",
+ "\u0159": "r",
+ "\u015A": "S",
+ "\u015C": "S",
+ "\u015E": "S",
+ "\u0160": "S",
+ "\u015B": "s",
+ "\u015D": "s",
+ "\u015F": "s",
+ "\u0161": "s",
+ "\u0162": "T",
+ "\u0164": "T",
+ "\u0166": "T",
+ "\u0163": "t",
+ "\u0165": "t",
+ "\u0167": "t",
+ "\u0168": "U",
+ "\u016A": "U",
+ "\u016C": "U",
+ "\u016E": "U",
+ "\u0170": "U",
+ "\u0172": "U",
+ "\u0169": "u",
+ "\u016B": "u",
+ "\u016D": "u",
+ "\u016F": "u",
+ "\u0171": "u",
+ "\u0173": "u",
+ "\u0174": "W",
+ "\u0175": "w",
+ "\u0176": "Y",
+ "\u0177": "y",
+ "\u0178": "Y",
+ "\u0179": "Z",
+ "\u017B": "Z",
+ "\u017D": "Z",
+ "\u017A": "z",
+ "\u017C": "z",
+ "\u017E": "z",
+ "\u0132": "IJ",
+ "\u0133": "ij",
+ "\u0152": "Oe",
+ "\u0153": "oe",
+ "\u0149": "'n",
+ "\u017F": "s"
+};
+var deburrLetter = basePropertyOf(deburredLetters);
+var deburrLetter$1 = deburrLetter;
+var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
+var rsComboMarksRange$1 = "\\u0300-\\u036f", reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$1 = "\\u20d0-\\u20ff", rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
+var rsCombo$1 = "[" + rsComboRange$1 + "]";
+var reComboMark = RegExp(rsCombo$1, "g");
+function deburr(string) {
+ string = toString$1(string);
+ return string && string.replace(reLatin, deburrLetter$1).replace(reComboMark, "");
+}
+var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
+function asciiWords(string) {
+ return string.match(reAsciiWord) || [];
+}
+var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
+function hasUnicodeWord(string) {
+ return reHasUnicodeWord.test(string);
+}
+var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
+var rsApos$1 = "['\u2019]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
+var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos$1 + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos$1 + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
+var reUnicodeWord = RegExp([
+ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
+ rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
+ rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
+ rsUpper + "+" + rsOptContrUpper,
+ rsOrdUpper,
+ rsOrdLower,
+ rsDigits,
+ rsEmoji
+].join("|"), "g");
+function unicodeWords(string) {
+ return string.match(reUnicodeWord) || [];
+}
+function words(string, pattern, guard) {
+ string = toString$1(string);
+ pattern = guard ? void 0 : pattern;
+ if (pattern === void 0) {
+ return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
+ }
+ return string.match(pattern) || [];
+}
+var rsApos = "['\u2019]";
+var reApos = RegExp(rsApos, "g");
+function createCompounder(callback) {
+ return function(string) {
+ return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
+ };
+}
+function stackClear() {
+ this.__data__ = new ListCache();
+ this.size = 0;
+}
+function stackDelete(key) {
+ var data = this.__data__, result = data["delete"](key);
+ this.size = data.size;
+ return result;
+}
+function stackGet(key) {
+ return this.__data__.get(key);
+}
+function stackHas(key) {
+ return this.__data__.has(key);
+}
+var LARGE_ARRAY_SIZE = 200;
+function stackSet(key, value) {
+ var data = this.__data__;
+ if (data instanceof ListCache) {
+ var pairs = data.__data__;
+ if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
+ pairs.push([key, value]);
+ this.size = ++data.size;
+ return this;
+ }
+ data = this.__data__ = new MapCache(pairs);
+ }
+ data.set(key, value);
+ this.size = data.size;
+ return this;
+}
+function Stack(entries) {
+ var data = this.__data__ = new ListCache(entries);
+ this.size = data.size;
+}
+Stack.prototype.clear = stackClear;
+Stack.prototype["delete"] = stackDelete;
+Stack.prototype.get = stackGet;
+Stack.prototype.has = stackHas;
+Stack.prototype.set = stackSet;
+function arrayFilter(array, predicate) {
+ var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result[resIndex++] = value;
+ }
+ }
+ return result;
+}
+function stubArray() {
+ return [];
+}
+var objectProto$4 = Object.prototype;
+var propertyIsEnumerable = objectProto$4.propertyIsEnumerable;
+var nativeGetSymbols = Object.getOwnPropertySymbols;
+var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
+ if (object == null) {
+ return [];
+ }
+ object = Object(object);
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
+ return propertyIsEnumerable.call(object, symbol);
+ });
+};
+var getSymbols$1 = getSymbols;
+function baseGetAllKeys(object, keysFunc, symbolsFunc) {
+ var result = keysFunc(object);
+ return isArray$2(object) ? result : arrayPush(result, symbolsFunc(object));
+}
+function getAllKeys(object) {
+ return baseGetAllKeys(object, keys, getSymbols$1);
+}
+var DataView$1 = getNative(root$1, "DataView");
+var DataView$2 = DataView$1;
+var Promise$1 = getNative(root$1, "Promise");
+var Promise$2 = Promise$1;
+var Set$1 = getNative(root$1, "Set");
+var Set$2 = Set$1;
+var mapTag$2 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$2 = "[object Set]", weakMapTag = "[object WeakMap]";
+var dataViewTag$1 = "[object DataView]";
+var dataViewCtorString = toSource(DataView$2), mapCtorString = toSource(Map$2), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$2), weakMapCtorString = toSource(WeakMap$2);
+var getTag$1 = baseGetTag;
+if (DataView$2 && getTag$1(new DataView$2(new ArrayBuffer(1))) != dataViewTag$1 || Map$2 && getTag$1(new Map$2()) != mapTag$2 || Promise$2 && getTag$1(Promise$2.resolve()) != promiseTag || Set$2 && getTag$1(new Set$2()) != setTag$2 || WeakMap$2 && getTag$1(new WeakMap$2()) != weakMapTag) {
+ getTag$1 = function(value) {
+ var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
+ if (ctorString) {
+ switch (ctorString) {
+ case dataViewCtorString:
+ return dataViewTag$1;
+ case mapCtorString:
+ return mapTag$2;
+ case promiseCtorString:
+ return promiseTag;
+ case setCtorString:
+ return setTag$2;
+ case weakMapCtorString:
+ return weakMapTag;
+ }
+ }
+ return result;
+ };
+}
+var getTag$2 = getTag$1;
+var Uint8Array$1 = root$1.Uint8Array;
+var Uint8Array$2 = Uint8Array$1;
+var HASH_UNDEFINED = "__lodash_hash_undefined__";
+function setCacheAdd(value) {
+ this.__data__.set(value, HASH_UNDEFINED);
+ return this;
+}
+function setCacheHas(value) {
+ return this.__data__.has(value);
+}
+function SetCache(values) {
+ var index = -1, length = values == null ? 0 : values.length;
+ this.__data__ = new MapCache();
+ while (++index < length) {
+ this.add(values[index]);
+ }
+}
+SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
+SetCache.prototype.has = setCacheHas;
+function arraySome(array, predicate) {
+ var index = -1, length = array == null ? 0 : array.length;
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+}
+function cacheHas(cache, key) {
+ return cache.has(key);
+}
+var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
+function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
+ return false;
+ }
+ var arrStacked = stack.get(array);
+ var othStacked = stack.get(other);
+ if (arrStacked && othStacked) {
+ return arrStacked == other && othStacked == array;
+ }
+ var index = -1, result = true, seen2 = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
+ stack.set(array, other);
+ stack.set(other, array);
+ while (++index < arrLength) {
+ var arrValue = array[index], othValue = other[index];
+ if (customizer) {
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
+ }
+ if (compared !== void 0) {
+ if (compared) {
+ continue;
+ }
+ result = false;
+ break;
+ }
+ if (seen2) {
+ if (!arraySome(other, function(othValue2, othIndex) {
+ if (!cacheHas(seen2, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
+ return seen2.push(othIndex);
+ }
+ })) {
+ result = false;
+ break;
+ }
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
+ result = false;
+ break;
+ }
+ }
+ stack["delete"](array);
+ stack["delete"](other);
+ return result;
+}
+function mapToArray(map) {
+ var index = -1, result = Array(map.size);
+ map.forEach(function(value, key) {
+ result[++index] = [key, value];
+ });
+ return result;
+}
+function setToArray(set2) {
+ var index = -1, result = Array(set2.size);
+ set2.forEach(function(value) {
+ result[++index] = value;
+ });
+ return result;
+}
+var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
+var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag$1 = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag$1 = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
+var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
+var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
+function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
+ switch (tag) {
+ case dataViewTag:
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
+ return false;
+ }
+ object = object.buffer;
+ other = other.buffer;
+ case arrayBufferTag:
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$2(object), new Uint8Array$2(other))) {
+ return false;
+ }
+ return true;
+ case boolTag:
+ case dateTag:
+ case numberTag:
+ return eq(+object, +other);
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+ case regexpTag:
+ case stringTag:
+ return object == other + "";
+ case mapTag$1:
+ var convert = mapToArray;
+ case setTag$1:
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
+ convert || (convert = setToArray);
+ if (object.size != other.size && !isPartial) {
+ return false;
+ }
+ var stacked = stack.get(object);
+ if (stacked) {
+ return stacked == other;
+ }
+ bitmask |= COMPARE_UNORDERED_FLAG$2;
+ stack.set(object, other);
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
+ stack["delete"](object);
+ return result;
+ case symbolTag:
+ if (symbolValueOf) {
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
+ }
+ }
+ return false;
+}
+var COMPARE_PARTIAL_FLAG$3 = 1;
+var objectProto$3 = Object.prototype;
+var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
+function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
+ if (objLength != othLength && !isPartial) {
+ return false;
+ }
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (!(isPartial ? key in other : hasOwnProperty$3.call(other, key))) {
+ return false;
+ }
+ }
+ var objStacked = stack.get(object);
+ var othStacked = stack.get(other);
+ if (objStacked && othStacked) {
+ return objStacked == other && othStacked == object;
+ }
+ var result = true;
+ stack.set(object, other);
+ stack.set(other, object);
+ var skipCtor = isPartial;
+ while (++index < objLength) {
+ key = objProps[index];
+ var objValue = object[key], othValue = other[key];
+ if (customizer) {
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
+ }
+ if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
+ result = false;
+ break;
+ }
+ skipCtor || (skipCtor = key == "constructor");
+ }
+ if (result && !skipCtor) {
+ var objCtor = object.constructor, othCtor = other.constructor;
+ if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
+ result = false;
+ }
+ }
+ stack["delete"](object);
+ stack["delete"](other);
+ return result;
+}
+var COMPARE_PARTIAL_FLAG$2 = 1;
+var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
+var objectProto$2 = Object.prototype;
+var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
+function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
+ var objIsArr = isArray$2(object), othIsArr = isArray$2(other), objTag = objIsArr ? arrayTag : getTag$2(object), othTag = othIsArr ? arrayTag : getTag$2(other);
+ objTag = objTag == argsTag ? objectTag : objTag;
+ othTag = othTag == argsTag ? objectTag : othTag;
+ var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
+ if (isSameTag && isBuffer$1(object)) {
+ if (!isBuffer$1(other)) {
+ return false;
+ }
+ objIsArr = true;
+ objIsObj = false;
+ }
+ if (isSameTag && !objIsObj) {
+ stack || (stack = new Stack());
+ return objIsArr || isTypedArray$1(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
+ }
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
+ var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$2.call(other, "__wrapped__");
+ if (objIsWrapped || othIsWrapped) {
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
+ stack || (stack = new Stack());
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ stack || (stack = new Stack());
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
+}
+function baseIsEqual(value, other, bitmask, customizer, stack) {
+ if (value === other) {
+ return true;
+ }
+ if (value == null || other == null || !isObjectLike$1(value) && !isObjectLike$1(other)) {
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
+}
+var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
+function baseIsMatch(object, source, matchData, customizer) {
+ var index = matchData.length, length = index, noCustomizer = !customizer;
+ if (object == null) {
+ return !length;
+ }
+ object = Object(object);
+ while (index--) {
+ var data = matchData[index];
+ if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
+ return false;
+ }
+ }
+ while (++index < length) {
+ data = matchData[index];
+ var key = data[0], objValue = object[key], srcValue = data[1];
+ if (noCustomizer && data[2]) {
+ if (objValue === void 0 && !(key in object)) {
+ return false;
+ }
+ } else {
+ var stack = new Stack();
+ if (customizer) {
+ var result = customizer(objValue, srcValue, key, object, source, stack);
+ }
+ if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+function isStrictComparable(value) {
+ return value === value && !isObject$1(value);
+}
+function getMatchData(object) {
+ var result = keys(object), length = result.length;
+ while (length--) {
+ var key = result[length], value = object[key];
+ result[length] = [key, value, isStrictComparable(value)];
+ }
+ return result;
+}
+function matchesStrictComparable(key, srcValue) {
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
+ };
+}
+function baseMatches(source) {
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ return matchesStrictComparable(matchData[0][0], matchData[0][1]);
+ }
+ return function(object) {
+ return object === source || baseIsMatch(object, source, matchData);
+ };
+}
+function baseHasIn(object, key) {
+ return object != null && key in Object(object);
+}
+function hasPath(object, path, hasFunc) {
+ path = castPath(path, object);
+ var index = -1, length = path.length, result = false;
+ while (++index < length) {
+ var key = toKey(path[index]);
+ if (!(result = object != null && hasFunc(object, key))) {
+ break;
+ }
+ object = object[key];
+ }
+ if (result || ++index != length) {
+ return result;
+ }
+ length = object == null ? 0 : object.length;
+ return !!length && isLength(length) && isIndex(key, length) && (isArray$2(object) || isArguments$1(object));
+}
+function hasIn(object, path) {
+ return object != null && hasPath(object, path, baseHasIn);
+}
+var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
+function baseMatchesProperty(path, srcValue) {
+ if (isKey(path) && isStrictComparable(srcValue)) {
+ return matchesStrictComparable(toKey(path), srcValue);
+ }
+ return function(object) {
+ var objValue = get$1(object, path);
+ return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
+ };
+}
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? void 0 : object[key];
+ };
+}
+function basePropertyDeep(path) {
+ return function(object) {
+ return baseGet(object, path);
+ };
+}
+function property(path) {
+ return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
+}
+function baseIteratee(value) {
+ if (typeof value == "function") {
+ return value;
+ }
+ if (value == null) {
+ return identity;
+ }
+ if (typeof value == "object") {
+ return isArray$2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
+ }
+ return property(value);
+}
+function arrayAggregator(array, setter, iteratee, accumulator) {
+ var index = -1, length = array == null ? 0 : array.length;
+ while (++index < length) {
+ var value = array[index];
+ setter(accumulator, value, iteratee(value), array);
+ }
+ return accumulator;
+}
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var index = -1, iterable = Object(object), props2 = keysFunc(object), length = props2.length;
+ while (length--) {
+ var key = props2[fromRight ? length : ++index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+var baseFor = createBaseFor();
+var baseFor$1 = baseFor;
+function baseForOwn(object, iteratee) {
+ return object && baseFor$1(object, iteratee, keys);
+}
+function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ if (collection == null) {
+ return collection;
+ }
+ if (!isArrayLike(collection)) {
+ return eachFunc(collection, iteratee);
+ }
+ var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
+ while (fromRight ? index-- : ++index < length) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+}
+var baseEach = createBaseEach(baseForOwn);
+var baseEach$1 = baseEach;
+function baseAggregator(collection, setter, iteratee, accumulator) {
+ baseEach$1(collection, function(value, key, collection2) {
+ setter(accumulator, value, iteratee(value), collection2);
+ });
+ return accumulator;
+}
+function createAggregator(setter, initializer) {
+ return function(collection, iteratee) {
+ var func = isArray$2(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
+ return func(collection, setter, baseIteratee(iteratee), accumulator);
+ };
+}
+function baseMap(collection, iteratee) {
+ var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
+ baseEach$1(collection, function(value, key, collection2) {
+ result[++index] = iteratee(value, key, collection2);
+ });
+ return result;
+}
+var objectProto$1 = Object.prototype;
+var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
+var groupBy = createAggregator(function(result, value, key) {
+ if (hasOwnProperty$1.call(result, key)) {
+ result[key].push(value);
+ } else {
+ baseAssignValue(result, key, [value]);
+ }
+});
+var groupBy$1 = groupBy;
+var mapTag = "[object Map]", setTag = "[object Set]";
+var objectProto = Object.prototype;
+var hasOwnProperty = objectProto.hasOwnProperty;
+function isEmpty(value) {
+ if (value == null) {
+ return true;
+ }
+ if (isArrayLike(value) && (isArray$2(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer$1(value) || isTypedArray$1(value) || isArguments$1(value))) {
+ return !value.length;
+ }
+ var tag = getTag$2(value);
+ if (tag == mapTag || tag == setTag) {
+ return !value.size;
+ }
+ if (isPrototype(value)) {
+ return !baseKeys(value).length;
+ }
+ for (var key in value) {
+ if (hasOwnProperty.call(value, key)) {
+ return false;
+ }
+ }
+ return true;
+}
+function baseSum(array, iteratee) {
+ var result, index = -1, length = array.length;
+ while (++index < length) {
+ var current = iteratee(array[index]);
+ if (current !== void 0) {
+ result = result === void 0 ? current : result + current;
+ }
+ }
+ return result;
+}
+function baseSortBy(array, comparer) {
+ var length = array.length;
+ array.sort(comparer);
+ while (length--) {
+ array[length] = array[length].value;
+ }
+ return array;
+}
+function compareAscending(value, other) {
+ if (value !== other) {
+ var valIsDefined = value !== void 0, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
+ var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
+ if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
+ return 1;
+ }
+ if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
+ return -1;
+ }
+ }
+ return 0;
+}
+function compareMultiple(object, other, orders) {
+ var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
+ while (++index < length) {
+ var result = compareAscending(objCriteria[index], othCriteria[index]);
+ if (result) {
+ if (index >= ordersLength) {
+ return result;
+ }
+ var order = orders[index];
+ return result * (order == "desc" ? -1 : 1);
+ }
+ }
+ return object.index - other.index;
+}
+function baseOrderBy(collection, iteratees, orders) {
+ if (iteratees.length) {
+ iteratees = arrayMap(iteratees, function(iteratee) {
+ if (isArray$2(iteratee)) {
+ return function(value) {
+ return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
+ };
+ }
+ return iteratee;
+ });
+ } else {
+ iteratees = [identity];
+ }
+ var index = -1;
+ iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
+ var result = baseMap(collection, function(value, key, collection2) {
+ var criteria = arrayMap(iteratees, function(iteratee) {
+ return iteratee(value);
+ });
+ return { "criteria": criteria, "index": ++index, "value": value };
+ });
+ return baseSortBy(result, function(object, other) {
+ return compareMultiple(object, other, orders);
+ });
+}
+function orderBy(collection, iteratees, orders, guard) {
+ if (collection == null) {
+ return [];
+ }
+ if (!isArray$2(iteratees)) {
+ iteratees = iteratees == null ? [] : [iteratees];
+ }
+ orders = guard ? void 0 : orders;
+ if (!isArray$2(orders)) {
+ orders = orders == null ? [] : [orders];
+ }
+ return baseOrderBy(collection, iteratees, orders);
+}
+var startCase = createCompounder(function(result, word, index) {
+ return result + (index ? " " : "") + upperFirst$1(word);
+});
+var startCase$1 = startCase;
+function sum(array) {
+ return array && array.length ? baseSum(array, identity) : 0;
+}
+const _hoisted_1$J = {
+ key: 0,
+ class: "text-base font-mono"
+};
+const _hoisted_2$A = {
+ key: 1,
+ class: "text-xs opacity-80 font-mono"
+};
+const _hoisted_3$w = {
+ key: 0,
+ class: "mb-2"
+};
+const _hoisted_4$f = { class: "break-all mb-1" };
+const _hoisted_5$a = { class: "break-all opacity-80" };
+const _hoisted_6$6 = {
+ key: 1,
+ class: "mb-2"
+};
+const _hoisted_7$5 = { class: "break-all mb-1" };
+const _hoisted_8$5 = { class: "break-all opacity-80" };
+const _hoisted_9$5 = { class: "mb-1" };
+const _hoisted_10$4 = { class: "opacity-80 break-all" };
+const _hoisted_11$4 = {
+ key: 0,
+ class: "text-base font-mono"
+};
+const _hoisted_12$2 = {
+ key: 1,
+ class: "text-xs opacity-80 font-mono"
+};
+const _sfc_main$w = defineComponent({
+ __name: "ResultsCell",
+ props: {
+ report: {},
+ column: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const value = computed(() => {
+ return get$1(props2.report, props2.column.key);
+ });
+ return (_ctx, _cache) => {
+ var _a2, _b2, _c, _d, _e;
+ const _component_audit_result = __unplugin_components_0$6;
+ const _component_audit_result_items_length = _sfc_main$x;
+ const _component_tooltip = _sfc_main$z;
+ return openBlock(), createElementBlock("div", {
+ class: normalizeClass([[`col-span-${_ctx.column.cols || "2"}`, ..._ctx.column.classes ? _ctx.column.classes : []], "flex items-center"])
+ }, [
+ renderSlot(_ctx.$slots, "default"),
+ ((_a2 = unref(value)) == null ? void 0 : _a2.scoreDisplayMode) === "error" ? (openBlock(), createBlock(_component_audit_result, {
+ key: 0,
+ value: { score: 0, displayValue: unref(value).errorMessage }
+ }, null, 8, ["value"])) : ((_b2 = unref(value)) == null ? void 0 : _b2.scoreDisplayMode) === "notApplicable" ? (openBlock(), createBlock(_component_audit_result, {
+ key: 1,
+ value: { score: null, displayValue: "n/a" }
+ })) : _ctx.column.component ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.column.component), {
+ key: 2,
+ report: _ctx.report,
+ column: _ctx.column,
+ value: unref(value)
+ }, null, 8, ["report", "column", "value"])) : !!unref(value) ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
+ ((_d = (_c = unref(value).details) == null ? void 0 : _c.items) == null ? void 0 : _d.length) > 0 ? (openBlock(), createBlock(_component_tooltip, { key: 0 }, {
+ tooltip: withCtx(() => [
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(value).details.items, (item, key) => {
+ var _a3, _b3;
+ return openBlock(), createElementBlock("div", {
+ key,
+ class: "mb-2 flex text-xs"
+ }, [
+ ((_a3 = item.node) == null ? void 0 : _a3.nodeLabel) ? (openBlock(), createElementBlock("div", _hoisted_3$w, [
+ createBaseVNode("div", _hoisted_4$f, toDisplayString((_b3 = item.node) == null ? void 0 : _b3.nodeLabel), 1),
+ createBaseVNode("div", _hoisted_5$a, toDisplayString(item.node.snippet), 1)
+ ])) : item.description && item.sourceLocation ? (openBlock(), createElementBlock("div", _hoisted_6$6, [
+ createBaseVNode("div", _hoisted_7$5, toDisplayString(item.description), 1),
+ createBaseVNode("div", _hoisted_8$5, toDisplayString(item.sourceLocation.url), 1)
+ ])) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(item, (v2, k2) => {
+ return openBlock(), createElementBlock("div", { key: k2 }, [
+ createBaseVNode("span", _hoisted_9$5, toDisplayString(k2) + ":", 1),
+ createTextVNode(),
+ createBaseVNode("span", _hoisted_10$4, toDisplayString(v2), 1)
+ ]);
+ }), 128))
+ ]);
+ }), 128))
+ ]),
+ default: withCtx(() => {
+ var _a3;
+ return [
+ typeof unref(value) === "number" ? (openBlock(), createElementBlock("div", _hoisted_1$J, toDisplayString(unref(value)), 1)) : typeof unref(value) === "string" ? (openBlock(), createElementBlock("div", _hoisted_2$A, toDisplayString(unref(value)), 1)) : typeof unref(value).displayValue !== "undefined" ? (openBlock(), createBlock(_component_audit_result, {
+ key: 2,
+ value: unref(value)
+ }, null, 8, ["value"])) : !!((_a3 = unref(value).details) == null ? void 0 : _a3.items) ? (openBlock(), createBlock(_component_audit_result_items_length, {
+ key: 3,
+ value: unref(value)
+ }, null, 8, ["value"])) : typeof unref(value).score !== "undefined" ? (openBlock(), createBlock(_component_audit_result, {
+ key: 4,
+ value: { score: unref(value).score }
+ }, null, 8, ["value"])) : createCommentVNode("", true)
+ ];
+ }),
+ _: 1
+ })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
+ typeof unref(value) === "number" ? (openBlock(), createElementBlock("div", _hoisted_11$4, toDisplayString(unref(value)), 1)) : typeof unref(value) === "string" ? (openBlock(), createElementBlock("div", _hoisted_12$2, toDisplayString(unref(value)), 1)) : typeof unref(value).displayValue !== "undefined" ? (openBlock(), createBlock(_component_audit_result, {
+ key: 2,
+ value: unref(value)
+ }, null, 8, ["value"])) : !!((_e = unref(value).details) == null ? void 0 : _e.items) ? (openBlock(), createBlock(_component_audit_result_items_length, {
+ key: 3,
+ value: unref(value)
+ }, null, 8, ["value"])) : typeof unref(value).score !== "undefined" ? (openBlock(), createBlock(_component_audit_result, {
+ key: 4,
+ value: { score: unref(value).score }
+ }, null, 8, ["value"])) : createCommentVNode("", true)
+ ], 64))
+ ], 64)) : createCommentVNode("", true)
+ ], 2);
+ };
+ }
+});
+var _a$1;
+const isClient = typeof window !== "undefined";
+const isString$1 = (val) => typeof val === "string";
+const noop = () => {
+};
+isClient && ((_a$1 = window == null ? void 0 : window.navigator) == null ? void 0 : _a$1.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
+function createFilterWrapper(filter, fn) {
+ function wrapper(...args) {
+ filter(() => fn.apply(this, args), { fn, thisArg: this, args });
+ }
+ return wrapper;
+}
+const bypassFilter = (invoke) => {
+ return invoke();
+};
+function pausableFilter(extendFilter = bypassFilter) {
+ const isActive = ref(true);
+ function pause() {
+ isActive.value = false;
+ }
+ function resume() {
+ isActive.value = true;
+ }
+ const eventFilter = (...args) => {
+ if (isActive.value)
+ extendFilter(...args);
+ };
+ return { isActive, pause, resume, eventFilter };
+}
+function promiseTimeout(ms, throwOnTimeout = false, reason = "Timeout") {
+ return new Promise((resolve2, reject) => {
+ if (throwOnTimeout)
+ setTimeout(() => reject(reason), ms);
+ else
+ setTimeout(resolve2, ms);
+ });
+}
+function containsProp(obj, ...props2) {
+ return props2.some((k2) => k2 in obj);
+}
+function createEventHook() {
+ const fns = [];
+ const off = (fn) => {
+ const index = fns.indexOf(fn);
+ if (index !== -1)
+ fns.splice(index, 1);
+ };
+ const on = (fn) => {
+ fns.push(fn);
+ return {
+ off: () => off(fn)
+ };
+ };
+ const trigger2 = (param) => {
+ fns.forEach((fn) => fn(param));
+ };
+ return {
+ on,
+ off,
+ trigger: trigger2
+ };
+}
+function tryOnScopeDispose(fn) {
+ if (getCurrentScope()) {
+ onScopeDispose(fn);
+ return true;
+ }
+ return false;
+}
+function until(r2) {
+ let isNot = false;
+ function toMatch(condition, { flush = "sync", deep = false, timeout, throwOnTimeout } = {}) {
+ let stop = null;
+ const watcher = new Promise((resolve2) => {
+ stop = watch(r2, (v2) => {
+ if (condition(v2) !== isNot) {
+ stop == null ? void 0 : stop();
+ resolve2(v2);
+ }
+ }, {
+ flush,
+ deep,
+ immediate: true
+ });
+ });
+ const promises = [watcher];
+ if (timeout != null) {
+ promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => unref(r2)).finally(() => stop == null ? void 0 : stop()));
+ }
+ return Promise.race(promises);
+ }
+ function toBe(value, options) {
+ if (!isRef(value))
+ return toMatch((v2) => v2 === value, options);
+ const { flush = "sync", deep = false, timeout, throwOnTimeout } = options != null ? options : {};
+ let stop = null;
+ const watcher = new Promise((resolve2) => {
+ stop = watch([r2, value], ([v1, v2]) => {
+ if (isNot !== (v1 === v2)) {
+ stop == null ? void 0 : stop();
+ resolve2(v1);
+ }
+ }, {
+ flush,
+ deep,
+ immediate: true
+ });
+ });
+ const promises = [watcher];
+ if (timeout != null) {
+ promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => unref(r2)).finally(() => {
+ stop == null ? void 0 : stop();
+ return unref(r2);
+ }));
+ }
+ return Promise.race(promises);
+ }
+ function toBeTruthy(options) {
+ return toMatch((v2) => Boolean(v2), options);
+ }
+ function toBeNull(options) {
+ return toBe(null, options);
+ }
+ function toBeUndefined(options) {
+ return toBe(void 0, options);
+ }
+ function toBeNaN(options) {
+ return toMatch(Number.isNaN, options);
+ }
+ function toContains(value, options) {
+ return toMatch((v2) => {
+ const array = Array.from(v2);
+ return array.includes(value) || array.includes(unref(value));
+ }, options);
+ }
+ function changed(options) {
+ return changedTimes(1, options);
+ }
+ function changedTimes(n2 = 1, options) {
+ let count = -1;
+ return toMatch(() => {
+ count += 1;
+ return count >= n2;
+ }, options);
+ }
+ if (Array.isArray(unref(r2))) {
+ const instance = {
+ toMatch,
+ toContains,
+ changed,
+ changedTimes,
+ get not() {
+ isNot = !isNot;
+ return this;
+ }
+ };
+ return instance;
+ } else {
+ const instance = {
+ toMatch,
+ toBe,
+ toBeTruthy,
+ toBeNull,
+ toBeNaN,
+ toBeUndefined,
+ changed,
+ changedTimes,
+ get not() {
+ isNot = !isNot;
+ return this;
+ }
+ };
+ return instance;
+ }
+}
+function useTimeoutFn(cb, interval, options = {}) {
+ const {
+ immediate = true
+ } = options;
+ const isPending = ref(false);
+ let timer = null;
+ function clear2() {
+ if (timer) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ }
+ function stop() {
+ isPending.value = false;
+ clear2();
+ }
+ function start(...args) {
+ clear2();
+ isPending.value = true;
+ timer = setTimeout(() => {
+ isPending.value = false;
+ timer = null;
+ cb(...args);
+ }, unref(interval));
+ }
+ if (immediate) {
+ isPending.value = true;
+ if (isClient)
+ start();
+ }
+ tryOnScopeDispose(stop);
+ return {
+ isPending,
+ start,
+ stop
+ };
+}
+function useToggle(initialValue = false, options = {}) {
+ const {
+ truthyValue = true,
+ falsyValue = false
+ } = options;
+ const valueIsRef = isRef(initialValue);
+ const innerValue = ref(initialValue);
+ function toggle(value) {
+ if (arguments.length) {
+ innerValue.value = value;
+ return innerValue.value;
+ } else {
+ innerValue.value = innerValue.value === unref(truthyValue) ? unref(falsyValue) : unref(truthyValue);
+ return innerValue.value;
+ }
+ }
+ if (valueIsRef)
+ return toggle;
+ else
+ return [innerValue, toggle];
+}
+var __getOwnPropSymbols$6$1 = Object.getOwnPropertySymbols;
+var __hasOwnProp$6$1 = Object.prototype.hasOwnProperty;
+var __propIsEnum$6$1 = Object.prototype.propertyIsEnumerable;
+var __objRest$5 = (source, exclude) => {
+ var target = {};
+ for (var prop in source)
+ if (__hasOwnProp$6$1.call(source, prop) && exclude.indexOf(prop) < 0)
+ target[prop] = source[prop];
+ if (source != null && __getOwnPropSymbols$6$1)
+ for (var prop of __getOwnPropSymbols$6$1(source)) {
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6$1.call(source, prop))
+ target[prop] = source[prop];
+ }
+ return target;
+};
+function watchWithFilter(source, cb, options = {}) {
+ const _a2 = options, {
+ eventFilter = bypassFilter
+ } = _a2, watchOptions = __objRest$5(_a2, [
+ "eventFilter"
+ ]);
+ return watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
+}
+var __defProp$2 = Object.defineProperty;
+var __defProps$2 = Object.defineProperties;
+var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
+var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
+var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
+var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
+var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
+var __spreadValues$2 = (a2, b3) => {
+ for (var prop in b3 || (b3 = {}))
+ if (__hasOwnProp$2.call(b3, prop))
+ __defNormalProp$2(a2, prop, b3[prop]);
+ if (__getOwnPropSymbols$2)
+ for (var prop of __getOwnPropSymbols$2(b3)) {
+ if (__propIsEnum$2.call(b3, prop))
+ __defNormalProp$2(a2, prop, b3[prop]);
+ }
+ return a2;
+};
+var __spreadProps$2 = (a2, b3) => __defProps$2(a2, __getOwnPropDescs$2(b3));
+var __objRest$1$1 = (source, exclude) => {
+ var target = {};
+ for (var prop in source)
+ if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
+ target[prop] = source[prop];
+ if (source != null && __getOwnPropSymbols$2)
+ for (var prop of __getOwnPropSymbols$2(source)) {
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
+ target[prop] = source[prop];
+ }
+ return target;
+};
+function watchPausable(source, cb, options = {}) {
+ const _a2 = options, {
+ eventFilter: filter
+ } = _a2, watchOptions = __objRest$1$1(_a2, [
+ "eventFilter"
+ ]);
+ const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
+ const stop = watchWithFilter(source, cb, __spreadProps$2(__spreadValues$2({}, watchOptions), {
+ eventFilter
+ }));
+ return { stop, pause, resume, isActive };
+}
+function unrefElement(elRef) {
+ var _a2;
+ const plain = unref(elRef);
+ return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
+}
+const defaultWindow = isClient ? window : void 0;
+const defaultDocument = isClient ? window.document : void 0;
+function useEventListener(...args) {
+ let target;
+ let event;
+ let listener;
+ let options;
+ if (isString$1(args[0])) {
+ [event, listener, options] = args;
+ target = defaultWindow;
+ } else {
+ [target, event, listener, options] = args;
+ }
+ if (!target)
+ return noop;
+ let cleanup = noop;
+ const stopWatch = watch(() => unrefElement(target), (el) => {
+ cleanup();
+ if (!el)
+ return;
+ el.addEventListener(event, listener, options);
+ cleanup = () => {
+ el.removeEventListener(event, listener, options);
+ cleanup = noop;
+ };
+ }, { immediate: true, flush: "post" });
+ const stop = () => {
+ stopWatch();
+ cleanup();
+ };
+ tryOnScopeDispose(stop);
+ return stop;
+}
+const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
+const globalKey = "__vueuse_ssr_handlers__";
+_global[globalKey] = _global[globalKey] || {};
+const handlers = _global[globalKey];
+function getSSRHandler(key, fallback) {
+ return handlers[key] || fallback;
+}
+function guessSerializerType(rawInit) {
+ return rawInit == null ? "any" : rawInit instanceof Set ? "set" : rawInit instanceof Map ? "map" : rawInit instanceof Date ? "date" : typeof rawInit === "boolean" ? "boolean" : typeof rawInit === "string" ? "string" : typeof rawInit === "object" ? "object" : Array.isArray(rawInit) ? "object" : !Number.isNaN(rawInit) ? "number" : "any";
+}
+const StorageSerializers = {
+ boolean: {
+ read: (v2) => v2 === "true",
+ write: (v2) => String(v2)
+ },
+ object: {
+ read: (v2) => JSON.parse(v2),
+ write: (v2) => JSON.stringify(v2)
+ },
+ number: {
+ read: (v2) => Number.parseFloat(v2),
+ write: (v2) => String(v2)
+ },
+ any: {
+ read: (v2) => v2,
+ write: (v2) => String(v2)
+ },
+ string: {
+ read: (v2) => v2,
+ write: (v2) => String(v2)
+ },
+ map: {
+ read: (v2) => new Map(JSON.parse(v2)),
+ write: (v2) => JSON.stringify(Array.from(v2.entries()))
+ },
+ set: {
+ read: (v2) => new Set(JSON.parse(v2)),
+ write: (v2) => JSON.stringify(Array.from(v2))
+ },
+ date: {
+ read: (v2) => new Date(v2),
+ write: (v2) => v2.toISOString()
+ }
+};
+function useStorage(key, initialValue, storage, options = {}) {
+ var _a2;
+ const {
+ flush = "pre",
+ deep = true,
+ listenToStorageChanges = true,
+ writeDefaults = true,
+ shallow,
+ window: window2 = defaultWindow,
+ eventFilter,
+ onError = (e2) => {
+ console.error(e2);
+ }
+ } = options;
+ const data = (shallow ? shallowRef : ref)(initialValue);
+ if (!storage) {
+ try {
+ storage = getSSRHandler("getDefaultStorage", () => {
+ var _a22;
+ return (_a22 = defaultWindow) == null ? void 0 : _a22.localStorage;
+ })();
+ } catch (e2) {
+ onError(e2);
+ }
+ }
+ if (!storage)
+ return data;
+ const rawInit = unref(initialValue);
+ const type = guessSerializerType(rawInit);
+ const serializer = (_a2 = options.serializer) != null ? _a2 : StorageSerializers[type];
+ const { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, () => write(data.value), { flush, deep, eventFilter });
+ if (window2 && listenToStorageChanges)
+ useEventListener(window2, "storage", update);
+ update();
+ return data;
+ function write(v2) {
+ try {
+ if (v2 == null)
+ storage.removeItem(key);
+ else
+ storage.setItem(key, serializer.write(v2));
+ } catch (e2) {
+ onError(e2);
+ }
+ }
+ function read(event) {
+ if (event && event.key !== key)
+ return;
+ pauseWatch();
+ try {
+ const rawValue = event ? event.newValue : storage.getItem(key);
+ if (rawValue == null) {
+ if (writeDefaults && rawInit !== null)
+ storage.setItem(key, serializer.write(rawInit));
+ return rawInit;
+ } else if (typeof rawValue !== "string") {
+ return rawValue;
+ } else {
+ return serializer.read(rawValue);
+ }
+ } catch (e2) {
+ onError(e2);
+ } finally {
+ resumeWatch();
+ }
+ }
+ function update(event) {
+ if (event && event.key !== key)
+ return;
+ data.value = read(event);
+ }
+}
+function useElementHover(el) {
+ const isHovered = ref(false);
+ useEventListener(el, "mouseenter", () => isHovered.value = true);
+ useEventListener(el, "mouseleave", () => isHovered.value = false);
+ return isHovered;
+}
+var __defProp$b = Object.defineProperty;
+var __defProps$3 = Object.defineProperties;
+var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
+var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
+var __hasOwnProp$c = Object.prototype.hasOwnProperty;
+var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
+var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
+var __spreadValues$b = (a2, b3) => {
+ for (var prop in b3 || (b3 = {}))
+ if (__hasOwnProp$c.call(b3, prop))
+ __defNormalProp$b(a2, prop, b3[prop]);
+ if (__getOwnPropSymbols$c)
+ for (var prop of __getOwnPropSymbols$c(b3)) {
+ if (__propIsEnum$c.call(b3, prop))
+ __defNormalProp$b(a2, prop, b3[prop]);
+ }
+ return a2;
+};
+var __spreadProps$3 = (a2, b3) => __defProps$3(a2, __getOwnPropDescs$3(b3));
+const payloadMapping = {
+ json: "application/json",
+ text: "text/plain",
+ formData: "multipart/form-data"
+};
+function isFetchOptions(obj) {
+ return containsProp(obj, "immediate", "refetch", "initialData", "timeout", "beforeFetch", "afterFetch", "onFetchError", "fetch");
+}
+function headersToObject(headers) {
+ if (typeof Headers !== "undefined" && headers instanceof Headers)
+ return Object.fromEntries([...headers.entries()]);
+ return headers;
+}
+function createFetch(config = {}) {
+ const _options = config.options || {};
+ const _fetchOptions = config.fetchOptions || {};
+ function useFactoryFetch(url, ...args) {
+ const computedUrl = computed(() => config.baseUrl ? joinPaths(unref(config.baseUrl), unref(url)) : unref(url));
+ let options = _options;
+ let fetchOptions = _fetchOptions;
+ if (args.length > 0) {
+ if (isFetchOptions(args[0])) {
+ options = __spreadValues$b(__spreadValues$b({}, options), args[0]);
+ } else {
+ fetchOptions = __spreadProps$3(__spreadValues$b(__spreadValues$b({}, fetchOptions), args[0]), {
+ headers: __spreadValues$b(__spreadValues$b({}, headersToObject(fetchOptions.headers) || {}), headersToObject(args[0].headers) || {})
+ });
+ }
+ }
+ if (args.length > 1 && isFetchOptions(args[1]))
+ options = __spreadValues$b(__spreadValues$b({}, options), args[1]);
+ return useFetch$1(computedUrl, fetchOptions, options);
+ }
+ return useFactoryFetch;
+}
+function useFetch$1(url, ...args) {
+ var _a2;
+ const supportsAbort = typeof AbortController === "function";
+ let fetchOptions = {};
+ let options = { immediate: true, refetch: false, timeout: 0 };
+ const config = {
+ method: "GET",
+ type: "text",
+ payload: void 0
+ };
+ if (args.length > 0) {
+ if (isFetchOptions(args[0]))
+ options = __spreadValues$b(__spreadValues$b({}, options), args[0]);
+ else
+ fetchOptions = args[0];
+ }
+ if (args.length > 1) {
+ if (isFetchOptions(args[1]))
+ options = __spreadValues$b(__spreadValues$b({}, options), args[1]);
+ }
+ const {
+ fetch: fetch2 = (_a2 = defaultWindow) == null ? void 0 : _a2.fetch,
+ initialData,
+ timeout
+ } = options;
+ const responseEvent = createEventHook();
+ const errorEvent = createEventHook();
+ const finallyEvent = createEventHook();
+ const isFinished = ref(false);
+ const isFetching = ref(false);
+ const aborted = ref(false);
+ const statusCode = ref(null);
+ const response = shallowRef(null);
+ const error = shallowRef(null);
+ const data = shallowRef(initialData);
+ const canAbort = computed(() => supportsAbort && isFetching.value);
+ let controller;
+ let timer;
+ const abort = () => {
+ if (supportsAbort && controller)
+ controller.abort();
+ };
+ const loading2 = (isLoading) => {
+ isFetching.value = isLoading;
+ isFinished.value = !isLoading;
+ };
+ if (timeout)
+ timer = useTimeoutFn(abort, timeout, { immediate: false });
+ const execute = async (throwOnFailed = false) => {
+ var _a22;
+ loading2(true);
+ error.value = null;
+ statusCode.value = null;
+ aborted.value = false;
+ controller = void 0;
+ if (supportsAbort) {
+ controller = new AbortController();
+ controller.signal.onabort = () => aborted.value = true;
+ fetchOptions = __spreadProps$3(__spreadValues$b({}, fetchOptions), {
+ signal: controller.signal
+ });
+ }
+ const defaultFetchOptions = {
+ method: config.method,
+ headers: {}
+ };
+ if (config.payload) {
+ const headers = headersToObject(defaultFetchOptions.headers);
+ if (config.payloadType)
+ headers["Content-Type"] = (_a22 = payloadMapping[config.payloadType]) != null ? _a22 : config.payloadType;
+ defaultFetchOptions.body = config.payloadType === "json" ? JSON.stringify(unref(config.payload)) : unref(config.payload);
+ }
+ let isCanceled = false;
+ const context = { url: unref(url), options: __spreadValues$b(__spreadValues$b({}, defaultFetchOptions), fetchOptions), cancel: () => {
+ isCanceled = true;
+ } };
+ if (options.beforeFetch)
+ Object.assign(context, await options.beforeFetch(context));
+ if (isCanceled || !fetch2) {
+ loading2(false);
+ return Promise.resolve(null);
+ }
+ let responseData = null;
+ if (timer)
+ timer.start();
+ return new Promise((resolve2, reject) => {
+ var _a3;
+ fetch2(context.url, __spreadProps$3(__spreadValues$b(__spreadValues$b({}, defaultFetchOptions), context.options), {
+ headers: __spreadValues$b(__spreadValues$b({}, headersToObject(defaultFetchOptions.headers)), headersToObject((_a3 = context.options) == null ? void 0 : _a3.headers))
+ })).then(async (fetchResponse) => {
+ response.value = fetchResponse;
+ statusCode.value = fetchResponse.status;
+ responseData = await fetchResponse[config.type]();
+ if (options.afterFetch && statusCode.value >= 200 && statusCode.value < 300)
+ ({ data: responseData } = await options.afterFetch({ data: responseData, response: fetchResponse }));
+ data.value = responseData;
+ if (!fetchResponse.ok)
+ throw new Error(fetchResponse.statusText);
+ responseEvent.trigger(fetchResponse);
+ return resolve2(fetchResponse);
+ }).catch(async (fetchError) => {
+ let errorData = fetchError.message || fetchError.name;
+ if (options.onFetchError)
+ ({ data: responseData, error: errorData } = await options.onFetchError({ data: responseData, error: fetchError, response: response.value }));
+ data.value = responseData;
+ error.value = errorData;
+ errorEvent.trigger(fetchError);
+ if (throwOnFailed)
+ return reject(fetchError);
+ return resolve2(null);
+ }).finally(() => {
+ loading2(false);
+ if (timer)
+ timer.stop();
+ finallyEvent.trigger(null);
+ });
+ });
+ };
+ watch(() => [
+ unref(url),
+ unref(options.refetch)
+ ], () => unref(options.refetch) && execute(), { deep: true });
+ const shell = {
+ isFinished,
+ statusCode,
+ response,
+ error,
+ data,
+ isFetching,
+ canAbort,
+ aborted,
+ abort,
+ execute,
+ onFetchResponse: responseEvent.on,
+ onFetchError: errorEvent.on,
+ onFetchFinally: finallyEvent.on,
+ get: setMethod("GET"),
+ put: setMethod("PUT"),
+ post: setMethod("POST"),
+ delete: setMethod("DELETE"),
+ patch: setMethod("PATCH"),
+ head: setMethod("HEAD"),
+ options: setMethod("OPTIONS"),
+ json: setType("json"),
+ text: setType("text"),
+ blob: setType("blob"),
+ arrayBuffer: setType("arrayBuffer"),
+ formData: setType("formData")
+ };
+ function setMethod(method) {
+ return (payload, payloadType) => {
+ if (!isFetching.value) {
+ config.method = method;
+ config.payload = payload;
+ config.payloadType = payloadType;
+ if (isRef(config.payload)) {
+ watch(() => [
+ unref(config.payload),
+ unref(options.refetch)
+ ], () => unref(options.refetch) && execute(), { deep: true });
+ }
+ if (!payloadType && unref(payload) && Object.getPrototypeOf(unref(payload)) === Object.prototype)
+ config.payloadType = "json";
+ return __spreadProps$3(__spreadValues$b({}, shell), {
+ then(onFulfilled, onRejected) {
+ return waitUntilFinished().then(onFulfilled, onRejected);
+ }
+ });
+ }
+ return void 0;
+ };
+ }
+ function waitUntilFinished() {
+ return new Promise((resolve2, reject) => {
+ until(isFinished).toBe(true).then(() => resolve2(shell)).catch((error2) => reject(error2));
+ });
+ }
+ function setType(type) {
+ return () => {
+ if (!isFetching.value) {
+ config.type = type;
+ return __spreadProps$3(__spreadValues$b({}, shell), {
+ then(onFulfilled, onRejected) {
+ return waitUntilFinished().then(onFulfilled, onRejected);
+ }
+ });
+ }
+ return void 0;
+ };
+ }
+ if (options.immediate)
+ setTimeout(execute, 0);
+ return __spreadProps$3(__spreadValues$b({}, shell), {
+ then(onFulfilled, onRejected) {
+ return waitUntilFinished().then(onFulfilled, onRejected);
+ }
+ });
+}
+function joinPaths(start, end) {
+ if (!start.endsWith("/") && !end.startsWith("/"))
+ return `${start}/${end}`;
+ return `${start}${end}`;
+}
+var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
+var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
+var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
+var __objRest$1 = (source, exclude) => {
+ var target = {};
+ for (var prop in source)
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
+ target[prop] = source[prop];
+ if (source != null && __getOwnPropSymbols$6)
+ for (var prop of __getOwnPropSymbols$6(source)) {
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
+ target[prop] = source[prop];
+ }
+ return target;
+};
+function useMutationObserver(target, callback, options = {}) {
+ const _a2 = options, { window: window2 = defaultWindow } = _a2, mutationOptions = __objRest$1(_a2, ["window"]);
+ let observer;
+ const isSupported = window2 && "MutationObserver" in window2;
+ const cleanup = () => {
+ if (observer) {
+ observer.disconnect();
+ observer = void 0;
+ }
+ };
+ const stopWatch = watch(() => unrefElement(target), (el) => {
+ cleanup();
+ if (isSupported && window2 && el) {
+ observer = new MutationObserver(callback);
+ observer.observe(el, mutationOptions);
+ }
+ }, { immediate: true });
+ const stop = () => {
+ cleanup();
+ stopWatch();
+ };
+ tryOnScopeDispose(stop);
+ return {
+ isSupported,
+ stop
+ };
+}
+var SwipeDirection;
+(function(SwipeDirection2) {
+ SwipeDirection2["UP"] = "UP";
+ SwipeDirection2["RIGHT"] = "RIGHT";
+ SwipeDirection2["DOWN"] = "DOWN";
+ SwipeDirection2["LEFT"] = "LEFT";
+ SwipeDirection2["NONE"] = "NONE";
+})(SwipeDirection || (SwipeDirection = {}));
+function useTitle(newTitle = null, options = {}) {
+ var _a2, _b2;
+ const {
+ document: document2 = defaultDocument,
+ observe = false,
+ titleTemplate = "%s"
+ } = options;
+ const title = ref((_a2 = newTitle != null ? newTitle : document2 == null ? void 0 : document2.title) != null ? _a2 : null);
+ watch(title, (t2, o2) => {
+ if (isString$1(t2) && t2 !== o2 && document2)
+ document2.title = titleTemplate.replace("%s", t2);
+ }, { immediate: true });
+ if (observe && document2) {
+ useMutationObserver((_b2 = document2.head) == null ? void 0 : _b2.querySelector("title"), () => {
+ if (document2 && document2.title !== title.value)
+ title.value = titleTemplate.replace("%s", document2.title);
+ }, { childList: true });
+ }
+ return title;
+}
+const mode = useStorage("vueuse-color-scheme", "dark");
+const isDark = computed({
+ get() {
+ return mode.value === "dark";
+ },
+ set(v2) {
+ mode.value = v2 ? "dark" : "light";
+ }
+});
+watch(isDark, () => {
+ const el = window == null ? void 0 : window.document.querySelector("html");
+ if (!el)
+ return;
+ if (isDark.value) {
+ el.classList.add("dark");
+ el.classList.remove("light");
+ } else {
+ el.classList.add("light");
+ el.classList.remove("dark");
+ }
+}, { flush: "post", immediate: true });
+const toggleDark = useToggle(isDark);
+const _hoisted_1$I = {
+ viewBox: "0 0 32 32",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$z = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "M2.875 6C1.32 6 0 7.254 0 8.813v14.374C0 24.747 1.32 26 2.875 26h26.25C30.68 26 32 24.746 32 23.187V8.813C32 7.255 30.68 6 29.125 6zm0 2h26.25c.516 0 .875.383.875.813v14.374c0 .43-.36.813-.875.813H2.875C2.359 24 2 23.617 2 23.187V8.813c0-.43.36-.812.875-.812zM5 11v10h3v-6.656l3 3.969l3-3.97V21h3V11h-3l-3 4l-3-4zm17 0v5h-3l4.5 5l4.5-5h-3v-5z"
+}, null, -1);
+const _hoisted_3$v = [
+ _hoisted_2$z
+];
+function render$j(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$I, _hoisted_3$v);
+}
+var __unplugin_components_2 = { name: "la-markdown", render: render$j };
+const _hoisted_1$H = {
+ viewBox: "0 0 256 221",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$y = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "#41B883",
+ d: "M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"
+}, null, -1);
+const _hoisted_3$u = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "#41B883",
+ d: "m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"
+}, null, -1);
+const _hoisted_4$e = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "#35495E",
+ d: "M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"
+}, null, -1);
+const _hoisted_5$9 = [
+ _hoisted_2$y,
+ _hoisted_3$u,
+ _hoisted_4$e
+];
+function render$i(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$H, _hoisted_5$9);
+}
+var __unplugin_components_1$2 = { name: "logos-vue", render: render$i };
+const _sfc_main$v = {};
+const _hoisted_1$G = { class: "dark:hover:bg-blue-900/50 hover:bg-blue-200 transition p-1 rounded" };
+function _sfc_render$5(_ctx, _cache) {
+ return openBlock(), createElementBlock("button", _hoisted_1$G, [
+ renderSlot(_ctx.$slots, "default")
+ ]);
+}
+var __unplugin_components_8$1 = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$5]]);
+const _hoisted_1$F = { class: "text-xs flex items-center w-full" };
+const _hoisted_2$x = ["src"];
+const _hoisted_3$t = ["src"];
+const _hoisted_4$d = { class: "md:ml-3 flex-grow w-full" };
+const _hoisted_5$8 = ["href"];
+const _hoisted_6$5 = ["href"];
+const _hoisted_7$4 = {
+ key: 2,
+ class: "flex items-center mt-2"
+};
+const _hoisted_8$4 = {
+ key: 3,
+ class: "mt-2"
+};
+const _hoisted_9$4 = /* @__PURE__ */ createBaseVNode("div", { class: "font-bold inline text-xs uppercase px-1 rounded-xl bg-red-300 text-red-700" }, " Redirected ", -1);
+const _hoisted_10$3 = [
+ _hoisted_9$4
+];
+const _hoisted_11$3 = ["src"];
+const _sfc_main$u = defineComponent({
+ __name: "CellRouteName",
+ props: {
+ report: {},
+ column: {},
+ value: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const showingModal = ref(false);
+ function openModal() {
+ isModalOpen.value = true;
+ iframeModalUrl.value = null;
+ nextTick(() => {
+ showingModal.value = true;
+ });
+ }
+ watch(isModalOpen, () => {
+ if (!isModalOpen.value)
+ showingModal.value = false;
+ });
+ function openEditorRequest() {
+ fetch(`${apiUrl}/__launch?file=${props2.report.route.definition.component}`);
+ }
+ return (_ctx, _cache) => {
+ var _a2, _b2, _c, _d, _e, _f;
+ const _component_btn_action = __unplugin_components_8$1;
+ const _component_i_logos_vue = __unplugin_components_1$2;
+ const _component_i_la_markdown = __unplugin_components_2;
+ return openBlock(), createElementBlock(Fragment, null, [
+ createBaseVNode("div", _hoisted_1$F, [
+ _ctx.report.tasks.runLighthouseTask === "completed" ? (openBlock(), createBlock(_component_btn_action, {
+ key: 0,
+ class: "hidden md:block",
+ style: normalizeStyle({ flex: `0 0 ${unref(device) === "mobile" ? "67" : "112"}px` }),
+ title: "Open Full Page Screenshot",
+ onClick: _cache[0] || (_cache[0] = ($event) => openModal())
+ }, {
+ default: withCtx(() => [
+ unref(device) === "mobile" ? (openBlock(), createElementBlock("img", {
+ key: 0,
+ src: `${_ctx.report.artifactUrl}/screenshot.jpeg`,
+ loading: "lazy",
+ height: "112",
+ width: "68",
+ class: "w-68px h-112px"
+ }, null, 8, _hoisted_2$x)) : (openBlock(), createElementBlock("img", {
+ key: 1,
+ src: `${_ctx.report.artifactUrl}/screenshot.jpeg`,
+ loading: "lazy",
+ height: "82",
+ width: "112",
+ class: "h-82px w-112px"
+ }, null, 8, _hoisted_3$t))
+ ]),
+ _: 1
+ }, 8, ["style"])) : createCommentVNode("", true),
+ createBaseVNode("div", _hoisted_4$d, [
+ ((_a2 = _ctx.report.seo) == null ? void 0 : _a2.title) ? (openBlock(), createElementBlock("a", {
+ key: 0,
+ href: _ctx.report.route.url,
+ target: "_blank",
+ class: "text-xs dark:opacity-80 underline hover:no-underline"
+ }, toDisplayString((_b2 = _ctx.report.seo) == null ? void 0 : _b2.title), 9, _hoisted_5$8)) : (openBlock(), createElementBlock("a", {
+ key: 1,
+ href: _ctx.report.route.url,
+ target: "_blank",
+ class: "text-xs opacity-80 underline break-all hover:no-underline"
+ }, toDisplayString(_ctx.report.route.path), 9, _hoisted_6$5)),
+ ((_c = _ctx.report.route.definition) == null ? void 0 : _c.componentBaseName) ? (openBlock(), createElementBlock("div", _hoisted_7$4, [
+ createVNode(_component_btn_action, {
+ disabled: unref(isOffline) ? "disabled" : false,
+ class: "inline text-xs opacity-90 rounded-xl px-2 bg-blue-50 dark:bg-teal-700/30 dark:hover:bg-teal-700/70 hover:text-opacity-100 hover:bg-blue-100",
+ title: "Open File",
+ onClick: openEditorRequest
+ }, {
+ default: withCtx(() => [
+ _ctx.report.route.definition.componentBaseName.endsWith(".vue") ? (openBlock(), createBlock(_component_i_logos_vue, {
+ key: 0,
+ class: "h-8px inline-block"
+ })) : _ctx.report.route.definition.componentBaseName.endsWith(".md") ? (openBlock(), createBlock(_component_i_la_markdown, {
+ key: 1,
+ class: "h-12px mr-1 inline-block"
+ })) : createCommentVNode("", true),
+ createTextVNode(" " + toDisplayString(_ctx.report.route.definition.componentBaseName.split(".")[0]), 1)
+ ]),
+ _: 1
+ }, 8, ["disabled"])
+ ])) : createCommentVNode("", true),
+ ((_f = (_e = (_d = _ctx.report.report) == null ? void 0 : _d.audits) == null ? void 0 : _e.redirects) == null ? void 0 : _f.score) === 0 ? (openBlock(), createElementBlock("div", _hoisted_8$4, _hoisted_10$3)) : createCommentVNode("", true)
+ ])
+ ]),
+ unref(isModalOpen) && unref(showingModal) ? (openBlock(), createBlock(Teleport, {
+ key: 0,
+ to: "#modal-portal"
+ }, [
+ createBaseVNode("img", {
+ src: `${_ctx.report.artifactUrl}/full-screenshot.jpeg`,
+ alt: "full screenshot",
+ class: "mx-auto"
+ }, null, 8, _hoisted_11$3)
+ ])) : createCommentVNode("", true)
+ ], 64);
+ };
+ }
+});
+var MetricGuage_vue_vue_type_style_index_0_lang = "";
+const _hoisted_1$E = { class: "guage__svg-wrapper relative" };
+const _hoisted_2$w = {
+ class: "guage",
+ viewBox: "0 0 120 120"
+};
+const _hoisted_3$s = /* @__PURE__ */ createBaseVNode("circle", {
+ class: "guage-base",
+ r: "56",
+ cx: "60",
+ cy: "60",
+ "stroke-width": "8"
+}, null, -1);
+const _hoisted_4$c = { class: "font-5xl font-bold left-[50%] top-[50%] transform -translate-y-[50%] -translate-x-[50%] absolute text-mono font-mono" };
+const _hoisted_5$7 = { class: "text-xs mt-2" };
+const _sfc_main$t = defineComponent({
+ __name: "MetricGuage",
+ props: {
+ score: {},
+ stripped: { type: Boolean },
+ label: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const { score, label, stripped } = toRefs(props2);
+ const arc = ref(null);
+ const guageModifiers = computed(() => {
+ let result = "fail";
+ if (score.value >= 0.9)
+ result = "pass";
+ else if (score.value >= 0.5)
+ result = "average";
+ return [
+ `guage__wrapper--${result}`
+ ];
+ });
+ const guageArcStyle = computed(() => {
+ const r2 = 56;
+ const n2 = 2 * Math.PI * r2;
+ const rotationOffset = 0.25 * 8 / n2;
+ let o2 = score.value * n2 - r2 / 2;
+ if (score.value === 1)
+ o2 = n2;
+ return {
+ opacity: score.value === 0 ? "0" : 1,
+ transform: `rotate(${360 * rotationOffset - 90}deg)`,
+ strokeDasharray: `${Math.max(o2, 0)}, ${n2}`
+ };
+ });
+ return (_ctx, _cache) => {
+ const _component_audit_result = __unplugin_components_0$6;
+ return unref(stripped) ? (openBlock(), createElementBlock("div", {
+ key: 0,
+ class: normalizeClass(unref(guageModifiers))
+ }, [
+ createVNode(_component_audit_result, {
+ value: { score: unref(score), displayValue: Math.round(unref(score) * 100) }
+ }, null, 8, ["value"])
+ ], 2)) : (openBlock(), createElementBlock("div", {
+ key: 1,
+ class: normalizeClass(["guage__wrapper guage__wrapper--huge", unref(guageModifiers)])
+ }, [
+ createBaseVNode("div", _hoisted_1$E, [
+ (openBlock(), createElementBlock("svg", _hoisted_2$w, [
+ _hoisted_3$s,
+ unref(score) !== null ? (openBlock(), createElementBlock("circle", {
+ key: 0,
+ ref_key: "arc",
+ ref: arc,
+ class: "guage-arc",
+ r: "56",
+ cx: "60",
+ cy: "60",
+ "stroke-width": "8",
+ style: normalizeStyle(unref(guageArcStyle))
+ }, null, 4)) : createCommentVNode("", true)
+ ])),
+ createBaseVNode("div", _hoisted_4$c, toDisplayString(unref(score) === null ? "?" : Math.round(unref(score) * 100)), 1)
+ ]),
+ createBaseVNode("div", _hoisted_5$7, toDisplayString(unref(label)), 1)
+ ], 2));
+ };
+ }
+});
+const _hoisted_1$D = { class: "inline-flex items-center" };
+const _sfc_main$s = defineComponent({
+ __name: "LoadingStatusIcon",
+ props: {
+ status: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const color = computed(() => {
+ if (isOffline.value && props2.status !== "completed" && props2.status !== "failed")
+ return "bg-gray-700";
+ switch (props2.status) {
+ case "completed":
+ return "bg-green-500";
+ case "in-progress":
+ return "bg-yellow-500";
+ case "waiting":
+ return "bg-gray-500";
+ case "failed":
+ return "bg-red-500";
+ }
+ });
+ const label = computed(() => {
+ if (isOffline.value && props2.status !== "completed" && props2.status !== "failed")
+ return "Offline";
+ switch (props2.status) {
+ case "completed":
+ return "Completed";
+ case "in-progress":
+ return "In progress";
+ case "waiting":
+ return "Waiting";
+ case "failed":
+ return "Failed";
+ }
+ });
+ return (_ctx, _cache) => {
+ return openBlock(), createElementBlock("div", _hoisted_1$D, [
+ createBaseVNode("div", {
+ class: normalizeClass([[unref(color)], "rounded-full h-3 w-3 inline-block mr-1"])
+ }, null, 2),
+ createTextVNode(" " + toDisplayString(unref(label)), 1)
+ ]);
+ };
+ }
+});
+const _hoisted_1$C = /* @__PURE__ */ createBaseVNode("div", {
+ class: "text-xs opacity-60 mt-1 text-center",
+ style: { "font-size": "10px" }
+}, " View Report ", -1);
+const _sfc_main$r = defineComponent({
+ __name: "CellScoresOverview",
+ props: {
+ report: {},
+ column: {}
+ },
+ setup(__props) {
+ return (_ctx, _cache) => {
+ const _component_loading_status_icon = _sfc_main$s;
+ const _component_metric_guage = _sfc_main$t;
+ const _component_btn_action = __unplugin_components_8$1;
+ return !_ctx.report.report && _ctx.report.tasks.inspectHtmlTask === "failed" ? (openBlock(), createBlock(_component_loading_status_icon, {
+ key: 0,
+ status: _ctx.report.tasks.inspectHtmlTask
+ }, null, 8, ["status"])) : !_ctx.report.report ? (openBlock(), createBlock(_component_loading_status_icon, {
+ key: 1,
+ status: _ctx.report.tasks.runLighthouseTask
+ }, null, 8, ["status"])) : (openBlock(), createBlock(_component_btn_action, {
+ key: 2,
+ title: "Open Lighthouse Report",
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(openLighthouseReportIframeModal)(_ctx.report))
+ }, {
+ default: withCtx(() => [
+ createBaseVNode("div", {
+ class: normalizeClass(["grid gap-2 flex", [`grid-cols-${unref(categories).length}`]])
+ }, [
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.report.report.categories, (val, ck) => {
+ return openBlock(), createElementBlock("div", { key: ck }, [
+ createVNode(_component_metric_guage, {
+ score: val.score,
+ label: val.title
+ }, null, 8, ["score", "label"])
+ ]);
+ }), 128))
+ ], 2),
+ _hoisted_1$C
+ ]),
+ _: 1
+ }));
+ };
+ }
+});
+const _hoisted_1$B = { key: 1 };
+const _hoisted_2$v = /* @__PURE__ */ createBaseVNode("div", {
+ class: "text-xs opacity-60 mt-1",
+ style: { "font-size": "10px" }
+}, " View Report ", -1);
+const _hoisted_3$r = {
+ key: 0,
+ class: "text-xs opacity-70 text-center"
+};
+const _hoisted_4$b = ["href"];
+const _sfc_main$q = defineComponent({
+ __name: "CellScoreSingle",
+ props: {
+ report: {},
+ column: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const categoryKey = computed(() => {
+ var _a2;
+ if (!((_a2 = props2.report.report) == null ? void 0 : _a2.categories))
+ return null;
+ const tab = activeTab.value - 1;
+ const keys2 = Object.keys(props2.report.report.categories);
+ return keys2[tab];
+ });
+ const category = computed(() => {
+ var _a2, _b2;
+ if (!categoryKey.value)
+ return null;
+ return (_b2 = (_a2 = props2.report.report) == null ? void 0 : _a2.categories) == null ? void 0 : _b2[categoryKey.value];
+ });
+ const isLocalhost = website.includes("localhost");
+ return (_ctx, _cache) => {
+ const _component_loading_status_icon = _sfc_main$s;
+ const _component_metric_guage = _sfc_main$t;
+ return !unref(category) ? (openBlock(), createBlock(_component_loading_status_icon, {
+ key: 0,
+ status: _ctx.report.tasks.runLighthouseTask
+ }, null, 8, ["status"])) : (openBlock(), createElementBlock("div", _hoisted_1$B, [
+ createBaseVNode("button", {
+ class: "hover:bg-blue-900/50 transition lg:p-2 rounded",
+ title: "Open Lighthouse Report",
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(openLighthouseReportIframeModal)(_ctx.report, unref(category).key))
+ }, [
+ createVNode(_component_metric_guage, {
+ class: "hidden lg:flex",
+ score: unref(category).score,
+ label: unref(category).title
+ }, null, 8, ["score", "label"]),
+ createVNode(_component_metric_guage, {
+ class: "lg:hidden",
+ stripped: true,
+ score: unref(category).score,
+ label: unref(category).title
+ }, null, 8, ["score", "label"]),
+ _hoisted_2$v
+ ]),
+ !unref(isLocalhost) && unref(category).title === "Performance" ? (openBlock(), createElementBlock("div", _hoisted_3$r, [
+ createBaseVNode("a", {
+ href: `https://pagespeed.web.dev/report?url=${encodeURIComponent(_ctx.report.route.url)}`,
+ target: "_blank",
+ class: "underline hover:no-underline"
+ }, "PSI Test", 8, _hoisted_4$b)
+ ])) : createCommentVNode("", true)
+ ]));
+ };
+ }
+});
+const n = /[^\0-\x7E]/;
+const t = /[\x2E\u3002\uFF0E\uFF61]/g;
+const o = { overflow: "Overflow Error", "not-basic": "Illegal Input", "invalid-input": "Invalid Input" };
+const e = Math.floor;
+const r = String.fromCharCode;
+function s(n2) {
+ throw new RangeError(o[n2]);
+}
+const c = function(n2, t2) {
+ return n2 + 22 + 75 * (n2 < 26) - ((t2 != 0) << 5);
+};
+const u = function(n2, t2, o2) {
+ let r2 = 0;
+ for (n2 = o2 ? e(n2 / 700) : n2 >> 1, n2 += e(n2 / t2); n2 > 455; r2 += 36) {
+ n2 = e(n2 / 35);
+ }
+ return e(r2 + 36 * n2 / (n2 + 38));
+};
+function toASCII(o2) {
+ return function(n2, o3) {
+ const e2 = n2.split("@");
+ let r2 = "";
+ e2.length > 1 && (r2 = e2[0] + "@", n2 = e2[1]);
+ const s2 = function(n3, t2) {
+ const o4 = [];
+ let e3 = n3.length;
+ for (; e3--; ) {
+ o4[e3] = t2(n3[e3]);
+ }
+ return o4;
+ }((n2 = n2.replace(t, ".")).split("."), o3).join(".");
+ return r2 + s2;
+ }(o2, function(t2) {
+ return n.test(t2) ? "xn--" + function(n2) {
+ const t3 = [];
+ const o3 = (n2 = function(n3) {
+ const t4 = [];
+ let o4 = 0;
+ const e2 = n3.length;
+ for (; o4 < e2; ) {
+ const r2 = n3.charCodeAt(o4++);
+ if (r2 >= 55296 && r2 <= 56319 && o4 < e2) {
+ const e3 = n3.charCodeAt(o4++);
+ (64512 & e3) == 56320 ? t4.push(((1023 & r2) << 10) + (1023 & e3) + 65536) : (t4.push(r2), o4--);
+ } else {
+ t4.push(r2);
+ }
+ }
+ return t4;
+ }(n2)).length;
+ let f2 = 128;
+ let i = 0;
+ let l2 = 72;
+ for (const o4 of n2) {
+ o4 < 128 && t3.push(r(o4));
+ }
+ const h2 = t3.length;
+ let p2 = h2;
+ for (h2 && t3.push("-"); p2 < o3; ) {
+ let o4 = 2147483647;
+ for (const t4 of n2) {
+ t4 >= f2 && t4 < o4 && (o4 = t4);
+ }
+ const a2 = p2 + 1;
+ o4 - f2 > e((2147483647 - i) / a2) && s("overflow"), i += (o4 - f2) * a2, f2 = o4;
+ for (const o5 of n2) {
+ if (o5 < f2 && ++i > 2147483647 && s("overflow"), o5 == f2) {
+ let n3 = i;
+ for (let o6 = 36; ; o6 += 36) {
+ const s2 = o6 <= l2 ? 1 : o6 >= l2 + 26 ? 26 : o6 - l2;
+ if (n3 < s2) {
+ break;
+ }
+ const u2 = n3 - s2;
+ const f22 = 36 - s2;
+ t3.push(r(c(s2 + u2 % f22, 0))), n3 = e(u2 / f22);
+ }
+ t3.push(r(c(n3, 0))), l2 = u(i, a2, p2 == h2), i = 0, ++p2;
+ }
+ }
+ ++i, ++f2;
+ }
+ return t3.join("");
+ }(t2) : t2;
+ });
+}
+const HASH_RE = /#/g;
+const AMPERSAND_RE = /&/g;
+const EQUAL_RE = /=/g;
+const IM_RE = /\?/g;
+const PLUS_RE = /\+/g;
+const ENC_BRACKET_OPEN_RE = /%5B/gi;
+const ENC_BRACKET_CLOSE_RE = /%5D/gi;
+const ENC_CARET_RE = /%5E/gi;
+const ENC_BACKTICK_RE = /%60/gi;
+const ENC_CURLY_OPEN_RE = /%7B/gi;
+const ENC_PIPE_RE = /%7C/gi;
+const ENC_CURLY_CLOSE_RE = /%7D/gi;
+const ENC_SPACE_RE = /%20/gi;
+const ENC_SLASH_RE = /%2F/gi;
+const ENC_ENC_SLASH_RE = /%252F/gi;
+function encode(text) {
+ return encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
+}
+function encodeHash(text) {
+ return encode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
+}
+function encodeQueryValue(text) {
+ return encode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
+}
+function encodeQueryKey(text) {
+ return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
+}
+function encodePath(text) {
+ return encode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F").replace(ENC_ENC_SLASH_RE, "%2F").replace(AMPERSAND_RE, "%26").replace(PLUS_RE, "%2B");
+}
+function decode(text = "") {
+ try {
+ return decodeURIComponent("" + text);
+ } catch (_err) {
+ return "" + text;
+ }
+}
+function decodePath(text) {
+ return decode(text.replace(ENC_SLASH_RE, "%252F"));
+}
+function decodeQueryValue(text) {
+ return decode(text.replace(PLUS_RE, " "));
+}
+function encodeHost(name = "") {
+ return toASCII(name);
+}
+function parseQuery$1(paramsStr = "") {
+ const obj = {};
+ if (paramsStr[0] === "?") {
+ paramsStr = paramsStr.substr(1);
+ }
+ for (const param of paramsStr.split("&")) {
+ const s2 = param.match(/([^=]+)=?(.*)/) || [];
+ if (s2.length < 2) {
+ continue;
+ }
+ const key = decode(s2[1]);
+ if (key === "__proto__" || key === "constructor") {
+ continue;
+ }
+ const value = decodeQueryValue(s2[2] || "");
+ if (obj[key]) {
+ if (Array.isArray(obj[key])) {
+ obj[key].push(value);
+ } else {
+ obj[key] = [obj[key], value];
+ }
+ } else {
+ obj[key] = value;
+ }
+ }
+ return obj;
+}
+function encodeQueryItem(key, val) {
+ if (typeof val === "number" || typeof val === "boolean") {
+ val = String(val);
+ }
+ if (!val) {
+ return encodeQueryKey(key);
+ }
+ if (Array.isArray(val)) {
+ return val.map((_val) => `${encodeQueryKey(key)}=${encodeQueryValue(_val)}`).join("&");
+ }
+ return `${encodeQueryKey(key)}=${encodeQueryValue(val)}`;
+}
+function stringifyQuery(query) {
+ return Object.keys(query).map((k2) => encodeQueryItem(k2, query[k2])).join("&");
+}
+class $URL {
+ constructor(input = "") {
+ this.query = {};
+ if (typeof input !== "string") {
+ throw new TypeError(`URL input should be string received ${typeof input} (${input})`);
+ }
+ const parsed = parseURL(input);
+ this.protocol = decode(parsed.protocol);
+ this.host = decode(parsed.host);
+ this.auth = decode(parsed.auth);
+ this.pathname = decodePath(parsed.pathname);
+ this.query = parseQuery$1(parsed.search);
+ this.hash = decode(parsed.hash);
+ }
+ get hostname() {
+ return parseHost(this.host).hostname;
+ }
+ get port() {
+ return parseHost(this.host).port || "";
+ }
+ get username() {
+ return parseAuth(this.auth).username;
+ }
+ get password() {
+ return parseAuth(this.auth).password || "";
+ }
+ get hasProtocol() {
+ return this.protocol.length;
+ }
+ get isAbsolute() {
+ return this.hasProtocol || this.pathname[0] === "/";
+ }
+ get search() {
+ const q = stringifyQuery(this.query);
+ return q.length ? "?" + q : "";
+ }
+ get searchParams() {
+ const p2 = new URLSearchParams();
+ for (const name in this.query) {
+ const value = this.query[name];
+ if (Array.isArray(value)) {
+ value.forEach((v2) => p2.append(name, v2));
+ } else {
+ p2.append(name, value || "");
+ }
+ }
+ return p2;
+ }
+ get origin() {
+ return (this.protocol ? this.protocol + "//" : "") + encodeHost(this.host);
+ }
+ get fullpath() {
+ return encodePath(this.pathname) + this.search + encodeHash(this.hash);
+ }
+ get encodedAuth() {
+ if (!this.auth) {
+ return "";
+ }
+ const { username, password } = parseAuth(this.auth);
+ return encodeURIComponent(username) + (password ? ":" + encodeURIComponent(password) : "");
+ }
+ get href() {
+ const auth = this.encodedAuth;
+ const originWithAuth = (this.protocol ? this.protocol + "//" : "") + (auth ? auth + "@" : "") + encodeHost(this.host);
+ return this.hasProtocol && this.isAbsolute ? originWithAuth + this.fullpath : this.fullpath;
+ }
+ append(url) {
+ if (url.hasProtocol) {
+ throw new Error("Cannot append a URL with protocol");
+ }
+ Object.assign(this.query, url.query);
+ if (url.pathname) {
+ this.pathname = withTrailingSlash(this.pathname) + withoutLeadingSlash(url.pathname);
+ }
+ if (url.hash) {
+ this.hash = url.hash;
+ }
+ }
+ toJSON() {
+ return this.href;
+ }
+ toString() {
+ return this.href;
+ }
+}
+const PROTOCOL_REGEX = /^\w+:(\/\/)?/;
+const PROTOCOL_RELATIVE_REGEX = /^\/\/[^/]+/;
+function hasProtocol(inputStr, acceptProtocolRelative = false) {
+ return PROTOCOL_REGEX.test(inputStr) || acceptProtocolRelative && PROTOCOL_RELATIVE_REGEX.test(inputStr);
+}
+const TRAILING_SLASH_RE = /\/$|\/\?/;
+function hasTrailingSlash(input = "", queryParams = false) {
+ if (!queryParams) {
+ return input.endsWith("/");
+ }
+ return TRAILING_SLASH_RE.test(input);
+}
+function withoutTrailingSlash(input = "", queryParams = false) {
+ if (!queryParams) {
+ return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
+ }
+ if (!hasTrailingSlash(input, true)) {
+ return input || "/";
+ }
+ const [s0, ...s2] = input.split("?");
+ return (s0.slice(0, -1) || "/") + (s2.length ? `?${s2.join("?")}` : "");
+}
+function withTrailingSlash(input = "", queryParams = false) {
+ if (!queryParams) {
+ return input.endsWith("/") ? input : input + "/";
+ }
+ if (hasTrailingSlash(input, true)) {
+ return input || "/";
+ }
+ const [s0, ...s2] = input.split("?");
+ return s0 + "/" + (s2.length ? `?${s2.join("?")}` : "");
+}
+function hasLeadingSlash(input = "") {
+ return input.startsWith("/");
+}
+function withoutLeadingSlash(input = "") {
+ return (hasLeadingSlash(input) ? input.substr(1) : input) || "/";
+}
+function withBase(input, base2) {
+ if (isEmptyURL(base2) || hasProtocol(input)) {
+ return input;
+ }
+ const _base = withoutTrailingSlash(base2);
+ if (input.startsWith(_base)) {
+ return input;
+ }
+ return joinURL(_base, input);
+}
+function isEmptyURL(url) {
+ return !url || url === "/";
+}
+function isNonEmptyURL(url) {
+ return url && url !== "/";
+}
+function joinURL(base2, ...input) {
+ let url = base2 || "";
+ for (const i of input.filter(isNonEmptyURL)) {
+ url = url ? withTrailingSlash(url) + withoutLeadingSlash(i) : i;
+ }
+ return url;
+}
+function parseURL(input = "", defaultProto) {
+ if (!hasProtocol(input, true)) {
+ return defaultProto ? parseURL(defaultProto + input) : parsePath(input);
+ }
+ const [protocol = "", auth, hostAndPath = ""] = (input.replace(/\\/g, "/").match(/([^:/]+:)?\/\/([^/@]+@)?(.*)/) || []).splice(1);
+ const [host = "", path = ""] = (hostAndPath.match(/([^/?#]*)(.*)?/) || []).splice(1);
+ const { pathname, search: search2, hash } = parsePath(path);
+ return {
+ protocol,
+ auth: auth ? auth.substr(0, auth.length - 1) : "",
+ host,
+ pathname,
+ search: search2,
+ hash
+ };
+}
+function parsePath(input = "") {
+ const [pathname = "", search2 = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
+ return {
+ pathname,
+ search: search2,
+ hash
+ };
+}
+function parseAuth(input = "") {
+ const [username, password] = input.split(":");
+ return {
+ username: decode(username),
+ password: decode(password)
+ };
+}
+function parseHost(input = "") {
+ const [hostname, port] = (input.match(/([^/]*)(:0-9+)?/) || []).splice(1);
+ return {
+ hostname: decode(hostname),
+ port
+ };
+}
+const _hoisted_1$A = {
+ key: 0,
+ class: "text-sm"
+};
+const _hoisted_2$u = { class: "opacity-90 flex items-center mb-1" };
+const _hoisted_3$q = { class: "opacity-70 ml-1" };
+const _hoisted_4$a = { class: "grid gap-2 grid-cols-2" };
+const _hoisted_5$6 = { class: "opacity-70 ml-2" };
+const _hoisted_6$4 = { class: "break-all opacity-90 flex-grow" };
+const _hoisted_7$3 = ["href"];
+const _hoisted_8$3 = { class: "opacity-70 whitespace-nowrap ml-1 flex-shrink break-none" };
+const _hoisted_9$3 = { class: "opacity-70 whitespace-nowrap ml-1 flex-shrink" };
+const _sfc_main$p = defineComponent({
+ __name: "CellNetworkRequests",
+ props: {
+ report: {},
+ column: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const value = computed(() => get$1(props2.report, props2.column.key));
+ const requests = computed(() => {
+ var _a2, _b2;
+ return groupBy$1(((_b2 = (_a2 = value.value) == null ? void 0 : _a2.details) == null ? void 0 : _b2.items) || [], (i) => i.resourceType);
+ });
+ const totalTransfer = computed(() => {
+ var _a2, _b2;
+ return formatBytes(sum((_b2 = (_a2 = value.value) == null ? void 0 : _a2.details) == null ? void 0 : _b2.items.map((i) => i.transferSize)));
+ });
+ const requestsMapped = computed(() => {
+ const res = {};
+ for (const resourceType in requests.value) {
+ const items = requests.value[resourceType];
+ res[resourceType] = {
+ count: items.length,
+ items,
+ size: formatBytes(sum(items.map((i) => i.transferSize)))
+ };
+ }
+ return res;
+ });
+ return (_ctx, _cache) => {
+ const _component_tooltip = _sfc_main$z;
+ return unref(value) ? (openBlock(), createElementBlock("div", _hoisted_1$A, [
+ createBaseVNode("div", _hoisted_2$u, [
+ createBaseVNode("span", null, toDisplayString(unref(value).details.items.length) + " total", 1),
+ createBaseVNode("span", _hoisted_3$q, toDisplayString(unref(totalTransfer)), 1)
+ ]),
+ createBaseVNode("div", _hoisted_4$a, [
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(requestsMapped), (group, resourceType) => {
+ return openBlock(), createElementBlock("div", {
+ key: resourceType,
+ class: "text-xs flex items-center"
+ }, [
+ createVNode(_component_tooltip, null, {
+ tooltip: withCtx(() => [
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group.items, (item, key) => {
+ return openBlock(), createElementBlock("div", {
+ key,
+ class: "mb-1 flex text-xs"
+ }, [
+ createBaseVNode("span", _hoisted_6$4, [
+ createBaseVNode("a", {
+ href: item.url,
+ class: "hover:no-underline underline"
+ }, toDisplayString(item.url.replace(unref(website), "")), 9, _hoisted_7$3)
+ ]),
+ createBaseVNode("span", _hoisted_8$3, toDisplayString(unref(formatBytes)(item.transferSize)), 1),
+ createBaseVNode("span", _hoisted_9$3, toDisplayString(Math.round(item.endTime - item.startTime)) + "ms", 1)
+ ]);
+ }), 128))
+ ]),
+ default: withCtx(() => [
+ createBaseVNode("span", null, toDisplayString(group.count > 1 ? group.count : "") + " " + toDisplayString(resourceType) + toDisplayString(group.count > 1 ? "s" : ""), 1),
+ createBaseVNode("span", _hoisted_5$6, toDisplayString(group.size), 1)
+ ]),
+ _: 2
+ }, 1024)
+ ]);
+ }), 128))
+ ])
+ ])) : createCommentVNode("", true);
+ };
+ }
+});
+const _sfc_main$o = defineComponent({
+ __name: "CellImageIssues",
+ props: {
+ report: {},
+ column: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const imageIssues = computed(() => {
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
+ return sum([
+ ((_b2 = (_a2 = props2.report.report) == null ? void 0 : _a2.audits["unsized-images"]) == null ? void 0 : _b2.details.items.length) || 0,
+ ((_d = (_c = props2.report.report) == null ? void 0 : _c.audits["preload-lcp-image"]) == null ? void 0 : _d.details.items.length) || 0,
+ ((_f = (_e = props2.report.report) == null ? void 0 : _e.audits["offscreen-images"]) == null ? void 0 : _f.details.items.length) || 0,
+ ((_h = (_g = props2.report.report) == null ? void 0 : _g.audits["modern-image-formats"]) == null ? void 0 : _h.details.items.length) || 0,
+ ((_j = (_i = props2.report.report) == null ? void 0 : _i.audits["uses-optimized-images"]) == null ? void 0 : _j.details.items.length) || 0,
+ ((_l = (_k = props2.report.report) == null ? void 0 : _k.audits["efficient-animated-content"]) == null ? void 0 : _l.details.items.length) || 0,
+ ((_n = (_m = props2.report.report) == null ? void 0 : _m.audits["uses-responsive-images"]) == null ? void 0 : _n.details.items.length) || 0
+ ]);
+ });
+ return (_ctx, _cache) => {
+ const _component_audit_result = __unplugin_components_0$6;
+ return openBlock(), createElementBlock("div", null, [
+ createVNode(_component_audit_result, {
+ value: { displayValue: unref(imageIssues), score: unref(imageIssues) === 0 ? 1 : 0 }
+ }, null, 8, ["value"])
+ ]);
+ };
+ }
+});
+const _hoisted_1$z = {
+ key: 0,
+ class: "w-full"
+};
+const _hoisted_2$t = { class: "mb-2" };
+const _hoisted_3$p = {
+ key: 0,
+ class: "max-h-80px overflow-y-auto w-full hidden md:block"
+};
+const _sfc_main$n = defineComponent({
+ __name: "CellColorContrast",
+ props: {
+ report: {},
+ column: {},
+ value: {}
+ },
+ setup(__props) {
+ return (_ctx, _cache) => {
+ var _a2;
+ const _component_audit_result_items_length = _sfc_main$x;
+ return _ctx.value ? (openBlock(), createElementBlock("div", _hoisted_1$z, [
+ createBaseVNode("div", _hoisted_2$t, [
+ createVNode(_component_audit_result_items_length, { value: _ctx.value }, null, 8, ["value"])
+ ]),
+ ((_a2 = _ctx.value.details) == null ? void 0 : _a2.items) ? (openBlock(), createElementBlock("div", _hoisted_3$p, [
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.value.details.items, ({ node }, key) => {
+ return openBlock(), createElementBlock("div", {
+ key,
+ class: "mb-1 p-1 text-xs",
+ style: normalizeStyle({
+ color: unref(extractFgColor)(node.explanation),
+ backgroundColor: unref(extractBgColor)(node.explanation)
+ })
+ }, toDisplayString(node.nodeLabel), 5);
+ }), 128))
+ ])) : createCommentVNode("", true)
+ ])) : createCommentVNode("", true);
+ };
+ }
+});
+const _hoisted_1$y = { key: 0 };
+const _hoisted_2$s = { class: "text-xs opacity-80 mb-2" };
+const _hoisted_3$o = { key: 0 };
+const _sfc_main$m = defineComponent({
+ __name: "CellMetaDescription",
+ props: {
+ report: {},
+ column: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const value = computed(() => get$1(props2.report, props2.column.key));
+ const issue = computed(() => {
+ if (!value.value)
+ return "empty";
+ const length = value.value.length;
+ if (length <= 0)
+ return "empty";
+ if (length < 50)
+ return "too-short";
+ if (length >= 200)
+ return "too-long";
+ });
+ const label = computed(() => {
+ switch (issue.value) {
+ case "empty":
+ return "Missing";
+ case "too-short":
+ return "Short";
+ case "too-long":
+ return "Lengthy";
+ }
+ });
+ const score = computed(() => {
+ switch (issue.value) {
+ case "empty":
+ return 0;
+ case "too-short":
+ case "too-long":
+ return 0.6;
+ }
+ return 1;
+ });
+ return (_ctx, _cache) => {
+ const _component_audit_result = __unplugin_components_0$6;
+ return _ctx.report.tasks.inspectHtmlTask === "completed" ? (openBlock(), createElementBlock("div", _hoisted_1$y, [
+ createBaseVNode("div", _hoisted_2$s, toDisplayString(unref(value)), 1),
+ unref(label) ? (openBlock(), createElementBlock("div", _hoisted_3$o, [
+ createVNode(_component_audit_result, {
+ value: { displayValue: unref(label), score: unref(score) }
+ }, null, 8, ["value"])
+ ])) : createCommentVNode("", true)
+ ])) : createCommentVNode("", true);
+ };
+ }
+});
+const _hoisted_1$x = {
+ key: 0,
+ class: "flex w-full justify-center"
+};
+const _hoisted_2$r = { key: 0 };
+const _hoisted_3$n = ["href"];
+const _hoisted_4$9 = { key: 1 };
+const _sfc_main$l = defineComponent({
+ __name: "CellIndexable",
+ props: {
+ report: {},
+ column: {},
+ value: {}
+ },
+ setup(__props) {
+ return (_ctx, _cache) => {
+ var _a2, _b2, _c, _d;
+ const _component_audit_result = __unplugin_components_0$6;
+ return _ctx.value ? (openBlock(), createElementBlock("div", _hoisted_1$x, [
+ ((_b2 = (_a2 = _ctx.value.details) == null ? void 0 : _a2.items[0]) == null ? void 0 : _b2.source.url.endsWith("robots.txt")) ? (openBlock(), createElementBlock("span", _hoisted_2$r, [
+ createBaseVNode("a", {
+ href: (_d = (_c = _ctx.value.details) == null ? void 0 : _c.items[0]) == null ? void 0 : _d.source.url,
+ class: "underline hover:no-underline"
+ }, "robots.txt", 8, _hoisted_3$n),
+ createTextVNode(" blocking")
+ ])) : _ctx.value.details.items.length > 0 ? (openBlock(), createElementBlock("span", _hoisted_4$9, toDisplayString(_ctx.value.details.items), 1)) : createCommentVNode("", true),
+ createVNode(_component_audit_result, {
+ value: { score: _ctx.value.score }
+ }, null, 8, ["value"])
+ ])) : createCommentVNode("", true);
+ };
+ }
+});
+const _hoisted_1$w = { class: "w-full flex justify-between" };
+const _hoisted_2$q = ["src"];
+const _hoisted_3$m = /* @__PURE__ */ createBaseVNode("h2", { class: "font-bold text-lg mb-1 text-gray-700 dark:text-gray-300" }, " Screenshot Thumbnails ", -1);
+const _hoisted_4$8 = /* @__PURE__ */ createBaseVNode("p", { class: "mb-5 text-gray-600 dark:text-gray-400" }, " This is what the load of your site looked like, 300ms apart. ", -1);
+const _hoisted_5$5 = ["src"];
+const _sfc_main$k = defineComponent({
+ __name: "CellScreenshotThumbnails",
+ props: {
+ report: {},
+ column: {},
+ value: {}
+ },
+ setup(__props) {
+ const showingModal = ref(false);
+ function openModal() {
+ isModalOpen.value = true;
+ iframeModalUrl.value = null;
+ nextTick(() => {
+ showingModal.value = true;
+ });
+ }
+ watch(isModalOpen, () => {
+ if (!isModalOpen.value)
+ showingModal.value = false;
+ });
+ return (_ctx, _cache) => {
+ const _component_btn_action = __unplugin_components_8$1;
+ return _ctx.value ? (openBlock(), createBlock(_component_btn_action, {
+ key: 0,
+ title: "Open full image",
+ class: "w-full",
+ onClick: openModal
+ }, {
+ default: withCtx(() => {
+ var _a2, _b2;
+ return [
+ createBaseVNode("div", _hoisted_1$w, [
+ ((_b2 = (_a2 = _ctx.value) == null ? void 0 : _a2.details) == null ? void 0 : _b2.items) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.value.details.items, (image, key) => {
+ return openBlock(), createElementBlock("img", {
+ key,
+ loading: "lazy",
+ src: image.data,
+ height: "120",
+ class: "max-w-[10%] max-h-120px h-auto w-10%"
+ }, null, 8, _hoisted_2$q);
+ }), 128)) : createCommentVNode("", true)
+ ]),
+ unref(isModalOpen) && unref(showingModal) ? (openBlock(), createBlock(Teleport, {
+ key: 0,
+ to: "#modal-portal"
+ }, [
+ _hoisted_3$m,
+ _hoisted_4$8,
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.value.details.items, (image, key) => {
+ return openBlock(), createElementBlock("img", {
+ key,
+ src: image.data,
+ width: "120",
+ class: "w-120px h-auto inline"
+ }, null, 8, _hoisted_5$5);
+ }), 128))
+ ])) : createCommentVNode("", true)
+ ];
+ }),
+ _: 1
+ })) : createCommentVNode("", true);
+ };
+ }
+});
+const _hoisted_1$v = ["src"];
+const _hoisted_2$p = ["src"];
+const _sfc_main$j = defineComponent({
+ __name: "CellImage",
+ props: {
+ report: {},
+ column: {},
+ value: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const image = computed(() => {
+ if (props2.value) {
+ const $url = new $URL(props2.value);
+ if (!$url.hostname)
+ return withBase(props2.value, website);
+ }
+ return props2.value;
+ });
+ const showingModal = ref(false);
+ function openModal() {
+ if (isOffline.value)
+ return;
+ isModalOpen.value = true;
+ iframeModalUrl.value = null;
+ nextTick(() => {
+ showingModal.value = true;
+ });
+ }
+ watch(isModalOpen, () => {
+ if (!isModalOpen.value)
+ showingModal.value = false;
+ });
+ return (_ctx, _cache) => {
+ const _component_btn_action = __unplugin_components_8$1;
+ const _component_audit_result = __unplugin_components_0$6;
+ return openBlock(), createElementBlock("div", null, [
+ unref(image) ? (openBlock(), createBlock(_component_btn_action, {
+ key: 0,
+ title: "Open full image",
+ onClick: openModal
+ }, {
+ default: withCtx(() => [
+ createBaseVNode("img", {
+ loading: "lazy",
+ class: "h-100px object-contain w-full object-top object-left",
+ height: "100",
+ src: unref(image),
+ alt: "share image"
+ }, null, 8, _hoisted_1$v)
+ ]),
+ _: 1
+ })) : (openBlock(), createBlock(_component_audit_result, {
+ key: 1,
+ value: { displayValue: "Missing", score: 0 }
+ })),
+ unref(image) && unref(isModalOpen) && unref(showingModal) ? (openBlock(), createBlock(Teleport, {
+ key: 2,
+ to: "#modal-portal"
+ }, [
+ createBaseVNode("img", {
+ src: unref(image),
+ alt: "share image",
+ class: "mx-auto"
+ }, null, 8, _hoisted_2$p)
+ ])) : createCommentVNode("", true)
+ ]);
+ };
+ }
+});
+const _sfc_main$i = defineComponent({
+ __name: "CellTapTargets",
+ props: {
+ report: {},
+ column: {},
+ value: {}
+ },
+ setup(__props) {
+ return (_ctx, _cache) => {
+ const _component_audit_result = __unplugin_components_0$6;
+ return _ctx.value ? (openBlock(), createBlock(_component_audit_result, {
+ key: 0,
+ value: { score: _ctx.value.score, displayValue: _ctx.value.displayValue.replace(" appropriately sized tap targets", "") }
+ }, null, 8, ["value"])) : createCommentVNode("", true);
+ };
+ }
+});
+const _hoisted_1$u = {
+ viewBox: "0 0 32 32",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$o = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "M17 22v-8h-4v2h2v6h-3v2h8v-2h-3zM16 8a1.5 1.5 0 1 0 1.5 1.5A1.5 1.5 0 0 0 16 8z"
+}, null, -1);
+const _hoisted_3$l = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "M16 30a14 14 0 1 1 14-14a14 14 0 0 1-14 14Zm0-26a12 12 0 1 0 12 12A12 12 0 0 0 16 4Z"
+}, null, -1);
+const _hoisted_4$7 = [
+ _hoisted_2$o,
+ _hoisted_3$l
+];
+function render$h(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$u, _hoisted_4$7);
+}
+var __unplugin_components_1$1 = { name: "carbon-information", render: render$h };
+const _hoisted_1$t = { key: 0 };
+const _hoisted_2$n = { class: "text-sm w-full grid gap-3 grid-cols-1 mb-2" };
+const _hoisted_3$k = { class: "flex justify-between items-center" };
+const _hoisted_4$6 = { class: "whitespace-nowrap flex items-center" };
+const _hoisted_5$4 = { class: "font-bold mb-2" };
+const _hoisted_6$3 = { class: "flex justify-between items-center" };
+const _hoisted_7$2 = { class: "whitespace-nowrap flex items-center" };
+const _hoisted_8$2 = { class: "font-bold mb-2" };
+const _hoisted_9$2 = { class: "flex justify-between items-center" };
+const _hoisted_10$2 = { class: "whitespace-nowrap flex items-center" };
+const _hoisted_11$2 = { class: "font-bold mb-2" };
+const _sfc_main$h = defineComponent({
+ __name: "CellWebVitals",
+ props: {
+ report: {},
+ column: {}
+ },
+ setup(__props) {
+ return (_ctx, _cache) => {
+ const _component_i_carbon_information = __unplugin_components_1$1;
+ const _component_tooltip = _sfc_main$z;
+ const _component_audit_result = __unplugin_components_0$6;
+ return _ctx.report.report ? (openBlock(), createElementBlock("div", _hoisted_1$t, [
+ createBaseVNode("div", _hoisted_2$n, [
+ createBaseVNode("div", _hoisted_3$k, [
+ createVNode(_component_tooltip, null, {
+ tooltip: withCtx(() => [
+ createBaseVNode("div", _hoisted_5$4, toDisplayString(_ctx.report.report.audits["largest-contentful-paint"].title), 1),
+ createBaseVNode("div", null, toDisplayString(_ctx.report.report.audits["largest-contentful-paint"].description), 1)
+ ]),
+ default: withCtx(() => [
+ createBaseVNode("span", _hoisted_4$6, [
+ createTextVNode("LCP "),
+ createVNode(_component_i_carbon_information, { class: "ml-1 text-xs opacity-75" })
+ ])
+ ]),
+ _: 1
+ }),
+ createVNode(_component_audit_result, {
+ value: _ctx.report.report.audits["largest-contentful-paint"],
+ class: "ml-2"
+ }, null, 8, ["value"])
+ ]),
+ createBaseVNode("div", _hoisted_6$3, [
+ createVNode(_component_tooltip, null, {
+ tooltip: withCtx(() => [
+ createBaseVNode("div", _hoisted_8$2, toDisplayString(_ctx.report.report.audits["max-potential-fid"].title), 1),
+ createBaseVNode("div", null, toDisplayString(_ctx.report.report.audits["max-potential-fid"].description), 1)
+ ]),
+ default: withCtx(() => [
+ createBaseVNode("span", _hoisted_7$2, [
+ createTextVNode("FID "),
+ createVNode(_component_i_carbon_information, { class: "ml-1 text-xs opacity-75" })
+ ])
+ ]),
+ _: 1
+ }),
+ createVNode(_component_audit_result, {
+ value: _ctx.report.report.audits["max-potential-fid"],
+ class: "ml-2"
+ }, null, 8, ["value"])
+ ]),
+ createBaseVNode("div", _hoisted_9$2, [
+ createVNode(_component_tooltip, null, {
+ tooltip: withCtx(() => [
+ createBaseVNode("div", _hoisted_11$2, toDisplayString(_ctx.report.report.audits["cumulative-layout-shift"].title), 1),
+ createBaseVNode("div", null, toDisplayString(_ctx.report.report.audits["cumulative-layout-shift"].description), 1)
+ ]),
+ default: withCtx(() => [
+ createBaseVNode("span", _hoisted_10$2, [
+ createTextVNode("CLS "),
+ createVNode(_component_i_carbon_information, { class: "ml-1 text-xs opacity-75" })
+ ])
+ ]),
+ _: 1
+ }),
+ createVNode(_component_audit_result, {
+ value: _ctx.report.report.audits["cumulative-layout-shift"],
+ class: "ml-2"
+ }, null, 8, ["value"])
+ ])
+ ])
+ ])) : createCommentVNode("", true);
+ };
+ }
+});
+const _hoisted_1$s = { class: "relative overflow-hidden flex items-center" };
+const _sfc_main$g = defineComponent({
+ __name: "CellImageOutline",
+ props: {
+ item: {},
+ report: {},
+ column: {},
+ size: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const maxRenderSizeDC = props2.size;
+ function computeZoomFactor(elementRectSC, renderContainerSizeDC) {
+ const targetClipToViewportRatio = 0.75;
+ const zoomRatioXY = {
+ x: renderContainerSizeDC.width / elementRectSC.width,
+ y: renderContainerSizeDC.height / elementRectSC.height
+ };
+ const zoomFactor = targetClipToViewportRatio * Math.min(zoomRatioXY.x, zoomRatioXY.y);
+ return Math.min(1, zoomFactor);
+ }
+ function getScreenshotPositions(elementRectSC, elementPreviewSizeSC, screenshotSize) {
+ function getElementRectCenterPoint(rect) {
+ return {
+ x: rect.left + rect.width / 2,
+ y: rect.top + rect.height / 2
+ };
+ }
+ function clamp2(value, min, max2) {
+ if (value < min)
+ return min;
+ if (value > max2)
+ return max2;
+ return value;
+ }
+ const elementRectCenter = getElementRectCenterPoint(elementRectSC);
+ const screenshotLeftVisibleEdge = clamp2(elementRectCenter.x - elementPreviewSizeSC.width / 2, 0, screenshotSize.width - elementPreviewSizeSC.width);
+ const screenshotTopVisisbleEdge = clamp2(elementRectCenter.y - elementPreviewSizeSC.height / 2, 0, screenshotSize.height - elementPreviewSizeSC.height);
+ return {
+ screenshot: {
+ left: screenshotLeftVisibleEdge,
+ top: screenshotTopVisisbleEdge
+ },
+ clip: {
+ left: elementRectSC.left - screenshotLeftVisibleEdge,
+ top: elementRectSC.top - screenshotTopVisisbleEdge
+ }
+ };
+ }
+ const screenshot = ref(null);
+ onMounted(() => {
+ const img = new Image();
+ img.onload = function() {
+ screenshot.value = {
+ width: img.naturalWidth,
+ height: img.naturalHeight
+ };
+ };
+ img.src = `${props2.report.artifactUrl}/full-screenshot.jpeg`;
+ });
+ const styles = computed(() => {
+ if (!screenshot.value)
+ return {};
+ const elementRectSC = props2.item.node.boundingRect;
+ const zoomFactor = computeZoomFactor(elementRectSC, maxRenderSizeDC);
+ const elementPreviewSizeSC = {
+ width: maxRenderSizeDC.width / zoomFactor,
+ height: maxRenderSizeDC.height / zoomFactor
+ };
+ elementPreviewSizeSC.width = Math.min(screenshot.value.width, elementPreviewSizeSC.width);
+ const elementPreviewSizeDC = {
+ width: elementPreviewSizeSC.width * zoomFactor,
+ height: elementPreviewSizeSC.height * zoomFactor
+ };
+ const positions = getScreenshotPositions(elementRectSC, elementPreviewSizeSC, screenshot.value);
+ const image = {
+ width: `${elementPreviewSizeDC.width}px`,
+ height: `${elementPreviewSizeDC.height}px`,
+ backgroundPositionY: `${-(positions.screenshot.top * zoomFactor)}px`,
+ backgroundPositionX: `${-(positions.screenshot.left * zoomFactor)}px`,
+ backgroundSize: `${screenshot.value.width * zoomFactor}px ${screenshot.value.height * zoomFactor}px`,
+ backgroundImage: `url('${props2.report.artifactUrl}/full-screenshot.jpeg')`
+ };
+ const marker = {
+ width: `${elementRectSC.width * zoomFactor}px`,
+ height: `${elementRectSC.height * zoomFactor}px`,
+ left: `${positions.clip.left * zoomFactor}px`,
+ top: `${positions.clip.top * zoomFactor}px`
+ };
+ return {
+ image,
+ marker
+ };
+ });
+ return (_ctx, _cache) => {
+ return openBlock(), createElementBlock("div", _hoisted_1$s, [
+ createBaseVNode("div", {
+ style: normalizeStyle(unref(styles).image),
+ class: "outline-2 outline-green-200 bg-no-repeat bg-white"
+ }, null, 4),
+ createBaseVNode("div", {
+ style: normalizeStyle(unref(styles).marker),
+ class: "absolute outline outline-2 outline-green-200"
+ }, null, 4)
+ ]);
+ };
+ }
+});
+const _hoisted_1$r = {
+ key: 0,
+ class: "text-sm w-full"
+};
+const _sfc_main$f = defineComponent({
+ __name: "CellLargestContentfulPaint",
+ props: {
+ report: {},
+ column: {}
+ },
+ setup(__props) {
+ const showingModal = ref(false);
+ function openModal() {
+ if (isOffline.value)
+ return;
+ isModalOpen.value = true;
+ iframeModalUrl.value = null;
+ nextTick(() => {
+ showingModal.value = true;
+ });
+ }
+ watch(isModalOpen, () => {
+ if (!isModalOpen.value)
+ showingModal.value = false;
+ });
+ return (_ctx, _cache) => {
+ const _component_audit_result = __unplugin_components_0$6;
+ const _component_btn_action = __unplugin_components_8$1;
+ return _ctx.report.report ? (openBlock(), createElementBlock("div", _hoisted_1$r, [
+ createVNode(_component_audit_result, {
+ value: _ctx.report.report.audits["largest-contentful-paint"],
+ class: "ml-2"
+ }, null, 8, ["value"]),
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.report.report.audits["largest-contentful-paint-element"].details.items, (item, key) => {
+ return openBlock(), createElementBlock("div", {
+ key,
+ class: "flex items-center"
+ }, [
+ createVNode(_component_btn_action, {
+ title: "Open full image",
+ onClick: openModal
+ }, {
+ default: withCtx(() => [
+ createVNode(_sfc_main$g, {
+ item,
+ report: _ctx.report,
+ column: _ctx.column,
+ size: { width: 150, height: 112 }
+ }, null, 8, ["item", "report", "column"])
+ ]),
+ _: 2
+ }, 1024),
+ unref(isModalOpen) && unref(showingModal) ? (openBlock(), createBlock(Teleport, {
+ key: 0,
+ to: "#modal-portal"
+ }, [
+ createVNode(_sfc_main$g, {
+ item,
+ report: _ctx.report,
+ column: _ctx.column,
+ size: { width: 365, height: 700 }
+ }, null, 8, ["item", "report", "column"])
+ ])) : createCommentVNode("", true)
+ ]);
+ }), 128))
+ ])) : createCommentVNode("", true);
+ };
+ }
+});
+const _hoisted_1$q = {
+ key: 0,
+ class: "text-sm w-full"
+};
+const _hoisted_2$m = {
+ key: 0,
+ class: "max-h-120px overflow-y-auto"
+};
+const _sfc_main$e = defineComponent({
+ __name: "CellLayoutShift",
+ props: {
+ report: {},
+ column: {}
+ },
+ setup(__props) {
+ const showingModal = ref(false);
+ const activeItem = ref(false);
+ function openModal(item) {
+ activeItem.value = item;
+ isModalOpen.value = true;
+ iframeModalUrl.value = null;
+ nextTick(() => {
+ showingModal.value = true;
+ });
+ }
+ watch(isModalOpen, () => {
+ if (!isModalOpen.value) {
+ showingModal.value = false;
+ activeItem.value = false;
+ }
+ });
+ return (_ctx, _cache) => {
+ const _component_audit_result = __unplugin_components_0$6;
+ const _component_btn_action = __unplugin_components_8$1;
+ return _ctx.report.report ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
+ createVNode(_component_audit_result, {
+ value: _ctx.report.report.audits["cumulative-layout-shift"],
+ class: "ml-2"
+ }, null, 8, ["value"]),
+ _ctx.report.report.audits["layout-shift-elements"] ? (openBlock(), createElementBlock("div", _hoisted_2$m, [
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.report.report.audits["layout-shift-elements"].details.items, (item, key) => {
+ return openBlock(), createElementBlock("div", {
+ key,
+ class: "mb-2 flex items-center"
+ }, [
+ (item == null ? void 0 : item.score) && item.score.toFixed(3) !== "0.000" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
+ createVNode(_component_btn_action, {
+ title: "Open full image",
+ onClick: ($event) => openModal(item)
+ }, {
+ default: withCtx(() => [
+ createVNode(_sfc_main$g, {
+ item,
+ report: _ctx.report,
+ column: _ctx.column,
+ size: { width: 150, height: 100 }
+ }, null, 8, ["item", "report", "column"])
+ ]),
+ _: 2
+ }, 1032, ["onClick"]),
+ createVNode(_component_audit_result, {
+ value: { displayValue: item.score.toFixed(3), score: 0 },
+ class: "ml-2"
+ }, null, 8, ["value"]),
+ unref(activeItem) === item && unref(isModalOpen) && unref(showingModal) ? (openBlock(), createBlock(Teleport, {
+ key: 0,
+ to: "#modal-portal"
+ }, [
+ createVNode(_sfc_main$g, {
+ item,
+ report: _ctx.report,
+ column: _ctx.column,
+ size: { width: 365, height: 700 }
+ }, null, 8, ["item", "report", "column"])
+ ])) : createCommentVNode("", true)
+ ], 64)) : createCommentVNode("", true)
+ ]);
+ }), 128))
+ ])) : createCommentVNode("", true)
+ ])) : createCommentVNode("", true);
+ };
+ }
+});
+const {
+ options: {
+ site,
+ client: {
+ columns: configColumns,
+ groupRoutesKey
+ },
+ websocketUrl: wsUrl,
+ apiUrl,
+ lighthouseOptions,
+ scanner: {
+ dynamicSampling,
+ throttle,
+ device
+ },
+ routerPrefix: basePath
+ }
+} = window.__unlighthouse_payload;
+const isStatic = window.__unlighthouse_static;
+const website = new $URL(site).origin;
+const categories = (lighthouseOptions == null ? void 0 : lighthouseOptions.onlyCategories) || ["performance", "accessibility", "best-practices", "seo"];
+const tabs = [
+ "Overview",
+ ...categories.map((c2) => {
+ if (c2 === "seo")
+ return "SEO";
+ if (c2 === "pwa")
+ return "PWA";
+ return startCase$1(c2);
+ })
+];
+const columns = Object.values(configColumns).map((columns2) => {
+ return columns2.map((column) => {
+ switch (column.key) {
+ case "report.audits.largest-contentful-paint":
+ column.component = _sfc_main$f;
+ break;
+ case "report.audits.cumulative-layout-shift":
+ column.component = _sfc_main$e;
+ break;
+ case "report.audits.network-requests":
+ column.component = _sfc_main$p;
+ break;
+ case "report.audits.diagnostics":
+ column.component = _sfc_main$o;
+ break;
+ case "report.audits.color-contrast":
+ column.component = _sfc_main$n;
+ break;
+ case "seo.description":
+ column.component = _sfc_main$m;
+ break;
+ case "report.audits.is-crawlable":
+ column.component = _sfc_main$l;
+ break;
+ case "report.audits.screenshot-thumbnails":
+ column.component = _sfc_main$k;
+ break;
+ case "seo.og.image":
+ column.component = _sfc_main$j;
+ break;
+ case "report.audits.tap-targets":
+ column.component = _sfc_main$i;
+ break;
+ }
+ switch (column.label) {
+ case "Core Web Vitals":
+ column.component = _sfc_main$h;
+ break;
+ }
+ return column;
+ });
+});
+function isArray(value) {
+ return !Array.isArray ? getTag(value) === "[object Array]" : Array.isArray(value);
+}
+const INFINITY = 1 / 0;
+function baseToString(value) {
+ if (typeof value == "string") {
+ return value;
+ }
+ let result = value + "";
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
+}
+function toString(value) {
+ return value == null ? "" : baseToString(value);
+}
+function isString(value) {
+ return typeof value === "string";
+}
+function isNumber(value) {
+ return typeof value === "number";
+}
+function isBoolean(value) {
+ return value === true || value === false || isObjectLike(value) && getTag(value) == "[object Boolean]";
+}
+function isObject(value) {
+ return typeof value === "object";
+}
+function isObjectLike(value) {
+ return isObject(value) && value !== null;
+}
+function isDefined(value) {
+ return value !== void 0 && value !== null;
+}
+function isBlank(value) {
+ return !value.trim().length;
+}
+function getTag(value) {
+ return value == null ? value === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(value);
+}
+const EXTENDED_SEARCH_UNAVAILABLE = "Extended search is not available";
+const INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
+const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) => `Invalid value for key ${key}`;
+const PATTERN_LENGTH_TOO_LARGE = (max2) => `Pattern length exceeds max of ${max2}.`;
+const MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;
+const INVALID_KEY_WEIGHT_VALUE = (key) => `Property 'weight' in key '${key}' must be a positive integer`;
+const hasOwn = Object.prototype.hasOwnProperty;
+class KeyStore {
+ constructor(keys2) {
+ this._keys = [];
+ this._keyMap = {};
+ let totalWeight = 0;
+ keys2.forEach((key) => {
+ let obj = createKey(key);
+ totalWeight += obj.weight;
+ this._keys.push(obj);
+ this._keyMap[obj.id] = obj;
+ totalWeight += obj.weight;
+ });
+ this._keys.forEach((key) => {
+ key.weight /= totalWeight;
+ });
+ }
+ get(keyId) {
+ return this._keyMap[keyId];
+ }
+ keys() {
+ return this._keys;
+ }
+ toJSON() {
+ return JSON.stringify(this._keys);
+ }
+}
+function createKey(key) {
+ let path = null;
+ let id = null;
+ let src = null;
+ let weight = 1;
+ let getFn = null;
+ if (isString(key) || isArray(key)) {
+ src = key;
+ path = createKeyPath(key);
+ id = createKeyId(key);
+ } else {
+ if (!hasOwn.call(key, "name")) {
+ throw new Error(MISSING_KEY_PROPERTY("name"));
+ }
+ const name = key.name;
+ src = name;
+ if (hasOwn.call(key, "weight")) {
+ weight = key.weight;
+ if (weight <= 0) {
+ throw new Error(INVALID_KEY_WEIGHT_VALUE(name));
+ }
+ }
+ path = createKeyPath(name);
+ id = createKeyId(name);
+ getFn = key.getFn;
+ }
+ return { path, id, weight, src, getFn };
+}
+function createKeyPath(key) {
+ return isArray(key) ? key : key.split(".");
+}
+function createKeyId(key) {
+ return isArray(key) ? key.join(".") : key;
+}
+function get(obj, path) {
+ let list = [];
+ let arr = false;
+ const deepGet = (obj2, path2, index) => {
+ if (!isDefined(obj2)) {
+ return;
+ }
+ if (!path2[index]) {
+ list.push(obj2);
+ } else {
+ let key = path2[index];
+ const value = obj2[key];
+ if (!isDefined(value)) {
+ return;
+ }
+ if (index === path2.length - 1 && (isString(value) || isNumber(value) || isBoolean(value))) {
+ list.push(toString(value));
+ } else if (isArray(value)) {
+ arr = true;
+ for (let i = 0, len = value.length; i < len; i += 1) {
+ deepGet(value[i], path2, index + 1);
+ }
+ } else if (path2.length) {
+ deepGet(value, path2, index + 1);
+ }
+ }
+ };
+ deepGet(obj, isString(path) ? path.split(".") : path, 0);
+ return arr ? list : list[0];
+}
+const MatchOptions = {
+ includeMatches: false,
+ findAllMatches: false,
+ minMatchCharLength: 1
+};
+const BasicOptions = {
+ isCaseSensitive: false,
+ includeScore: false,
+ keys: [],
+ shouldSort: true,
+ sortFn: (a2, b3) => a2.score === b3.score ? a2.idx < b3.idx ? -1 : 1 : a2.score < b3.score ? -1 : 1
+};
+const FuzzyOptions = {
+ location: 0,
+ threshold: 0.6,
+ distance: 100
+};
+const AdvancedOptions = {
+ useExtendedSearch: false,
+ getFn: get,
+ ignoreLocation: false,
+ ignoreFieldNorm: false,
+ fieldNormWeight: 1
+};
+var Config = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, BasicOptions), MatchOptions), FuzzyOptions), AdvancedOptions);
+const SPACE = /[^ ]+/g;
+function norm(weight = 1, mantissa = 3) {
+ const cache = /* @__PURE__ */ new Map();
+ const m2 = Math.pow(10, mantissa);
+ return {
+ get(value) {
+ const numTokens = value.match(SPACE).length;
+ if (cache.has(numTokens)) {
+ return cache.get(numTokens);
+ }
+ const norm2 = 1 / Math.pow(numTokens, 0.5 * weight);
+ const n2 = parseFloat(Math.round(norm2 * m2) / m2);
+ cache.set(numTokens, n2);
+ return n2;
+ },
+ clear() {
+ cache.clear();
+ }
+ };
+}
+class FuseIndex {
+ constructor({
+ getFn = Config.getFn,
+ fieldNormWeight = Config.fieldNormWeight
+ } = {}) {
+ this.norm = norm(fieldNormWeight, 3);
+ this.getFn = getFn;
+ this.isCreated = false;
+ this.setIndexRecords();
+ }
+ setSources(docs = []) {
+ this.docs = docs;
+ }
+ setIndexRecords(records = []) {
+ this.records = records;
+ }
+ setKeys(keys2 = []) {
+ this.keys = keys2;
+ this._keysMap = {};
+ keys2.forEach((key, idx) => {
+ this._keysMap[key.id] = idx;
+ });
+ }
+ create() {
+ if (this.isCreated || !this.docs.length) {
+ return;
+ }
+ this.isCreated = true;
+ if (isString(this.docs[0])) {
+ this.docs.forEach((doc2, docIndex) => {
+ this._addString(doc2, docIndex);
+ });
+ } else {
+ this.docs.forEach((doc2, docIndex) => {
+ this._addObject(doc2, docIndex);
+ });
+ }
+ this.norm.clear();
+ }
+ add(doc2) {
+ const idx = this.size();
+ if (isString(doc2)) {
+ this._addString(doc2, idx);
+ } else {
+ this._addObject(doc2, idx);
+ }
+ }
+ removeAt(idx) {
+ this.records.splice(idx, 1);
+ for (let i = idx, len = this.size(); i < len; i += 1) {
+ this.records[i].i -= 1;
+ }
+ }
+ getValueForItemAtKeyId(item, keyId) {
+ return item[this._keysMap[keyId]];
+ }
+ size() {
+ return this.records.length;
+ }
+ _addString(doc2, docIndex) {
+ if (!isDefined(doc2) || isBlank(doc2)) {
+ return;
+ }
+ let record = {
+ v: doc2,
+ i: docIndex,
+ n: this.norm.get(doc2)
+ };
+ this.records.push(record);
+ }
+ _addObject(doc2, docIndex) {
+ let record = { i: docIndex, $: {} };
+ this.keys.forEach((key, keyIndex) => {
+ let value = key.getFn ? key.getFn(doc2) : this.getFn(doc2, key.path);
+ if (!isDefined(value)) {
+ return;
+ }
+ if (isArray(value)) {
+ let subRecords = [];
+ const stack = [{ nestedArrIndex: -1, value }];
+ while (stack.length) {
+ const { nestedArrIndex, value: value2 } = stack.pop();
+ if (!isDefined(value2)) {
+ continue;
+ }
+ if (isString(value2) && !isBlank(value2)) {
+ let subRecord = {
+ v: value2,
+ i: nestedArrIndex,
+ n: this.norm.get(value2)
+ };
+ subRecords.push(subRecord);
+ } else if (isArray(value2)) {
+ value2.forEach((item, k2) => {
+ stack.push({
+ nestedArrIndex: k2,
+ value: item
+ });
+ });
+ } else
+ ;
+ }
+ record.$[keyIndex] = subRecords;
+ } else if (isString(value) && !isBlank(value)) {
+ let subRecord = {
+ v: value,
+ n: this.norm.get(value)
+ };
+ record.$[keyIndex] = subRecord;
+ }
+ });
+ this.records.push(record);
+ }
+ toJSON() {
+ return {
+ keys: this.keys,
+ records: this.records
+ };
+ }
+}
+function createIndex(keys2, docs, { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {
+ const myIndex = new FuseIndex({ getFn, fieldNormWeight });
+ myIndex.setKeys(keys2.map(createKey));
+ myIndex.setSources(docs);
+ myIndex.create();
+ return myIndex;
+}
+function parseIndex(data, { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {
+ const { keys: keys2, records } = data;
+ const myIndex = new FuseIndex({ getFn, fieldNormWeight });
+ myIndex.setKeys(keys2);
+ myIndex.setIndexRecords(records);
+ return myIndex;
+}
+function computeScore$1(pattern, {
+ errors = 0,
+ currentLocation = 0,
+ expectedLocation = 0,
+ distance = Config.distance,
+ ignoreLocation = Config.ignoreLocation
+} = {}) {
+ const accuracy = errors / pattern.length;
+ if (ignoreLocation) {
+ return accuracy;
+ }
+ const proximity = Math.abs(expectedLocation - currentLocation);
+ if (!distance) {
+ return proximity ? 1 : accuracy;
+ }
+ return accuracy + proximity / distance;
+}
+function convertMaskToIndices(matchmask = [], minMatchCharLength = Config.minMatchCharLength) {
+ let indices = [];
+ let start = -1;
+ let end = -1;
+ let i = 0;
+ for (let len = matchmask.length; i < len; i += 1) {
+ let match2 = matchmask[i];
+ if (match2 && start === -1) {
+ start = i;
+ } else if (!match2 && start !== -1) {
+ end = i - 1;
+ if (end - start + 1 >= minMatchCharLength) {
+ indices.push([start, end]);
+ }
+ start = -1;
+ }
+ }
+ if (matchmask[i - 1] && i - start >= minMatchCharLength) {
+ indices.push([start, i - 1]);
+ }
+ return indices;
+}
+const MAX_BITS = 32;
+function search(text, pattern, patternAlphabet, {
+ location: location2 = Config.location,
+ distance = Config.distance,
+ threshold = Config.threshold,
+ findAllMatches = Config.findAllMatches,
+ minMatchCharLength = Config.minMatchCharLength,
+ includeMatches = Config.includeMatches,
+ ignoreLocation = Config.ignoreLocation
+} = {}) {
+ if (pattern.length > MAX_BITS) {
+ throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));
+ }
+ const patternLen = pattern.length;
+ const textLen = text.length;
+ const expectedLocation = Math.max(0, Math.min(location2, textLen));
+ let currentThreshold = threshold;
+ let bestLocation = expectedLocation;
+ const computeMatches = minMatchCharLength > 1 || includeMatches;
+ const matchMask = computeMatches ? Array(textLen) : [];
+ let index;
+ while ((index = text.indexOf(pattern, bestLocation)) > -1) {
+ let score = computeScore$1(pattern, {
+ currentLocation: index,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+ currentThreshold = Math.min(score, currentThreshold);
+ bestLocation = index + patternLen;
+ if (computeMatches) {
+ let i = 0;
+ while (i < patternLen) {
+ matchMask[index + i] = 1;
+ i += 1;
+ }
+ }
+ }
+ bestLocation = -1;
+ let lastBitArr = [];
+ let finalScore = 1;
+ let binMax = patternLen + textLen;
+ const mask = 1 << patternLen - 1;
+ for (let i = 0; i < patternLen; i += 1) {
+ let binMin = 0;
+ let binMid = binMax;
+ while (binMin < binMid) {
+ const score2 = computeScore$1(pattern, {
+ errors: i,
+ currentLocation: expectedLocation + binMid,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+ if (score2 <= currentThreshold) {
+ binMin = binMid;
+ } else {
+ binMax = binMid;
+ }
+ binMid = Math.floor((binMax - binMin) / 2 + binMin);
+ }
+ binMax = binMid;
+ let start = Math.max(1, expectedLocation - binMid + 1);
+ let finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen;
+ let bitArr = Array(finish + 2);
+ bitArr[finish + 1] = (1 << i) - 1;
+ for (let j2 = finish; j2 >= start; j2 -= 1) {
+ let currentLocation = j2 - 1;
+ let charMatch = patternAlphabet[text.charAt(currentLocation)];
+ if (computeMatches) {
+ matchMask[currentLocation] = +!!charMatch;
+ }
+ bitArr[j2] = (bitArr[j2 + 1] << 1 | 1) & charMatch;
+ if (i) {
+ bitArr[j2] |= (lastBitArr[j2 + 1] | lastBitArr[j2]) << 1 | 1 | lastBitArr[j2 + 1];
+ }
+ if (bitArr[j2] & mask) {
+ finalScore = computeScore$1(pattern, {
+ errors: i,
+ currentLocation,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+ if (finalScore <= currentThreshold) {
+ currentThreshold = finalScore;
+ bestLocation = currentLocation;
+ if (bestLocation <= expectedLocation) {
+ break;
+ }
+ start = Math.max(1, 2 * expectedLocation - bestLocation);
+ }
+ }
+ }
+ const score = computeScore$1(pattern, {
+ errors: i + 1,
+ currentLocation: expectedLocation,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+ if (score > currentThreshold) {
+ break;
+ }
+ lastBitArr = bitArr;
+ }
+ const result = {
+ isMatch: bestLocation >= 0,
+ score: Math.max(1e-3, finalScore)
+ };
+ if (computeMatches) {
+ const indices = convertMaskToIndices(matchMask, minMatchCharLength);
+ if (!indices.length) {
+ result.isMatch = false;
+ } else if (includeMatches) {
+ result.indices = indices;
+ }
+ }
+ return result;
+}
+function createPatternAlphabet(pattern) {
+ let mask = {};
+ for (let i = 0, len = pattern.length; i < len; i += 1) {
+ const char = pattern.charAt(i);
+ mask[char] = (mask[char] || 0) | 1 << len - i - 1;
+ }
+ return mask;
+}
+class BitapSearch {
+ constructor(pattern, {
+ location: location2 = Config.location,
+ threshold = Config.threshold,
+ distance = Config.distance,
+ includeMatches = Config.includeMatches,
+ findAllMatches = Config.findAllMatches,
+ minMatchCharLength = Config.minMatchCharLength,
+ isCaseSensitive = Config.isCaseSensitive,
+ ignoreLocation = Config.ignoreLocation
+ } = {}) {
+ this.options = {
+ location: location2,
+ threshold,
+ distance,
+ includeMatches,
+ findAllMatches,
+ minMatchCharLength,
+ isCaseSensitive,
+ ignoreLocation
+ };
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+ this.chunks = [];
+ if (!this.pattern.length) {
+ return;
+ }
+ const addChunk = (pattern2, startIndex) => {
+ this.chunks.push({
+ pattern: pattern2,
+ alphabet: createPatternAlphabet(pattern2),
+ startIndex
+ });
+ };
+ const len = this.pattern.length;
+ if (len > MAX_BITS) {
+ let i = 0;
+ const remainder = len % MAX_BITS;
+ const end = len - remainder;
+ while (i < end) {
+ addChunk(this.pattern.substr(i, MAX_BITS), i);
+ i += MAX_BITS;
+ }
+ if (remainder) {
+ const startIndex = len - MAX_BITS;
+ addChunk(this.pattern.substr(startIndex), startIndex);
+ }
+ } else {
+ addChunk(this.pattern, 0);
+ }
+ }
+ searchIn(text) {
+ const { isCaseSensitive, includeMatches } = this.options;
+ if (!isCaseSensitive) {
+ text = text.toLowerCase();
+ }
+ if (this.pattern === text) {
+ let result2 = {
+ isMatch: true,
+ score: 0
+ };
+ if (includeMatches) {
+ result2.indices = [[0, text.length - 1]];
+ }
+ return result2;
+ }
+ const {
+ location: location2,
+ distance,
+ threshold,
+ findAllMatches,
+ minMatchCharLength,
+ ignoreLocation
+ } = this.options;
+ let allIndices = [];
+ let totalScore = 0;
+ let hasMatches = false;
+ this.chunks.forEach(({ pattern, alphabet, startIndex }) => {
+ const { isMatch, score, indices } = search(text, pattern, alphabet, {
+ location: location2 + startIndex,
+ distance,
+ threshold,
+ findAllMatches,
+ minMatchCharLength,
+ includeMatches,
+ ignoreLocation
+ });
+ if (isMatch) {
+ hasMatches = true;
+ }
+ totalScore += score;
+ if (isMatch && indices) {
+ allIndices = [...allIndices, ...indices];
+ }
+ });
+ let result = {
+ isMatch: hasMatches,
+ score: hasMatches ? totalScore / this.chunks.length : 1
+ };
+ if (hasMatches && includeMatches) {
+ result.indices = allIndices;
+ }
+ return result;
+ }
+}
+class BaseMatch {
+ constructor(pattern) {
+ this.pattern = pattern;
+ }
+ static isMultiMatch(pattern) {
+ return getMatch(pattern, this.multiRegex);
+ }
+ static isSingleMatch(pattern) {
+ return getMatch(pattern, this.singleRegex);
+ }
+ search() {
+ }
+}
+function getMatch(pattern, exp) {
+ const matches = pattern.match(exp);
+ return matches ? matches[1] : null;
+}
+class ExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return "exact";
+ }
+ static get multiRegex() {
+ return /^="(.*)"$/;
+ }
+ static get singleRegex() {
+ return /^=(.*)$/;
+ }
+ search(text) {
+ const isMatch = text === this.pattern;
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, this.pattern.length - 1]
+ };
+ }
+}
+class InverseExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return "inverse-exact";
+ }
+ static get multiRegex() {
+ return /^!"(.*)"$/;
+ }
+ static get singleRegex() {
+ return /^!(.*)$/;
+ }
+ search(text) {
+ const index = text.indexOf(this.pattern);
+ const isMatch = index === -1;
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ };
+ }
+}
+class PrefixExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return "prefix-exact";
+ }
+ static get multiRegex() {
+ return /^\^"(.*)"$/;
+ }
+ static get singleRegex() {
+ return /^\^(.*)$/;
+ }
+ search(text) {
+ const isMatch = text.startsWith(this.pattern);
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, this.pattern.length - 1]
+ };
+ }
+}
+class InversePrefixExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return "inverse-prefix-exact";
+ }
+ static get multiRegex() {
+ return /^!\^"(.*)"$/;
+ }
+ static get singleRegex() {
+ return /^!\^(.*)$/;
+ }
+ search(text) {
+ const isMatch = !text.startsWith(this.pattern);
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ };
+ }
+}
+class SuffixExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return "suffix-exact";
+ }
+ static get multiRegex() {
+ return /^"(.*)"\$$/;
+ }
+ static get singleRegex() {
+ return /^(.*)\$$/;
+ }
+ search(text) {
+ const isMatch = text.endsWith(this.pattern);
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [text.length - this.pattern.length, text.length - 1]
+ };
+ }
+}
+class InverseSuffixExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return "inverse-suffix-exact";
+ }
+ static get multiRegex() {
+ return /^!"(.*)"\$$/;
+ }
+ static get singleRegex() {
+ return /^!(.*)\$$/;
+ }
+ search(text) {
+ const isMatch = !text.endsWith(this.pattern);
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ };
+ }
+}
+class FuzzyMatch extends BaseMatch {
+ constructor(pattern, {
+ location: location2 = Config.location,
+ threshold = Config.threshold,
+ distance = Config.distance,
+ includeMatches = Config.includeMatches,
+ findAllMatches = Config.findAllMatches,
+ minMatchCharLength = Config.minMatchCharLength,
+ isCaseSensitive = Config.isCaseSensitive,
+ ignoreLocation = Config.ignoreLocation
+ } = {}) {
+ super(pattern);
+ this._bitapSearch = new BitapSearch(pattern, {
+ location: location2,
+ threshold,
+ distance,
+ includeMatches,
+ findAllMatches,
+ minMatchCharLength,
+ isCaseSensitive,
+ ignoreLocation
+ });
+ }
+ static get type() {
+ return "fuzzy";
+ }
+ static get multiRegex() {
+ return /^"(.*)"$/;
+ }
+ static get singleRegex() {
+ return /^(.*)$/;
+ }
+ search(text) {
+ return this._bitapSearch.searchIn(text);
+ }
+}
+class IncludeMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return "include";
+ }
+ static get multiRegex() {
+ return /^'"(.*)"$/;
+ }
+ static get singleRegex() {
+ return /^'(.*)$/;
+ }
+ search(text) {
+ let location2 = 0;
+ let index;
+ const indices = [];
+ const patternLen = this.pattern.length;
+ while ((index = text.indexOf(this.pattern, location2)) > -1) {
+ location2 = index + patternLen;
+ indices.push([index, location2 - 1]);
+ }
+ const isMatch = !!indices.length;
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices
+ };
+ }
+}
+const searchers = [
+ ExactMatch,
+ IncludeMatch,
+ PrefixExactMatch,
+ InversePrefixExactMatch,
+ InverseSuffixExactMatch,
+ SuffixExactMatch,
+ InverseExactMatch,
+ FuzzyMatch
+];
+const searchersLen = searchers.length;
+const SPACE_RE = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;
+const OR_TOKEN = "|";
+function parseQuery(pattern, options = {}) {
+ return pattern.split(OR_TOKEN).map((item) => {
+ let query = item.trim().split(SPACE_RE).filter((item2) => item2 && !!item2.trim());
+ let results = [];
+ for (let i = 0, len = query.length; i < len; i += 1) {
+ const queryItem = query[i];
+ let found = false;
+ let idx = -1;
+ while (!found && ++idx < searchersLen) {
+ const searcher = searchers[idx];
+ let token = searcher.isMultiMatch(queryItem);
+ if (token) {
+ results.push(new searcher(token, options));
+ found = true;
+ }
+ }
+ if (found) {
+ continue;
+ }
+ idx = -1;
+ while (++idx < searchersLen) {
+ const searcher = searchers[idx];
+ let token = searcher.isSingleMatch(queryItem);
+ if (token) {
+ results.push(new searcher(token, options));
+ break;
+ }
+ }
+ }
+ return results;
+ });
+}
+const MultiMatchSet = /* @__PURE__ */ new Set([FuzzyMatch.type, IncludeMatch.type]);
+class ExtendedSearch {
+ constructor(pattern, {
+ isCaseSensitive = Config.isCaseSensitive,
+ includeMatches = Config.includeMatches,
+ minMatchCharLength = Config.minMatchCharLength,
+ ignoreLocation = Config.ignoreLocation,
+ findAllMatches = Config.findAllMatches,
+ location: location2 = Config.location,
+ threshold = Config.threshold,
+ distance = Config.distance
+ } = {}) {
+ this.query = null;
+ this.options = {
+ isCaseSensitive,
+ includeMatches,
+ minMatchCharLength,
+ findAllMatches,
+ ignoreLocation,
+ location: location2,
+ threshold,
+ distance
+ };
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+ this.query = parseQuery(this.pattern, this.options);
+ }
+ static condition(_, options) {
+ return options.useExtendedSearch;
+ }
+ searchIn(text) {
+ const query = this.query;
+ if (!query) {
+ return {
+ isMatch: false,
+ score: 1
+ };
+ }
+ const { includeMatches, isCaseSensitive } = this.options;
+ text = isCaseSensitive ? text : text.toLowerCase();
+ let numMatches = 0;
+ let allIndices = [];
+ let totalScore = 0;
+ for (let i = 0, qLen = query.length; i < qLen; i += 1) {
+ const searchers2 = query[i];
+ allIndices.length = 0;
+ numMatches = 0;
+ for (let j2 = 0, pLen = searchers2.length; j2 < pLen; j2 += 1) {
+ const searcher = searchers2[j2];
+ const { isMatch, indices, score } = searcher.search(text);
+ if (isMatch) {
+ numMatches += 1;
+ totalScore += score;
+ if (includeMatches) {
+ const type = searcher.constructor.type;
+ if (MultiMatchSet.has(type)) {
+ allIndices = [...allIndices, ...indices];
+ } else {
+ allIndices.push(indices);
+ }
+ }
+ } else {
+ totalScore = 0;
+ numMatches = 0;
+ allIndices.length = 0;
+ break;
+ }
+ }
+ if (numMatches) {
+ let result = {
+ isMatch: true,
+ score: totalScore / numMatches
+ };
+ if (includeMatches) {
+ result.indices = allIndices;
+ }
+ return result;
+ }
+ }
+ return {
+ isMatch: false,
+ score: 1
+ };
+ }
+}
+const registeredSearchers = [];
+function register(...args) {
+ registeredSearchers.push(...args);
+}
+function createSearcher(pattern, options) {
+ for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {
+ let searcherClass = registeredSearchers[i];
+ if (searcherClass.condition(pattern, options)) {
+ return new searcherClass(pattern, options);
+ }
+ }
+ return new BitapSearch(pattern, options);
+}
+const LogicalOperator = {
+ AND: "$and",
+ OR: "$or"
+};
+const KeyType = {
+ PATH: "$path",
+ PATTERN: "$val"
+};
+const isExpression = (query) => !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
+const isPath = (query) => !!query[KeyType.PATH];
+const isLeaf = (query) => !isArray(query) && isObject(query) && !isExpression(query);
+const convertToExplicit = (query) => ({
+ [LogicalOperator.AND]: Object.keys(query).map((key) => ({
+ [key]: query[key]
+ }))
+});
+function parse(query, options, { auto = true } = {}) {
+ const next = (query2) => {
+ let keys2 = Object.keys(query2);
+ const isQueryPath = isPath(query2);
+ if (!isQueryPath && keys2.length > 1 && !isExpression(query2)) {
+ return next(convertToExplicit(query2));
+ }
+ if (isLeaf(query2)) {
+ const key = isQueryPath ? query2[KeyType.PATH] : keys2[0];
+ const pattern = isQueryPath ? query2[KeyType.PATTERN] : query2[key];
+ if (!isString(pattern)) {
+ throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));
+ }
+ const obj = {
+ keyId: createKeyId(key),
+ pattern
+ };
+ if (auto) {
+ obj.searcher = createSearcher(pattern, options);
+ }
+ return obj;
+ }
+ let node = {
+ children: [],
+ operator: keys2[0]
+ };
+ keys2.forEach((key) => {
+ const value = query2[key];
+ if (isArray(value)) {
+ value.forEach((item) => {
+ node.children.push(next(item));
+ });
+ }
+ });
+ return node;
+ };
+ if (!isExpression(query)) {
+ query = convertToExplicit(query);
+ }
+ return next(query);
+}
+function computeScore(results, { ignoreFieldNorm = Config.ignoreFieldNorm }) {
+ results.forEach((result) => {
+ let totalScore = 1;
+ result.matches.forEach(({ key, norm: norm2, score }) => {
+ const weight = key ? key.weight : null;
+ totalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm2));
+ });
+ result.score = totalScore;
+ });
+}
+function transformMatches(result, data) {
+ const matches = result.matches;
+ data.matches = [];
+ if (!isDefined(matches)) {
+ return;
+ }
+ matches.forEach((match2) => {
+ if (!isDefined(match2.indices) || !match2.indices.length) {
+ return;
+ }
+ const { indices, value } = match2;
+ let obj = {
+ indices,
+ value
+ };
+ if (match2.key) {
+ obj.key = match2.key.src;
+ }
+ if (match2.idx > -1) {
+ obj.refIndex = match2.idx;
+ }
+ data.matches.push(obj);
+ });
+}
+function transformScore(result, data) {
+ data.score = result.score;
+}
+function format(results, docs, {
+ includeMatches = Config.includeMatches,
+ includeScore = Config.includeScore
+} = {}) {
+ const transformers = [];
+ if (includeMatches)
+ transformers.push(transformMatches);
+ if (includeScore)
+ transformers.push(transformScore);
+ return results.map((result) => {
+ const { idx } = result;
+ const data = {
+ item: docs[idx],
+ refIndex: idx
+ };
+ if (transformers.length) {
+ transformers.forEach((transformer) => {
+ transformer(result, data);
+ });
+ }
+ return data;
+ });
+}
+class Fuse {
+ constructor(docs, options = {}, index) {
+ this.options = __spreadValues(__spreadValues({}, Config), options);
+ if (this.options.useExtendedSearch && false) {
+ throw new Error(EXTENDED_SEARCH_UNAVAILABLE);
+ }
+ this._keyStore = new KeyStore(this.options.keys);
+ this.setCollection(docs, index);
+ }
+ setCollection(docs, index) {
+ this._docs = docs;
+ if (index && !(index instanceof FuseIndex)) {
+ throw new Error(INCORRECT_INDEX_TYPE);
+ }
+ this._myIndex = index || createIndex(this.options.keys, this._docs, {
+ getFn: this.options.getFn,
+ fieldNormWeight: this.options.fieldNormWeight
+ });
+ }
+ add(doc2) {
+ if (!isDefined(doc2)) {
+ return;
+ }
+ this._docs.push(doc2);
+ this._myIndex.add(doc2);
+ }
+ remove(predicate = () => false) {
+ const results = [];
+ for (let i = 0, len = this._docs.length; i < len; i += 1) {
+ const doc2 = this._docs[i];
+ if (predicate(doc2, i)) {
+ this.removeAt(i);
+ i -= 1;
+ len -= 1;
+ results.push(doc2);
+ }
+ }
+ return results;
+ }
+ removeAt(idx) {
+ this._docs.splice(idx, 1);
+ this._myIndex.removeAt(idx);
+ }
+ getIndex() {
+ return this._myIndex;
+ }
+ search(query, { limit = -1 } = {}) {
+ const {
+ includeMatches,
+ includeScore,
+ shouldSort,
+ sortFn,
+ ignoreFieldNorm
+ } = this.options;
+ let results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);
+ computeScore(results, { ignoreFieldNorm });
+ if (shouldSort) {
+ results.sort(sortFn);
+ }
+ if (isNumber(limit) && limit > -1) {
+ results = results.slice(0, limit);
+ }
+ return format(results, this._docs, {
+ includeMatches,
+ includeScore
+ });
+ }
+ _searchStringList(query) {
+ const searcher = createSearcher(query, this.options);
+ const { records } = this._myIndex;
+ const results = [];
+ records.forEach(({ v: text, i: idx, n: norm2 }) => {
+ if (!isDefined(text)) {
+ return;
+ }
+ const { isMatch, score, indices } = searcher.searchIn(text);
+ if (isMatch) {
+ results.push({
+ item: text,
+ idx,
+ matches: [{ score, value: text, norm: norm2, indices }]
+ });
+ }
+ });
+ return results;
+ }
+ _searchLogical(query) {
+ const expression = parse(query, this.options);
+ const evaluate = (node, item, idx) => {
+ if (!node.children) {
+ const { keyId, searcher } = node;
+ const matches = this._findMatches({
+ key: this._keyStore.get(keyId),
+ value: this._myIndex.getValueForItemAtKeyId(item, keyId),
+ searcher
+ });
+ if (matches && matches.length) {
+ return [
+ {
+ idx,
+ item,
+ matches
+ }
+ ];
+ }
+ return [];
+ }
+ const res = [];
+ for (let i = 0, len = node.children.length; i < len; i += 1) {
+ const child = node.children[i];
+ const result = evaluate(child, item, idx);
+ if (result.length) {
+ res.push(...result);
+ } else if (node.operator === LogicalOperator.AND) {
+ return [];
+ }
+ }
+ return res;
+ };
+ const records = this._myIndex.records;
+ const resultMap = {};
+ const results = [];
+ records.forEach(({ $: item, i: idx }) => {
+ if (isDefined(item)) {
+ let expResults = evaluate(expression, item, idx);
+ if (expResults.length) {
+ if (!resultMap[idx]) {
+ resultMap[idx] = { idx, item, matches: [] };
+ results.push(resultMap[idx]);
+ }
+ expResults.forEach(({ matches }) => {
+ resultMap[idx].matches.push(...matches);
+ });
+ }
+ }
+ });
+ return results;
+ }
+ _searchObjectList(query) {
+ const searcher = createSearcher(query, this.options);
+ const { keys: keys2, records } = this._myIndex;
+ const results = [];
+ records.forEach(({ $: item, i: idx }) => {
+ if (!isDefined(item)) {
+ return;
+ }
+ let matches = [];
+ keys2.forEach((key, keyIndex) => {
+ matches.push(...this._findMatches({
+ key,
+ value: item[keyIndex],
+ searcher
+ }));
+ });
+ if (matches.length) {
+ results.push({
+ idx,
+ item,
+ matches
+ });
+ }
+ });
+ return results;
+ }
+ _findMatches({ key, value, searcher }) {
+ if (!isDefined(value)) {
+ return [];
+ }
+ let matches = [];
+ if (isArray(value)) {
+ value.forEach(({ v: text, i: idx, n: norm2 }) => {
+ if (!isDefined(text)) {
+ return;
+ }
+ const { isMatch, score, indices } = searcher.searchIn(text);
+ if (isMatch) {
+ matches.push({
+ score,
+ key,
+ value: text,
+ idx,
+ norm: norm2,
+ indices
+ });
+ }
+ });
+ } else {
+ const { v: text, n: norm2 } = value;
+ const { isMatch, score, indices } = searcher.searchIn(text);
+ if (isMatch) {
+ matches.push({ score, key, value: text, norm: norm2, indices });
+ }
+ }
+ return matches;
+ }
+}
+Fuse.version = "6.6.2";
+Fuse.createIndex = createIndex;
+Fuse.parseIndex = parseIndex;
+Fuse.config = Config;
+{
+ Fuse.parseQuery = parse;
+}
+{
+ register(ExtendedSearch);
+}
+const searchText = useStorage("unlighthouse-search-text", "");
+const sorting = useStorage("unlighthouse-sort", { key: groupRoutesKey, dir: "asc" });
+function incrementSort(key) {
+ const val = sorting.value;
+ if (val.key === key) {
+ const sort = val.dir;
+ if (typeof sort === "undefined")
+ sorting.value.dir = "asc";
+ else if (sort === "asc")
+ sorting.value.dir = "desc";
+ else
+ sorting.value = {};
+ } else {
+ sorting.value.key = key;
+ sorting.value.dir = "asc";
+ }
+}
+const searchResults = computed(() => {
+ let data = unlighthouseReports.value;
+ if (searchText.value) {
+ const fuse = new Fuse(data, {
+ threshold: 0.3,
+ shouldSort: isEmpty(sorting.value),
+ keys: [
+ "route.definition.name",
+ "route.path",
+ "seo.title"
+ ]
+ });
+ data = fuse.search(searchText.value).map((i) => i.item);
+ }
+ if (sorting.value.key) {
+ let sortKey = sorting.value.key;
+ let doLengthSort = false;
+ const columnDefinition = columns.flat().find((c2) => c2.key === sortKey);
+ if (columnDefinition == null ? void 0 : columnDefinition.sortKey) {
+ if (columnDefinition.sortKey.startsWith("length:")) {
+ doLengthSort = true;
+ sortKey = `${sortKey}.${columnDefinition.sortKey.replace("length:", "")}`;
+ } else {
+ sortKey = `${sortKey}.${columnDefinition.sortKey}`;
+ }
+ }
+ data = orderBy(data, doLengthSort ? (i) => {
+ var _a2;
+ return ((_a2 = get$1(i, sortKey)) == null ? void 0 : _a2.length) || 0;
+ } : sortKey, sorting.value.dir);
+ } else {
+ data = orderBy(data, groupRoutesKey, "asc");
+ }
+ return groupBy$1(data, !sorting.value.key || sorting.value.key === groupRoutesKey ? groupRoutesKey : "route.path");
+});
+function useFetch(url) {
+ const fetch2 = createFetch({ baseUrl: apiUrl });
+ return fetch2(url);
+}
+const activeTab = ref(0);
+const isModalOpen = ref(false);
+const iframeModalUrl = ref();
+const isDebugModalOpen = ref(false);
+function closeIframeModal() {
+ isModalOpen.value = false;
+ iframeModalUrl.value = "";
+ isDebugModalOpen.value = false;
+}
+function openDebugModal() {
+ isModalOpen.value = true;
+ isDebugModalOpen.value = true;
+}
+function openLighthouseReportIframeModal(report, tab) {
+ const path = `${report.artifactUrl}/lighthouse.html`;
+ iframeModalUrl.value = `${path}${tab ? `#${tab}` : ""}`;
+ isDebugModalOpen.value = false;
+ isModalOpen.value = true;
+}
+function changedTab(index) {
+ activeTab.value = index;
+ sorting.value = {};
+}
+const resultColumns = computed(() => {
+ return [
+ {
+ label: "Route Name",
+ slot: "routeName",
+ key: "route.path",
+ sortable: true,
+ component: _sfc_main$u,
+ cols: 2
+ },
+ {
+ label: "Score",
+ key: activeTab.value === 0 ? "report.score" : `report.categories.${categories[activeTab.value - 1]}.score`,
+ sortable: true,
+ cols: activeTab.value === 0 ? 3 : 1,
+ component: activeTab.value === 0 ? _sfc_main$r : _sfc_main$q
+ },
+ ...columns[activeTab.value],
+ {
+ label: "Actions",
+ cols: 1,
+ slot: "actions",
+ classes: ["items-end justify-end"]
+ }
+ ];
+});
+const wsReports = reactive(/* @__PURE__ */ new Map());
+const unlighthouseReports = computed(() => {
+ var _a2;
+ return isStatic ? (_a2 = window.__unlighthouse_payload) == null ? void 0 : _a2.reports : Array.from(wsReports.values());
+});
+const fetchedScanMeta = isStatic ? null : reactive(useFetch("/scan-meta").get().json());
+const lastScanMeta = ref(null);
+const isOffline = computed(() => {
+ if (isStatic)
+ return true;
+ return !!(!(fetchedScanMeta == null ? void 0 : fetchedScanMeta.data) && lastScanMeta.value);
+});
+const rescanRoute = (route) => useFetch(`/reports/${route.id}/rescan`).post();
+const scanMeta = computed(() => {
+ var _a2;
+ if (isStatic)
+ return (_a2 = window.__unlighthouse_payload) == null ? void 0 : _a2.scanMeta;
+ if (fetchedScanMeta == null ? void 0 : fetchedScanMeta.data)
+ return fetchedScanMeta == null ? void 0 : fetchedScanMeta.data;
+ if (lastScanMeta.value)
+ return lastScanMeta.value;
+ return null;
+});
+function refreshScanMeta() {
+ if (!fetchedScanMeta)
+ return;
+ const res = fetchedScanMeta.execute();
+ if (fetchedScanMeta == null ? void 0 : fetchedScanMeta.data)
+ lastScanMeta.value = fetchedScanMeta == null ? void 0 : fetchedScanMeta.data;
+ return res;
+}
+async function wsConnect() {
+ var _a2;
+ const ws = new WebSocket(wsUrl);
+ ws.onmessage = (message) => {
+ const { response } = JSON.parse(message.data);
+ wsReports.set(response.route.path, response);
+ };
+ const reports = await useFetch("/reports").get().json();
+ (_a2 = reports.data.value) == null ? void 0 : _a2.forEach((report) => {
+ wsReports.set(report.route.path, report);
+ });
+}
+const categoryScores = computed(() => {
+ const reportsFinished = unlighthouseReports.value.filter((r2) => !!r2.report);
+ return categories.map((c2, i) => {
+ const reportsWithGoodScore = reportsFinished.filter((r2) => {
+ var _a2, _b2;
+ return !!((_b2 = (_a2 = r2.report) == null ? void 0 : _a2.categories) == null ? void 0 : _b2[i].score);
+ });
+ return sum(reportsWithGoodScore.map((r2) => {
+ var _a2, _b2;
+ return (_b2 = (_a2 = r2.report) == null ? void 0 : _a2.categories) == null ? void 0 : _b2[i].score;
+ })) / reportsWithGoodScore.length;
+ });
+});
+function extractBgColor(str) {
+ const regex = /background color: (.*?),/gm;
+ const m2 = regex.exec(str);
+ if (m2 !== null) {
+ return m2[1];
+ }
+}
+function extractFgColor(str) {
+ const regex = /foreground color: (.*?),/gm;
+ const m2 = regex.exec(str);
+ if (m2 !== null) {
+ return m2[1];
+ }
+}
+function formatBytes(bytes, decimals = 2) {
+ if (bytes === 0)
+ return "0B";
+ const k2 = 1024;
+ const dm = decimals < 0 ? 0 : decimals;
+ const sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
+ const i = Math.floor(Math.log(bytes) / Math.log(k2));
+ return `${parseFloat((bytes / k2 ** i).toFixed(dm))} ${sizes[i]}`;
+}
+const rescanSiteRequest = ref(null);
+function rescanSite(done) {
+ const fetch2 = useFetch("/reports/rescan").post();
+ rescanSiteRequest.value = fetch2;
+ fetch2.onFetchResponse(() => {
+ done();
+ });
+}
+const isRescanSiteRequestRunning = computed(() => {
+ var _a2;
+ return (_a2 = rescanSiteRequest.value) == null ? void 0 : _a2.isFetching;
+});
+const _sfc_main$d = defineComponent({
+ __name: "ResultsRoute",
+ props: {
+ report: {}
+ },
+ setup(__props) {
+ return (_ctx, _cache) => {
+ var _a2;
+ const _component_results_cell = _sfc_main$w;
+ return openBlock(), createElementBlock("div", {
+ class: normalizeClass(["grid grid-cols-12 gap-4 text-sm dark:even:bg-teal-800/50 even:bg-teal-50/90 px-2", ((_a2 = _ctx.report) == null ? void 0 : _a2.report) ? ["py-1"] : ["py-3"]])
+ }, [
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(resultColumns), (col, i) => {
+ return openBlock(), createBlock(_component_results_cell, {
+ key: i,
+ column: col,
+ report: _ctx.report
+ }, {
+ default: withCtx(() => [
+ renderSlot(_ctx.$slots, col.slot, { report: _ctx.report })
+ ]),
+ _: 2
+ }, 1032, ["column", "report"]);
+ }), 128))
+ ], 2);
+ };
+ }
+});
+const _hoisted_1$p = { class: "grid grid-cols-12 gap-4 text-xs w-full" };
+const _hoisted_2$l = { class: "flex items-center justify-between col-span-4 lg:col-span-3 xl:col-span-2" };
+const _hoisted_3$j = { key: 0 };
+const _hoisted_4$5 = /* @__PURE__ */ createBaseVNode("span", { class: "whitespace-nowrap ml-2 opacity-90" }, "Sampled routes", -1);
+const _hoisted_5$3 = /* @__PURE__ */ createBaseVNode("code", null, "scanner.dynamicSampling", -1);
+const _hoisted_6$2 = { class: "items-center col-span-2 hidden lg:flex" };
+const _sfc_main$c = defineComponent({
+ __name: "ResultsRow",
+ props: {
+ routeName: {},
+ reports: {}
+ },
+ setup(__props) {
+ const props2 = __props;
+ const { reports } = toRefs(props2);
+ const reportsScore = computed(() => {
+ return Math.round(reports.value.map((c2) => {
+ var _a2;
+ return (_a2 = c2.report) == null ? void 0 : _a2.score;
+ }).reduce((s2, a2) => s2 + a2, 0) / reports.value.length * 100) / 100;
+ });
+ return (_ctx, _cache) => {
+ const _component_tooltip = _sfc_main$z;
+ const _component_metric_guage = _sfc_main$t;
+ const _component_results_route = _sfc_main$d;
+ const _component_disclosure_handle = __unplugin_components_3$1;
+ return openBlock(), createElementBlock("div", null, [
+ createVNode(_component_disclosure_handle, null, {
+ label: withCtx(() => [
+ createBaseVNode("div", _hoisted_1$p, [
+ createBaseVNode("div", _hoisted_2$l, [
+ createBaseVNode("span", null, toDisplayString(_ctx.routeName), 1),
+ unref(dynamicSampling) && unref(reports).length >= unref(dynamicSampling) ? (openBlock(), createElementBlock("span", _hoisted_3$j, [
+ createVNode(_component_tooltip, null, {
+ tooltip: withCtx(() => [
+ createBaseVNode("p", null, [
+ createTextVNode("The "),
+ _hoisted_5$3,
+ createTextVNode(" is enabled and set to " + toDisplayString(unref(dynamicSampling)) + ". Consider disabling sampling or increase the sampling amount if", 1)
+ ])
+ ]),
+ default: withCtx(() => [
+ _hoisted_4$5
+ ]),
+ _: 1
+ })
+ ])) : createCommentVNode("", true)
+ ]),
+ createBaseVNode("div", _hoisted_6$2, [
+ unref(reportsScore) ? (openBlock(), createBlock(_component_metric_guage, {
+ key: 0,
+ score: unref(reportsScore),
+ stripped: true
+ }, null, 8, ["score"])) : createCommentVNode("", true)
+ ])
+ ])
+ ]),
+ default: withCtx(() => [
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(reports), (report, index) => {
+ return openBlock(), createBlock(_component_results_route, {
+ key: index,
+ report
+ }, {
+ actions: withCtx(() => [
+ (report == null ? void 0 : report.report) ? renderSlot(_ctx.$slots, "actions", {
+ key: 0,
+ report
+ }) : createCommentVNode("", true)
+ ]),
+ _: 2
+ }, 1032, ["report"]);
+ }), 128))
+ ]),
+ _: 3
+ })
+ ]);
+ };
+ }
+});
+const _hoisted_1$o = {
+ viewBox: "0 0 24 24",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$k = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "M16 12a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2Z"
+}, null, -1);
+const _hoisted_3$i = [
+ _hoisted_2$k
+];
+function render$g(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$o, _hoisted_3$i);
+}
+var __unplugin_components_0$5 = { name: "mdi-dots-horizontal", render: render$g };
+const _hoisted_1$n = { class: "overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5" };
+const _hoisted_2$j = { class: "relative p-2 bg-teal-50/90 dark:bg-teal-900/99 dark:text-gray-100 text-gray-800" };
+const _sfc_main$b = defineComponent({
+ __name: "PopoverActions",
+ props: {
+ position: {}
+ },
+ setup(__props) {
+ return (_ctx, _cache) => {
+ const _component_i_mdi_dots_horizontal = __unplugin_components_0$5;
+ const _component_PopoverButton = Be;
+ const _component_PopoverPanel = He;
+ const _component_Popover = Pe;
+ return openBlock(), createBlock(_component_Popover, { class: "relative flex items-center justify-end" }, {
+ default: withCtx(({ open, close }) => [
+ createVNode(_component_PopoverButton, {
+ class: normalizeClass([open ? "bg-teal-100 ring-2" : "", "inline-flex items-center px-2 py-1 text-sm font-medium text-white rounded-md group bg-blue-50 dark:bg-teal-700/30 dark:hover:bg-teal-700/70 hover:text-opacity-100 hover:bg-blue-100 transition focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"]),
+ title: open ? "Close Actions" : "Open Actions"
+ }, {
+ default: withCtx(() => [
+ createVNode(_component_i_mdi_dots_horizontal, {
+ class: normalizeClass([open ? "rotate-270 scale-125" : "", "w-5 h-5 text-teal-800 dark:text-teal-300 transform transition duration-500 ease-in-out group-hover:text-opacity-80"]),
+ "aria-hidden": "true"
+ }, null, 8, ["class"])
+ ]),
+ _: 2
+ }, 1032, ["class", "title"]),
+ createVNode(Transition, {
+ "enter-active-class": "transition duration-200 ease-out",
+ "enter-from-class": "translate-y-1 opacity-0",
+ "enter-to-class": "translate-y-0 opacity-100",
+ "leave-active-class": "transition duration-150 ease-in",
+ "leave-from-class": "translate-y-0 opacity-100",
+ "leave-to-class": "translate-y-1 opacity-0"
+ }, {
+ default: withCtx(() => [
+ createVNode(_component_PopoverPanel, {
+ class: normalizeClass([_ctx.position !== "bottom" ? ["-translate-x-[110%]", "left-1/2"] : ["right-0", "top-2/3"], "absolute z-10 px-4 mt-3 transform sm:px-0"])
+ }, {
+ default: withCtx(() => [
+ createBaseVNode("div", _hoisted_1$n, [
+ createBaseVNode("div", _hoisted_2$j, [
+ renderSlot(_ctx.$slots, "default", {
+ open,
+ close
+ })
+ ])
+ ])
+ ]),
+ _: 2
+ }, 1032, ["class"])
+ ]),
+ _: 2
+ }, 1024)
+ ]),
+ _: 3
+ });
+ };
+ }
+});
+const _hoisted_1$m = {
+ viewBox: "0 0 24 24",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$i = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "M17 22v-2h3v-3h2v3.5c0 .39-.16.74-.46 1.04c-.3.3-.65.46-1.04.46H17M7 22H3.5c-.39 0-.74-.16-1.04-.46c-.3-.3-.46-.65-.46-1.04V17h2v3h3v2M17 2h3.5c.39 0 .74.16 1.04.46c.3.3.46.65.46 1.04V7h-2V4h-3V2M7 2v2H4v3H2V3.5c0-.39.16-.74.46-1.04c.3-.3.65-.46 1.04-.46H7m3.5 4C13 6 15 8 15 10.5c0 .88-.25 1.7-.69 2.4l3.26 3.26l-1.41 1.41l-3.26-3.26c-.7.44-1.52.69-2.4.69C8 15 6 13 6 10.5S8 6 10.5 6m0 2a2.5 2.5 0 0 0 0 5a2.5 2.5 0 0 0 0-5Z"
+}, null, -1);
+const _hoisted_3$h = [
+ _hoisted_2$i
+];
+function render$f(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$m, _hoisted_3$h);
+}
+var __unplugin_components_15 = { name: "mdi-magnify-scan", render: render$f };
+const _sfc_main$a = {};
+function _sfc_render$4(_ctx, _cache) {
+ return openBlock(), createElementBlock("button", mergeProps(_ctx.$attrs, {
+ type: "button",
+ class: "px-2 py-1 text-sm font-medium rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"
+ }), [
+ renderSlot(_ctx.$slots, "default")
+ ], 16);
+}
+var __unplugin_components_14 = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$4]]);
+const _hoisted_1$l = {
+ viewBox: "0 0 32 32",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$h = /* @__PURE__ */ createStaticVNode('', 28);
+const _hoisted_30$2 = [
+ _hoisted_2$h
+];
+function render$e(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$l, _hoisted_30$2);
+}
+var __unplugin_components_13 = { name: "vscode-icons-file-type-lighthouse", render: render$e };
+const _hoisted_1$k = {
+ viewBox: "0 0 16 16",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$g = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "M8 16c-2.137 0-4.146-.832-5.657-2.343S0 10.137 0 8c0-1.513.425-2.986 1.228-4.261A8.02 8.02 0 0 1 4.421.844l.672 1.341a6.53 6.53 0 0 0-2.596 2.354A6.48 6.48 0 0 0 1.5 8c0 3.584 2.916 6.5 6.5 6.5s6.5-2.916 6.5-6.5c0-1.23-.345-2.426-.997-3.461a6.515 6.515 0 0 0-2.596-2.354l.672-1.341a8.02 8.02 0 0 1 3.193 2.895A7.981 7.981 0 0 1 16 8c0 2.137-.832 4.146-2.343 5.657S10.137 16 8 16z"
+}, null, -1);
+const _hoisted_3$g = [
+ _hoisted_2$g
+];
+function render$d(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$k, _hoisted_3$g);
+}
+var __unplugin_components_0$4 = { name: "icomoon-free-spinner8", render: render$d };
+const _sfc_main$9 = {};
+function _sfc_render$3(_ctx, _cache) {
+ const _component_i_icomoon_free_spinner8 = __unplugin_components_0$4;
+ return openBlock(), createBlock(_component_i_icomoon_free_spinner8, { class: "animate-spin animated" });
+}
+var __unplugin_components_12$1 = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$3]]);
+const _hoisted_1$j = {
+ viewBox: "0 0 32 32",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$f = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "m16 4l7 7l-1.4 1.4L16 6.8l-5.6 5.6L9 11z"
+}, null, -1);
+const _hoisted_3$f = [
+ _hoisted_2$f
+];
+function render$c(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$j, _hoisted_3$f);
+}
+var __unplugin_components_5 = { name: "carbon-chevron-sort-up", render: render$c };
+const _hoisted_1$i = {
+ viewBox: "0 0 32 32",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$e = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "m16 28l-7-7l1.4-1.4l5.6 5.6l5.6-5.6L23 21z"
+}, null, -1);
+const _hoisted_3$e = [
+ _hoisted_2$e
+];
+function render$b(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$i, _hoisted_3$e);
+}
+var __unplugin_components_4 = { name: "carbon-chevron-sort-down", render: render$b };
+const _hoisted_1$h = {
+ viewBox: "0 0 32 32",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$d = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "m16 28l-7-7l1.41-1.41L16 25.17l5.59-5.58L23 21l-7 7zm0-24l7 7l-1.41 1.41L16 6.83l-5.59 5.58L9 11l7-7z"
+}, null, -1);
+const _hoisted_3$d = [
+ _hoisted_2$d
+];
+function render$a(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$h, _hoisted_3$d);
+}
+var __unplugin_components_3 = { name: "carbon-chevron-sort", render: render$a };
+const _hoisted_1$g = {
+ viewBox: "0 0 32 32",
+ width: "1.2em",
+ height: "1.2em"
+};
+const _hoisted_2$c = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "M16 23a1.5 1.5 0 1 0 1.5 1.5A1.5 1.5 0 0 0 16 23zm-1-11h2v9h-2z"
+}, null, -1);
+const _hoisted_3$c = /* @__PURE__ */ createBaseVNode("path", {
+ fill: "currentColor",
+ d: "M29 30H3a1 1 0 0 1-.887-1.461l13-25a1 1 0 0 1 1.774 0l13 25A1 1 0 0 1 29 30ZM4.65 28h22.7l.001-.003L16.002 6.17h-.004L4.648 27.997Z"
+}, null, -1);
+const _hoisted_4$4 = [
+ _hoisted_2$c,
+ _hoisted_3$c
+];
+function render$9(_ctx, _cache) {
+ return openBlock(), createElementBlock("svg", _hoisted_1$g, _hoisted_4$4);
+}
+var __unplugin_components_0$3 = { name: "carbon-warning-alt", render: render$9 };
+const _hoisted_1$f = { class: "flex items-center" };
+const _hoisted_2$b = { class: "whitespace-nowrap flex items-center" };
+const _hoisted_3$b = ["innerHTML"];
+const _hoisted_4$3 = { key: 1 };
+const _hoisted_5$2 = { class: "whitespace-nowrap" };
+const _sfc_main$8 = defineComponent({
+ __name: "ResultsTableHead",
+ props: {
+ sorting: {},
+ column: {}
+ },
+ emits: ["sort"],
+ setup(__props) {
+ return (_ctx, _cache) => {
+ const _component_i_carbon_warning_alt = __unplugin_components_0$3;
+ const _component_i_carbon_information = __unplugin_components_1$1;
+ const _component_tooltip = _sfc_main$z;
+ const _component_i_carbon_chevron_sort = __unplugin_components_3;
+ const _component_i_carbon_chevron_sort_down = __unplugin_components_4;
+ const _component_i_carbon_chevron_sort_up = __unplugin_components_5;
+ return openBlock(), createElementBlock("div", {
+ class: normalizeClass([[`col-span-${_ctx.column.cols || "2"}`, ..._ctx.column.classes ? _ctx.column.classes : []], "flex flex-col"])
+ }, [
+ createBaseVNode("div", _hoisted_1$f, [
+ _ctx.column.tooltip ? (openBlock(), createBlock(_component_tooltip, { key: 0 }, {
+ tooltip: withCtx(() => [
+ createBaseVNode("div", {
+ innerHTML: _ctx.column.tooltip
+ }, null, 8, _hoisted_3$b)
+ ]),
+ default: withCtx(() => {
+ var _a2;
+ return [
+ createBaseVNode("span", _hoisted_2$b, [
+ createTextVNode(toDisplayString(_ctx.column.label) + " ", 1),
+ ((_a2 = _ctx.column) == null ? void 0 : _a2.warning) ? (openBlock(), createBlock(_component_i_carbon_warning_alt, {
+ key: 0,
+ class: "text-yellow-500 ml-1 text-xs opacity-75"
+ })) : (openBlock(), createBlock(_component_i_carbon_information, {
+ key: 1,
+ class: "ml-1 text-xs opacity-75"
+ }))
+ ])
+ ];
+ }),
+ _: 1
+ })) : (openBlock(), createElementBlock("div", _hoisted_4$3, [
+ createBaseVNode("span", _hoisted_5$2, toDisplayString(_ctx.column.label), 1)
+ ])),
+ (_ctx.column.sortable || !!_ctx.column.sortKey) && _ctx.column.key ? (openBlock(), createElementBlock("button", {
+ key: 2,
+ class: normalizeClass(["ml-2 p-0.3 dark:border-none dark:bg-blue-900/20 border-2 border-blue-100 ring-blue-200 hover:ring-1 rounded-lg", _ctx.sorting.key === _ctx.column.key && _ctx.sorting.dir ? ["dark:bg-blue-900/70", "bg-blue-900", "text-blue-200"] : []]),
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("sort", _ctx.column.key))
+ }, [
+ _ctx.sorting.key !== _ctx.column.key || !_ctx.sorting.dir ? (openBlock(), createBlock(_component_i_carbon_chevron_sort, { key: 0 })) : _ctx.sorting.key === _ctx.column.key && _ctx.sorting.dir === "desc" ? (openBlock(), createBlock(_component_i_carbon_chevron_sort_down, { key: 1 })) : _ctx.sorting.key === _ctx.column.key && _ctx.sorting.dir === "asc" ? (openBlock(), createBlock(_component_i_carbon_chevron_sort_up, { key: 2 })) : createCommentVNode("", true)
+ ], 2)) : createCommentVNode("", true)
+ ]),
+ renderSlot(_ctx.$slots, _ctx.column.slot || _ctx.column.label)
+ ], 2);
+ };
+ }
+});
+/**
+ * @license
+ * Copyright 2010-2022 Three.js Authors
+ * SPDX-License-Identifier: MIT
+ */
+const REVISION = "138";
+const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
+const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
+const CullFaceNone = 0;
+const CullFaceBack = 1;
+const CullFaceFront = 2;
+const PCFShadowMap = 1;
+const PCFSoftShadowMap = 2;
+const VSMShadowMap = 3;
+const FrontSide = 0;
+const BackSide = 1;
+const DoubleSide = 2;
+const FlatShading = 1;
+const NoBlending = 0;
+const NormalBlending = 1;
+const AdditiveBlending = 2;
+const SubtractiveBlending = 3;
+const MultiplyBlending = 4;
+const CustomBlending = 5;
+const AddEquation = 100;
+const SubtractEquation = 101;
+const ReverseSubtractEquation = 102;
+const MinEquation = 103;
+const MaxEquation = 104;
+const ZeroFactor = 200;
+const OneFactor = 201;
+const SrcColorFactor = 202;
+const OneMinusSrcColorFactor = 203;
+const SrcAlphaFactor = 204;
+const OneMinusSrcAlphaFactor = 205;
+const DstAlphaFactor = 206;
+const OneMinusDstAlphaFactor = 207;
+const DstColorFactor = 208;
+const OneMinusDstColorFactor = 209;
+const SrcAlphaSaturateFactor = 210;
+const NeverDepth = 0;
+const AlwaysDepth = 1;
+const LessDepth = 2;
+const LessEqualDepth = 3;
+const EqualDepth = 4;
+const GreaterEqualDepth = 5;
+const GreaterDepth = 6;
+const NotEqualDepth = 7;
+const MultiplyOperation = 0;
+const MixOperation = 1;
+const AddOperation = 2;
+const NoToneMapping = 0;
+const LinearToneMapping = 1;
+const ReinhardToneMapping = 2;
+const CineonToneMapping = 3;
+const ACESFilmicToneMapping = 4;
+const CustomToneMapping = 5;
+const UVMapping = 300;
+const CubeReflectionMapping = 301;
+const CubeRefractionMapping = 302;
+const EquirectangularReflectionMapping = 303;
+const EquirectangularRefractionMapping = 304;
+const CubeUVReflectionMapping = 306;
+const CubeUVRefractionMapping = 307;
+const RepeatWrapping = 1e3;
+const ClampToEdgeWrapping = 1001;
+const MirroredRepeatWrapping = 1002;
+const NearestFilter = 1003;
+const NearestMipmapNearestFilter = 1004;
+const NearestMipmapLinearFilter = 1005;
+const LinearFilter = 1006;
+const LinearMipmapNearestFilter = 1007;
+const LinearMipmapLinearFilter = 1008;
+const UnsignedByteType = 1009;
+const ByteType = 1010;
+const ShortType = 1011;
+const UnsignedShortType = 1012;
+const IntType = 1013;
+const UnsignedIntType = 1014;
+const FloatType = 1015;
+const HalfFloatType = 1016;
+const UnsignedShort4444Type = 1017;
+const UnsignedShort5551Type = 1018;
+const UnsignedInt248Type = 1020;
+const AlphaFormat = 1021;
+const RGBFormat = 1022;
+const RGBAFormat = 1023;
+const LuminanceFormat = 1024;
+const LuminanceAlphaFormat = 1025;
+const DepthFormat = 1026;
+const DepthStencilFormat = 1027;
+const RedFormat = 1028;
+const RedIntegerFormat = 1029;
+const RGFormat = 1030;
+const RGIntegerFormat = 1031;
+const RGBAIntegerFormat = 1033;
+const RGB_S3TC_DXT1_Format = 33776;
+const RGBA_S3TC_DXT1_Format = 33777;
+const RGBA_S3TC_DXT3_Format = 33778;
+const RGBA_S3TC_DXT5_Format = 33779;
+const RGB_PVRTC_4BPPV1_Format = 35840;
+const RGB_PVRTC_2BPPV1_Format = 35841;
+const RGBA_PVRTC_4BPPV1_Format = 35842;
+const RGBA_PVRTC_2BPPV1_Format = 35843;
+const RGB_ETC1_Format = 36196;
+const RGB_ETC2_Format = 37492;
+const RGBA_ETC2_EAC_Format = 37496;
+const RGBA_ASTC_4x4_Format = 37808;
+const RGBA_ASTC_5x4_Format = 37809;
+const RGBA_ASTC_5x5_Format = 37810;
+const RGBA_ASTC_6x5_Format = 37811;
+const RGBA_ASTC_6x6_Format = 37812;
+const RGBA_ASTC_8x5_Format = 37813;
+const RGBA_ASTC_8x6_Format = 37814;
+const RGBA_ASTC_8x8_Format = 37815;
+const RGBA_ASTC_10x5_Format = 37816;
+const RGBA_ASTC_10x6_Format = 37817;
+const RGBA_ASTC_10x8_Format = 37818;
+const RGBA_ASTC_10x10_Format = 37819;
+const RGBA_ASTC_12x10_Format = 37820;
+const RGBA_ASTC_12x12_Format = 37821;
+const RGBA_BPTC_Format = 36492;
+const LoopOnce = 2200;
+const LoopRepeat = 2201;
+const LoopPingPong = 2202;
+const InterpolateDiscrete = 2300;
+const InterpolateLinear = 2301;
+const InterpolateSmooth = 2302;
+const ZeroCurvatureEnding = 2400;
+const ZeroSlopeEnding = 2401;
+const WrapAroundEnding = 2402;
+const NormalAnimationBlendMode = 2500;
+const AdditiveAnimationBlendMode = 2501;
+const TrianglesDrawMode = 0;
+const TriangleStripDrawMode = 1;
+const TriangleFanDrawMode = 2;
+const LinearEncoding = 3e3;
+const sRGBEncoding = 3001;
+const BasicDepthPacking = 3200;
+const RGBADepthPacking = 3201;
+const TangentSpaceNormalMap = 0;
+const ObjectSpaceNormalMap = 1;
+const KeepStencilOp = 7680;
+const AlwaysStencilFunc = 519;
+const StaticDrawUsage = 35044;
+const DynamicDrawUsage = 35048;
+const GLSL3 = "300 es";
+const _SRGBAFormat = 1035;
+class EventDispatcher {
+ addEventListener(type, listener) {
+ if (this._listeners === void 0)
+ this._listeners = {};
+ const listeners = this._listeners;
+ if (listeners[type] === void 0) {
+ listeners[type] = [];
+ }
+ if (listeners[type].indexOf(listener) === -1) {
+ listeners[type].push(listener);
+ }
+ }
+ hasEventListener(type, listener) {
+ if (this._listeners === void 0)
+ return false;
+ const listeners = this._listeners;
+ return listeners[type] !== void 0 && listeners[type].indexOf(listener) !== -1;
+ }
+ removeEventListener(type, listener) {
+ if (this._listeners === void 0)
+ return;
+ const listeners = this._listeners;
+ const listenerArray = listeners[type];
+ if (listenerArray !== void 0) {
+ const index = listenerArray.indexOf(listener);
+ if (index !== -1) {
+ listenerArray.splice(index, 1);
+ }
+ }
+ }
+ dispatchEvent(event) {
+ if (this._listeners === void 0)
+ return;
+ const listeners = this._listeners;
+ const listenerArray = listeners[event.type];
+ if (listenerArray !== void 0) {
+ event.target = this;
+ const array = listenerArray.slice(0);
+ for (let i = 0, l2 = array.length; i < l2; i++) {
+ array[i].call(this, event);
+ }
+ event.target = null;
+ }
+ }
+}
+const _lut = [];
+for (let i = 0; i < 256; i++) {
+ _lut[i] = (i < 16 ? "0" : "") + i.toString(16);
+}
+let _seed = 1234567;
+const DEG2RAD = Math.PI / 180;
+const RAD2DEG = 180 / Math.PI;
+function generateUUID() {
+ const d0 = Math.random() * 4294967295 | 0;
+ const d1 = Math.random() * 4294967295 | 0;
+ const d2 = Math.random() * 4294967295 | 0;
+ const d3 = Math.random() * 4294967295 | 0;
+ const uuid = _lut[d0 & 255] + _lut[d0 >> 8 & 255] + _lut[d0 >> 16 & 255] + _lut[d0 >> 24 & 255] + "-" + _lut[d1 & 255] + _lut[d1 >> 8 & 255] + "-" + _lut[d1 >> 16 & 15 | 64] + _lut[d1 >> 24 & 255] + "-" + _lut[d2 & 63 | 128] + _lut[d2 >> 8 & 255] + "-" + _lut[d2 >> 16 & 255] + _lut[d2 >> 24 & 255] + _lut[d3 & 255] + _lut[d3 >> 8 & 255] + _lut[d3 >> 16 & 255] + _lut[d3 >> 24 & 255];
+ return uuid.toUpperCase();
+}
+function clamp(value, min, max2) {
+ return Math.max(min, Math.min(max2, value));
+}
+function euclideanModulo(n2, m2) {
+ return (n2 % m2 + m2) % m2;
+}
+function mapLinear(x, a1, a2, b1, b22) {
+ return b1 + (x - a1) * (b22 - b1) / (a2 - a1);
+}
+function inverseLerp(x, y2, value) {
+ if (x !== y2) {
+ return (value - x) / (y2 - x);
+ } else {
+ return 0;
+ }
+}
+function lerp(x, y2, t2) {
+ return (1 - t2) * x + t2 * y2;
+}
+function damp(x, y2, lambda, dt) {
+ return lerp(x, y2, 1 - Math.exp(-lambda * dt));
+}
+function pingpong(x, length = 1) {
+ return length - Math.abs(euclideanModulo(x, length * 2) - length);
+}
+function smoothstep(x, min, max2) {
+ if (x <= min)
+ return 0;
+ if (x >= max2)
+ return 1;
+ x = (x - min) / (max2 - min);
+ return x * x * (3 - 2 * x);
+}
+function smootherstep(x, min, max2) {
+ if (x <= min)
+ return 0;
+ if (x >= max2)
+ return 1;
+ x = (x - min) / (max2 - min);
+ return x * x * x * (x * (x * 6 - 15) + 10);
+}
+function randInt(low, high) {
+ return low + Math.floor(Math.random() * (high - low + 1));
+}
+function randFloat(low, high) {
+ return low + Math.random() * (high - low);
+}
+function randFloatSpread(range) {
+ return range * (0.5 - Math.random());
+}
+function seededRandom(s2) {
+ if (s2 !== void 0)
+ _seed = s2 % 2147483647;
+ _seed = _seed * 16807 % 2147483647;
+ return (_seed - 1) / 2147483646;
+}
+function degToRad(degrees) {
+ return degrees * DEG2RAD;
+}
+function radToDeg(radians) {
+ return radians * RAD2DEG;
+}
+function isPowerOfTwo(value) {
+ return (value & value - 1) === 0 && value !== 0;
+}
+function ceilPowerOfTwo(value) {
+ return Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));
+}
+function floorPowerOfTwo(value) {
+ return Math.pow(2, Math.floor(Math.log(value) / Math.LN2));
+}
+function setQuaternionFromProperEuler(q, a2, b3, c2, order) {
+ const cos = Math.cos;
+ const sin = Math.sin;
+ const c22 = cos(b3 / 2);
+ const s2 = sin(b3 / 2);
+ const c13 = cos((a2 + c2) / 2);
+ const s13 = sin((a2 + c2) / 2);
+ const c1_3 = cos((a2 - c2) / 2);
+ const s1_3 = sin((a2 - c2) / 2);
+ const c3_1 = cos((c2 - a2) / 2);
+ const s3_1 = sin((c2 - a2) / 2);
+ switch (order) {
+ case "XYX":
+ q.set(c22 * s13, s2 * c1_3, s2 * s1_3, c22 * c13);
+ break;
+ case "YZY":
+ q.set(s2 * s1_3, c22 * s13, s2 * c1_3, c22 * c13);
+ break;
+ case "ZXZ":
+ q.set(s2 * c1_3, s2 * s1_3, c22 * s13, c22 * c13);
+ break;
+ case "XZX":
+ q.set(c22 * s13, s2 * s3_1, s2 * c3_1, c22 * c13);
+ break;
+ case "YXY":
+ q.set(s2 * c3_1, c22 * s13, s2 * s3_1, c22 * c13);
+ break;
+ case "ZYZ":
+ q.set(s2 * s3_1, s2 * c3_1, c22 * s13, c22 * c13);
+ break;
+ default:
+ console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + order);
+ }
+}
+var MathUtils = /* @__PURE__ */ Object.freeze({
+ __proto__: null,
+ DEG2RAD,
+ RAD2DEG,
+ generateUUID,
+ clamp,
+ euclideanModulo,
+ mapLinear,
+ inverseLerp,
+ lerp,
+ damp,
+ pingpong,
+ smoothstep,
+ smootherstep,
+ randInt,
+ randFloat,
+ randFloatSpread,
+ seededRandom,
+ degToRad,
+ radToDeg,
+ isPowerOfTwo,
+ ceilPowerOfTwo,
+ floorPowerOfTwo,
+ setQuaternionFromProperEuler
+});
+class Vector2 {
+ constructor(x = 0, y2 = 0) {
+ this.x = x;
+ this.y = y2;
+ }
+ get width() {
+ return this.x;
+ }
+ set width(value) {
+ this.x = value;
+ }
+ get height() {
+ return this.y;
+ }
+ set height(value) {
+ this.y = value;
+ }
+ set(x, y2) {
+ this.x = x;
+ this.y = y2;
+ return this;
+ }
+ setScalar(scalar) {
+ this.x = scalar;
+ this.y = scalar;
+ return this;
+ }
+ setX(x) {
+ this.x = x;
+ return this;
+ }
+ setY(y2) {
+ this.y = y2;
+ return this;
+ }
+ setComponent(index, value) {
+ switch (index) {
+ case 0:
+ this.x = value;
+ break;
+ case 1:
+ this.y = value;
+ break;
+ default:
+ throw new Error("index is out of range: " + index);
+ }
+ return this;
+ }
+ getComponent(index) {
+ switch (index) {
+ case 0:
+ return this.x;
+ case 1:
+ return this.y;
+ default:
+ throw new Error("index is out of range: " + index);
+ }
+ }
+ clone() {
+ return new this.constructor(this.x, this.y);
+ }
+ copy(v2) {
+ this.x = v2.x;
+ this.y = v2.y;
+ return this;
+ }
+ add(v2, w2) {
+ if (w2 !== void 0) {
+ console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");
+ return this.addVectors(v2, w2);
+ }
+ this.x += v2.x;
+ this.y += v2.y;
+ return this;
+ }
+ addScalar(s2) {
+ this.x += s2;
+ this.y += s2;
+ return this;
+ }
+ addVectors(a2, b3) {
+ this.x = a2.x + b3.x;
+ this.y = a2.y + b3.y;
+ return this;
+ }
+ addScaledVector(v2, s2) {
+ this.x += v2.x * s2;
+ this.y += v2.y * s2;
+ return this;
+ }
+ sub(v2, w2) {
+ if (w2 !== void 0) {
+ console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");
+ return this.subVectors(v2, w2);
+ }
+ this.x -= v2.x;
+ this.y -= v2.y;
+ return this;
+ }
+ subScalar(s2) {
+ this.x -= s2;
+ this.y -= s2;
+ return this;
+ }
+ subVectors(a2, b3) {
+ this.x = a2.x - b3.x;
+ this.y = a2.y - b3.y;
+ return this;
+ }
+ multiply(v2) {
+ this.x *= v2.x;
+ this.y *= v2.y;
+ return this;
+ }
+ multiplyScalar(scalar) {
+ this.x *= scalar;
+ this.y *= scalar;
+ return this;
+ }
+ divide(v2) {
+ this.x /= v2.x;
+ this.y /= v2.y;
+ return this;
+ }
+ divideScalar(scalar) {
+ return this.multiplyScalar(1 / scalar);
+ }
+ applyMatrix3(m2) {
+ const x = this.x, y2 = this.y;
+ const e2 = m2.elements;
+ this.x = e2[0] * x + e2[3] * y2 + e2[6];
+ this.y = e2[1] * x + e2[4] * y2 + e2[7];
+ return this;
+ }
+ min(v2) {
+ this.x = Math.min(this.x, v2.x);
+ this.y = Math.min(this.y, v2.y);
+ return this;
+ }
+ max(v2) {
+ this.x = Math.max(this.x, v2.x);
+ this.y = Math.max(this.y, v2.y);
+ return this;
+ }
+ clamp(min, max2) {
+ this.x = Math.max(min.x, Math.min(max2.x, this.x));
+ this.y = Math.max(min.y, Math.min(max2.y, this.y));
+ return this;
+ }
+ clampScalar(minVal, maxVal) {
+ this.x = Math.max(minVal, Math.min(maxVal, this.x));
+ this.y = Math.max(minVal, Math.min(maxVal, this.y));
+ return this;
+ }
+ clampLength(min, max2) {
+ const length = this.length();
+ return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max2, length)));
+ }
+ floor() {
+ this.x = Math.floor(this.x);
+ this.y = Math.floor(this.y);
+ return this;
+ }
+ ceil() {
+ this.x = Math.ceil(this.x);
+ this.y = Math.ceil(this.y);
+ return this;
+ }
+ round() {
+ this.x = Math.round(this.x);
+ this.y = Math.round(this.y);
+ return this;
+ }
+ roundToZero() {
+ this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);
+ this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);
+ return this;
+ }
+ negate() {
+ this.x = -this.x;
+ this.y = -this.y;
+ return this;
+ }
+ dot(v2) {
+ return this.x * v2.x + this.y * v2.y;
+ }
+ cross(v2) {
+ return this.x * v2.y - this.y * v2.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() {
+ const angle = Math.atan2(-this.y, -this.x) + Math.PI;
+ return angle;
+ }
+ distanceTo(v2) {
+ return Math.sqrt(this.distanceToSquared(v2));
+ }
+ distanceToSquared(v2) {
+ const dx = this.x - v2.x, dy = this.y - v2.y;
+ return dx * dx + dy * dy;
+ }
+ manhattanDistanceTo(v2) {
+ return Math.abs(this.x - v2.x) + Math.abs(this.y - v2.y);
+ }
+ setLength(length) {
+ return this.normalize().multiplyScalar(length);
+ }
+ lerp(v2, alpha) {
+ this.x += (v2.x - this.x) * alpha;
+ this.y += (v2.y - this.y) * alpha;
+ return this;
+ }
+ lerpVectors(v1, v2, alpha) {
+ this.x = v1.x + (v2.x - v1.x) * alpha;
+ this.y = v1.y + (v2.y - v1.y) * alpha;
+ return this;
+ }
+ equals(v2) {
+ return v2.x === this.x && v2.y === this.y;
+ }
+ fromArray(array, offset = 0) {
+ this.x = array[offset];
+ this.y = array[offset + 1];
+ return this;
+ }
+ toArray(array = [], offset = 0) {
+ array[offset] = this.x;
+ array[offset + 1] = this.y;
+ return array;
+ }
+ fromBufferAttribute(attribute, index, offset) {
+ if (offset !== void 0) {
+ console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute().");
+ }
+ this.x = attribute.getX(index);
+ this.y = attribute.getY(index);
+ return this;
+ }
+ rotateAround(center, angle) {
+ const c2 = Math.cos(angle), s2 = Math.sin(angle);
+ const x = this.x - center.x;
+ const y2 = this.y - center.y;
+ this.x = x * c2 - y2 * s2 + center.x;
+ this.y = x * s2 + y2 * c2 + center.y;
+ return this;
+ }
+ random() {
+ this.x = Math.random();
+ this.y = Math.random();
+ return this;
+ }
+ *[Symbol.iterator]() {
+ yield this.x;
+ yield this.y;
+ }
+}
+Vector2.prototype.isVector2 = true;
+class Matrix3 {
+ constructor() {
+ this.elements = [
+ 1,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 1
+ ];
+ if (arguments.length > 0) {
+ console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.");
+ }
+ }
+ set(n11, n12, n13, n21, n22, n23, n31, n32, n33) {
+ const te2 = this.elements;
+ te2[0] = n11;
+ te2[1] = n21;
+ te2[2] = n31;
+ te2[3] = n12;
+ te2[4] = n22;
+ te2[5] = n32;
+ te2[6] = n13;
+ te2[7] = n23;
+ te2[8] = n33;
+ return this;
+ }
+ identity() {
+ this.set(1, 0, 0, 0, 1, 0, 0, 0, 1);
+ return this;
+ }
+ copy(m2) {
+ const te2 = this.elements;
+ const me2 = m2.elements;
+ te2[0] = me2[0];
+ te2[1] = me2[1];
+ te2[2] = me2[2];
+ te2[3] = me2[3];
+ te2[4] = me2[4];
+ te2[5] = me2[5];
+ te2[6] = me2[6];
+ te2[7] = me2[7];
+ te2[8] = me2[8];
+ return this;
+ }
+ extractBasis(xAxis, yAxis, zAxis) {
+ xAxis.setFromMatrix3Column(this, 0);
+ yAxis.setFromMatrix3Column(this, 1);
+ zAxis.setFromMatrix3Column(this, 2);
+ return this;
+ }
+ setFromMatrix4(m2) {
+ const me2 = m2.elements;
+ this.set(me2[0], me2[4], me2[8], me2[1], me2[5], me2[9], me2[2], me2[6], me2[10]);
+ return this;
+ }
+ multiply(m2) {
+ return this.multiplyMatrices(this, m2);
+ }
+ premultiply(m2) {
+ return this.multiplyMatrices(m2, this);
+ }
+ multiplyMatrices(a2, b3) {
+ const ae = a2.elements;
+ const be = b3.elements;
+ const te2 = this.elements;
+ const a11 = ae[0], a12 = ae[3], a13 = ae[6];
+ const a21 = ae[1], a22 = ae[4], a23 = ae[7];
+ const a31 = ae[2], a32 = ae[5], a33 = ae[8];
+ const b11 = be[0], b12 = be[3], b13 = be[6];
+ const b21 = be[1], b22 = be[4], b23 = be[7];
+ const b31 = be[2], b32 = be[5], b33 = be[8];
+ te2[0] = a11 * b11 + a12 * b21 + a13 * b31;
+ te2[3] = a11 * b12 + a12 * b22 + a13 * b32;
+ te2[6] = a11 * b13 + a12 * b23 + a13 * b33;
+ te2[1] = a21 * b11 + a22 * b21 + a23 * b31;
+ te2[4] = a21 * b12 + a22 * b22 + a23 * b32;
+ te2[7] = a21 * b13 + a22 * b23 + a23 * b33;
+ te2[2] = a31 * b11 + a32 * b21 + a33 * b31;
+ te2[5] = a31 * b12 + a32 * b22 + a33 * b32;
+ te2[8] = a31 * b13 + a32 * b23 + a33 * b33;
+ return this;
+ }
+ multiplyScalar(s2) {
+ const te2 = this.elements;
+ te2[0] *= s2;
+ te2[3] *= s2;
+ te2[6] *= s2;
+ te2[1] *= s2;
+ te2[4] *= s2;
+ te2[7] *= s2;
+ te2[2] *= s2;
+ te2[5] *= s2;
+ te2[8] *= s2;
+ return this;
+ }
+ determinant() {
+ const te2 = this.elements;
+ const a2 = te2[0], b3 = te2[1], c2 = te2[2], d2 = te2[3], e2 = te2[4], f2 = te2[5], g2 = te2[6], h2 = te2[7], i = te2[8];
+ return a2 * e2 * i - a2 * f2 * h2 - b3 * d2 * i + b3 * f2 * g2 + c2 * d2 * h2 - c2 * e2 * g2;
+ }
+ invert() {
+ const te2 = this.elements, n11 = te2[0], n21 = te2[1], n31 = te2[2], n12 = te2[3], n22 = te2[4], n32 = te2[5], n13 = te2[6], n23 = te2[7], n33 = te2[8], t11 = n33 * n22 - n32 * n23, t12 = n32 * n13 - n33 * n12, t13 = n23 * n12 - n22 * n13, det = n11 * t11 + n21 * t12 + n31 * t13;
+ if (det === 0)
+ return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
+ const detInv = 1 / det;
+ te2[0] = t11 * detInv;
+ te2[1] = (n31 * n23 - n33 * n21) * detInv;
+ te2[2] = (n32 * n21 - n31 * n22) * detInv;
+ te2[3] = t12 * detInv;
+ te2[4] = (n33 * n11 - n31 * n13) * detInv;
+ te2[5] = (n31 * n12 - n32 * n11) * detInv;
+ te2[6] = t13 * detInv;
+ te2[7] = (n21 * n13 - n23 * n11) * detInv;
+ te2[8] = (n22 * n11 - n21 * n12) * detInv;
+ return this;
+ }
+ transpose() {
+ let tmp2;
+ const m2 = this.elements;
+ tmp2 = m2[1];
+ m2[1] = m2[3];
+ m2[3] = tmp2;
+ tmp2 = m2[2];
+ m2[2] = m2[6];
+ m2[6] = tmp2;
+ tmp2 = m2[5];
+ m2[5] = m2[7];
+ m2[7] = tmp2;
+ return this;
+ }
+ getNormalMatrix(matrix4) {
+ return this.setFromMatrix4(matrix4).invert().transpose();
+ }
+ transposeIntoArray(r2) {
+ const m2 = this.elements;
+ r2[0] = m2[0];
+ r2[1] = m2[3];
+ r2[2] = m2[6];
+ r2[3] = m2[1];
+ r2[4] = m2[4];
+ r2[5] = m2[7];
+ r2[6] = m2[2];
+ r2[7] = m2[5];
+ r2[8] = m2[8];
+ return this;
+ }
+ setUvTransform(tx, ty, sx, sy, rotation, cx, cy) {
+ const c2 = Math.cos(rotation);
+ const s2 = Math.sin(rotation);
+ this.set(sx * c2, sx * s2, -sx * (c2 * cx + s2 * cy) + cx + tx, -sy * s2, sy * c2, -sy * (-s2 * cx + c2 * cy) + cy + ty, 0, 0, 1);
+ return this;
+ }
+ scale(sx, sy) {
+ const te2 = this.elements;
+ te2[0] *= sx;
+ te2[3] *= sx;
+ te2[6] *= sx;
+ te2[1] *= sy;
+ te2[4] *= sy;
+ te2[7] *= sy;
+ return this;
+ }
+ rotate(theta) {
+ const c2 = Math.cos(theta);
+ const s2 = Math.sin(theta);
+ const te2 = this.elements;
+ const a11 = te2[0], a12 = te2[3], a13 = te2[6];
+ const a21 = te2[1], a22 = te2[4], a23 = te2[7];
+ te2[0] = c2 * a11 + s2 * a21;
+ te2[3] = c2 * a12 + s2 * a22;
+ te2[6] = c2 * a13 + s2 * a23;
+ te2[1] = -s2 * a11 + c2 * a21;
+ te2[4] = -s2 * a12 + c2 * a22;
+ te2[7] = -s2 * a13 + c2 * a23;
+ return this;
+ }
+ translate(tx, ty) {
+ const te2 = this.elements;
+ te2[0] += tx * te2[2];
+ te2[3] += tx * te2[5];
+ te2[6] += tx * te2[8];
+ te2[1] += ty * te2[2];
+ te2[4] += ty * te2[5];
+ te2[7] += ty * te2[8];
+ return this;
+ }
+ equals(matrix) {
+ const te2 = this.elements;
+ const me2 = matrix.elements;
+ for (let i = 0; i < 9; i++) {
+ if (te2[i] !== me2[i])
+ return false;
+ }
+ return true;
+ }
+ fromArray(array, offset = 0) {
+ for (let i = 0; i < 9; i++) {
+ this.elements[i] = array[i + offset];
+ }
+ return this;
+ }
+ toArray(array = [], offset = 0) {
+ const te2 = this.elements;
+ array[offset] = te2[0];
+ array[offset + 1] = te2[1];
+ array[offset + 2] = te2[2];
+ array[offset + 3] = te2[3];
+ array[offset + 4] = te2[4];
+ array[offset + 5] = te2[5];
+ array[offset + 6] = te2[6];
+ array[offset + 7] = te2[7];
+ array[offset + 8] = te2[8];
+ return array;
+ }
+ clone() {
+ return new this.constructor().fromArray(this.elements);
+ }
+}
+Matrix3.prototype.isMatrix3 = true;
+function arrayNeedsUint32(array) {
+ for (let i = array.length - 1; i >= 0; --i) {
+ if (array[i] > 65535)
+ return true;
+ }
+ return false;
+}
+function createElementNS(name) {
+ return document.createElementNS("http://www.w3.org/1999/xhtml", name);
+}
+const _colorKeywords = {
+ "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
+};
+const _hslA = { h: 0, s: 0, l: 0 };
+const _hslB = { h: 0, s: 0, l: 0 };
+function hue2rgb(p2, q, t2) {
+ if (t2 < 0)
+ t2 += 1;
+ if (t2 > 1)
+ t2 -= 1;
+ if (t2 < 1 / 6)
+ return p2 + (q - p2) * 6 * t2;
+ if (t2 < 1 / 2)
+ return q;
+ if (t2 < 2 / 3)
+ return p2 + (q - p2) * 6 * (2 / 3 - t2);
+ return p2;
+}
+function SRGBToLinear(c2) {
+ return c2 < 0.04045 ? c2 * 0.0773993808 : Math.pow(c2 * 0.9478672986 + 0.0521327014, 2.4);
+}
+function LinearToSRGB(c2) {
+ return c2 < 31308e-7 ? c2 * 12.92 : 1.055 * Math.pow(c2, 0.41666) - 0.055;
+}
+class Color {
+ constructor(r2, g2, b3) {
+ if (g2 === void 0 && b3 === void 0) {
+ return this.set(r2);
+ }
+ return this.setRGB(r2, g2, b3);
+ }
+ set(value) {
+ if (value && value.isColor) {
+ this.copy(value);
+ } else if (typeof value === "number") {
+ this.setHex(value);
+ } else if (typeof value === "string") {
+ this.setStyle(value);
+ }
+ return this;
+ }
+ setScalar(scalar) {
+ this.r = scalar;
+ this.g = scalar;
+ this.b = scalar;
+ return this;
+ }
+ setHex(hex) {
+ hex = Math.floor(hex);
+ this.r = (hex >> 16 & 255) / 255;
+ this.g = (hex >> 8 & 255) / 255;
+ this.b = (hex & 255) / 255;
+ return this;
+ }
+ setRGB(r2, g2, b3) {
+ this.r = r2;
+ this.g = g2;
+ this.b = b3;
+ return this;
+ }
+ setHSL(h2, s2, l2) {
+ h2 = euclideanModulo(h2, 1);
+ s2 = clamp(s2, 0, 1);
+ l2 = clamp(l2, 0, 1);
+ if (s2 === 0) {
+ this.r = this.g = this.b = l2;
+ } else {
+ const p2 = l2 <= 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2;
+ const q = 2 * l2 - p2;
+ this.r = hue2rgb(q, p2, h2 + 1 / 3);
+ this.g = hue2rgb(q, p2, h2);
+ this.b = hue2rgb(q, p2, h2 - 1 / 3);
+ }
+ return this;
+ }
+ setStyle(style) {
+ function handleAlpha(string) {
+ if (string === void 0)
+ return;
+ if (parseFloat(string) < 1) {
+ console.warn("THREE.Color: Alpha component of " + style + " will be ignored.");
+ }
+ }
+ let m2;
+ if (m2 = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(style)) {
+ let color;
+ const name = m2[1];
+ const components = m2[2];
+ switch (name) {
+ case "rgb":
+ case "rgba":
+ if (color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
+ this.r = Math.min(255, parseInt(color[1], 10)) / 255;
+ this.g = Math.min(255, parseInt(color[2], 10)) / 255;
+ this.b = Math.min(255, parseInt(color[3], 10)) / 255;
+ handleAlpha(color[4]);
+ return this;
+ }
+ if (color = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
+ this.r = Math.min(100, parseInt(color[1], 10)) / 100;
+ this.g = Math.min(100, parseInt(color[2], 10)) / 100;
+ this.b = Math.min(100, parseInt(color[3], 10)) / 100;
+ handleAlpha(color[4]);
+ return this;
+ }
+ break;
+ case "hsl":
+ case "hsla":
+ if (color = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
+ const h2 = parseFloat(color[1]) / 360;
+ const s2 = parseInt(color[2], 10) / 100;
+ const l2 = parseInt(color[3], 10) / 100;
+ handleAlpha(color[4]);
+ return this.setHSL(h2, s2, l2);
+ }
+ break;
+ }
+ } else if (m2 = /^\#([A-Fa-f\d]+)$/.exec(style)) {
+ const hex = m2[1];
+ const size2 = hex.length;
+ if (size2 === 3) {
+ this.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;
+ this.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;
+ this.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;
+ return this;
+ } else if (size2 === 6) {
+ this.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;
+ this.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;
+ this.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;
+ return this;
+ }
+ }
+ if (style && style.length > 0) {
+ return this.setColorName(style);
+ }
+ return this;
+ }
+ setColorName(style) {
+ const hex = _colorKeywords[style.toLowerCase()];
+ if (hex !== void 0) {
+ this.setHex(hex);
+ } else {
+ console.warn("THREE.Color: Unknown color " + style);
+ }
+ return this;
+ }
+ clone() {
+ return new this.constructor(this.r, this.g, this.b);
+ }
+ copy(color) {
+ this.r = color.r;
+ this.g = color.g;
+ this.b = color.b;
+ return this;
+ }
+ copySRGBToLinear(color) {
+ this.r = SRGBToLinear(color.r);
+ this.g = SRGBToLinear(color.g);
+ this.b = SRGBToLinear(color.b);
+ return this;
+ }
+ copyLinearToSRGB(color) {
+ this.r = LinearToSRGB(color.r);
+ this.g = LinearToSRGB(color.g);
+ this.b = LinearToSRGB(color.b);
+ return this;
+ }
+ convertSRGBToLinear() {
+ this.copySRGBToLinear(this);
+ return this;
+ }
+ convertLinearToSRGB() {
+ this.copyLinearToSRGB(this);
+ return this;
+ }
+ getHex() {
+ return this.r * 255 << 16 ^ this.g * 255 << 8 ^ this.b * 255 << 0;
+ }
+ getHexString() {
+ return ("000000" + this.getHex().toString(16)).slice(-6);
+ }
+ getHSL(target) {
+ const r2 = this.r, g2 = this.g, b3 = this.b;
+ const max2 = Math.max(r2, g2, b3);
+ const min = Math.min(r2, g2, b3);
+ let hue, saturation;
+ const lightness = (min + max2) / 2;
+ if (min === max2) {
+ hue = 0;
+ saturation = 0;
+ } else {
+ const delta = max2 - min;
+ saturation = lightness <= 0.5 ? delta / (max2 + min) : delta / (2 - max2 - min);
+ switch (max2) {
+ case r2:
+ hue = (g2 - b3) / delta + (g2 < b3 ? 6 : 0);
+ break;
+ case g2:
+ hue = (b3 - r2) / delta + 2;
+ break;
+ case b3:
+ hue = (r2 - g2) / delta + 4;
+ break;
+ }
+ hue /= 6;
+ }
+ target.h = hue;
+ target.s = saturation;
+ target.l = lightness;
+ return target;
+ }
+ getStyle() {
+ return "rgb(" + (this.r * 255 | 0) + "," + (this.g * 255 | 0) + "," + (this.b * 255 | 0) + ")";
+ }
+ offsetHSL(h2, s2, l2) {
+ this.getHSL(_hslA);
+ _hslA.h += h2;
+ _hslA.s += s2;
+ _hslA.l += l2;
+ this.setHSL(_hslA.h, _hslA.s, _hslA.l);
+ return this;
+ }
+ add(color) {
+ this.r += color.r;
+ this.g += color.g;
+ this.b += color.b;
+ return this;
+ }
+ addColors(color1, color2) {
+ this.r = color1.r + color2.r;
+ this.g = color1.g + color2.g;
+ this.b = color1.b + color2.b;
+ return this;
+ }
+ addScalar(s2) {
+ this.r += s2;
+ this.g += s2;
+ this.b += s2;
+ return this;
+ }
+ sub(color) {
+ this.r = Math.max(0, this.r - color.r);
+ this.g = Math.max(0, this.g - color.g);
+ this.b = Math.max(0, this.b - color.b);
+ return this;
+ }
+ multiply(color) {
+ this.r *= color.r;
+ this.g *= color.g;
+ this.b *= color.b;
+ return this;
+ }
+ multiplyScalar(s2) {
+ this.r *= s2;
+ this.g *= s2;
+ this.b *= s2;
+ return this;
+ }
+ lerp(color, alpha) {
+ this.r += (color.r - this.r) * alpha;
+ this.g += (color.g - this.g) * alpha;
+ this.b += (color.b - this.b) * alpha;
+ return this;
+ }
+ lerpColors(color1, color2, alpha) {
+ this.r = color1.r + (color2.r - color1.r) * alpha;
+ this.g = color1.g + (color2.g - color1.g) * alpha;
+ this.b = color1.b + (color2.b - color1.b) * alpha;
+ return this;
+ }
+ lerpHSL(color, alpha) {
+ this.getHSL(_hslA);
+ color.getHSL(_hslB);
+ const h2 = lerp(_hslA.h, _hslB.h, alpha);
+ const s2 = lerp(_hslA.s, _hslB.s, alpha);
+ const l2 = lerp(_hslA.l, _hslB.l, alpha);
+ this.setHSL(h2, s2, l2);
+ return this;
+ }
+ equals(c2) {
+ return c2.r === this.r && c2.g === this.g && c2.b === this.b;
+ }
+ fromArray(array, offset = 0) {
+ this.r = array[offset];
+ this.g = array[offset + 1];
+ this.b = array[offset + 2];
+ return this;
+ }
+ toArray(array = [], offset = 0) {
+ array[offset] = this.r;
+ array[offset + 1] = this.g;
+ array[offset + 2] = this.b;
+ return array;
+ }
+ fromBufferAttribute(attribute, index) {
+ this.r = attribute.getX(index);
+ this.g = attribute.getY(index);
+ this.b = attribute.getZ(index);
+ if (attribute.normalized === true) {
+ this.r /= 255;
+ this.g /= 255;
+ this.b /= 255;
+ }
+ return this;
+ }
+ toJSON() {
+ return this.getHex();
+ }
+}
+Color.NAMES = _colorKeywords;
+Color.prototype.isColor = true;
+Color.prototype.r = 1;
+Color.prototype.g = 1;
+Color.prototype.b = 1;
+let _canvas;
+class ImageUtils {
+ static getDataURL(image) {
+ if (/^data:/i.test(image.src)) {
+ return image.src;
+ }
+ if (typeof HTMLCanvasElement == "undefined") {
+ return image.src;
+ }
+ let canvas;
+ if (image instanceof HTMLCanvasElement) {
+ canvas = image;
+ } else {
+ if (_canvas === void 0)
+ _canvas = createElementNS("canvas");
+ _canvas.width = image.width;
+ _canvas.height = image.height;
+ const context = _canvas.getContext("2d");
+ if (image instanceof ImageData) {
+ context.putImageData(image, 0, 0);
+ } else {
+ context.drawImage(image, 0, 0, image.width, image.height);
+ }
+ canvas = _canvas;
+ }
+ if (canvas.width > 2048 || canvas.height > 2048) {
+ console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", image);
+ return canvas.toDataURL("image/jpeg", 0.6);
+ } else {
+ return canvas.toDataURL("image/png");
+ }
+ }
+ static sRGBToLinear(image) {
+ if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) {
+ const canvas = createElementNS("canvas");
+ canvas.width = image.width;
+ canvas.height = image.height;
+ const context = canvas.getContext("2d");
+ context.drawImage(image, 0, 0, image.width, image.height);
+ const imageData = context.getImageData(0, 0, image.width, image.height);
+ const data = imageData.data;
+ for (let i = 0; i < data.length; i++) {
+ data[i] = SRGBToLinear(data[i] / 255) * 255;
+ }
+ context.putImageData(imageData, 0, 0);
+ return canvas;
+ } else if (image.data) {
+ const data = image.data.slice(0);
+ for (let i = 0; i < data.length; i++) {
+ if (data instanceof Uint8Array || data instanceof Uint8ClampedArray) {
+ data[i] = Math.floor(SRGBToLinear(data[i] / 255) * 255);
+ } else {
+ data[i] = SRGBToLinear(data[i]);
+ }
+ }
+ return {
+ data,
+ width: image.width,
+ height: image.height
+ };
+ } else {
+ console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.");
+ return image;
+ }
+ }
+}
+class Source {
+ constructor(data = null) {
+ this.uuid = generateUUID();
+ this.data = data;
+ this.version = 0;
+ }
+ set needsUpdate(value) {
+ if (value === true)
+ this.version++;
+ }
+ toJSON(meta) {
+ const isRootObject = meta === void 0 || typeof meta === "string";
+ if (!isRootObject && meta.images[this.uuid] !== void 0) {
+ return meta.images[this.uuid];
+ }
+ const output = {
+ uuid: this.uuid,
+ url: ""
+ };
+ const data = this.data;
+ if (data !== null) {
+ let url;
+ if (Array.isArray(data)) {
+ url = [];
+ for (let i = 0, l2 = data.length; i < l2; i++) {
+ if (data[i].isDataTexture) {
+ url.push(serializeImage(data[i].image));
+ } else {
+ url.push(serializeImage(data[i]));
+ }
+ }
+ } else {
+ url = serializeImage(data);
+ }
+ output.url = url;
+ }
+ if (!isRootObject) {
+ meta.images[this.uuid] = output;
+ }
+ return output;
+ }
+}
+function serializeImage(image) {
+ if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) {
+ return ImageUtils.getDataURL(image);
+ } else {
+ if (image.data) {
+ return {
+ data: Array.prototype.slice.call(image.data),
+ width: image.width,
+ height: image.height,
+ type: image.data.constructor.name
+ };
+ } else {
+ console.warn("THREE.Texture: Unable to serialize Texture.");
+ return {};
+ }
+ }
+}
+Source.prototype.isSource = true;
+let textureId = 0;
+class Texture$1 extends EventDispatcher {
+ constructor(image = Texture$1.DEFAULT_IMAGE, mapping = Texture$1.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format2 = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding) {
+ super();
+ Object.defineProperty(this, "id", { value: textureId++ });
+ this.uuid = generateUUID();
+ this.name = "";
+ this.source = new Source(image);
+ this.mipmaps = [];
+ this.mapping = mapping;
+ this.wrapS = wrapS;
+ this.wrapT = wrapT;
+ this.magFilter = magFilter;
+ this.minFilter = minFilter;
+ this.anisotropy = anisotropy;
+ this.format = format2;
+ this.internalFormat = null;
+ this.type = type;
+ this.offset = new Vector2(0, 0);
+ this.repeat = new Vector2(1, 1);
+ this.center = new Vector2(0, 0);
+ this.rotation = 0;
+ this.matrixAutoUpdate = true;
+ this.matrix = new Matrix3();
+ this.generateMipmaps = true;
+ this.premultiplyAlpha = false;
+ this.flipY = true;
+ this.unpackAlignment = 4;
+ this.encoding = encoding;
+ this.userData = {};
+ this.version = 0;
+ this.onUpdate = null;
+ this.isRenderTargetTexture = false;
+ this.needsPMREMUpdate = false;
+ }
+ get image() {
+ return this.source.data;
+ }
+ set image(value) {
+ this.source.data = value;
+ }
+ updateMatrix() {
+ this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y);
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+ copy(source) {
+ this.name = source.name;
+ this.source = source.source;
+ this.mipmaps = source.mipmaps.slice(0);
+ this.mapping = source.mapping;
+ this.wrapS = source.wrapS;
+ this.wrapT = source.wrapT;
+ this.magFilter = source.magFilter;
+ this.minFilter = source.minFilter;
+ this.anisotropy = source.anisotropy;
+ this.format = source.format;
+ this.internalFormat = source.internalFormat;
+ this.type = source.type;
+ this.offset.copy(source.offset);
+ this.repeat.copy(source.repeat);
+ this.center.copy(source.center);
+ this.rotation = source.rotation;
+ this.matrixAutoUpdate = source.matrixAutoUpdate;
+ this.matrix.copy(source.matrix);
+ this.generateMipmaps = source.generateMipmaps;
+ this.premultiplyAlpha = source.premultiplyAlpha;
+ this.flipY = source.flipY;
+ this.unpackAlignment = source.unpackAlignment;
+ this.encoding = source.encoding;
+ this.userData = JSON.parse(JSON.stringify(source.userData));
+ this.needsUpdate = true;
+ return this;
+ }
+ toJSON(meta) {
+ const isRootObject = meta === void 0 || typeof meta === "string";
+ if (!isRootObject && meta.textures[this.uuid] !== void 0) {
+ return meta.textures[this.uuid];
+ }
+ const output = {
+ metadata: {
+ version: 4.5,
+ type: "Texture",
+ generator: "Texture.toJSON"
+ },
+ uuid: this.uuid,
+ name: this.name,
+ image: this.source.toJSON(meta).uuid,
+ mapping: this.mapping,
+ repeat: [this.repeat.x, this.repeat.y],
+ offset: [this.offset.x, this.offset.y],
+ center: [this.center.x, this.center.y],
+ rotation: this.rotation,
+ wrap: [this.wrapS, this.wrapT],
+ format: this.format,
+ type: this.type,
+ encoding: this.encoding,
+ minFilter: this.minFilter,
+ magFilter: this.magFilter,
+ anisotropy: this.anisotropy,
+ flipY: this.flipY,
+ premultiplyAlpha: this.premultiplyAlpha,
+ unpackAlignment: this.unpackAlignment
+ };
+ if (JSON.stringify(this.userData) !== "{}")
+ output.userData = this.userData;
+ if (!isRootObject) {
+ meta.textures[this.uuid] = output;
+ }
+ return output;
+ }
+ dispose() {
+ this.dispatchEvent({ type: "dispose" });
+ }
+ transformUv(uv) {
+ if (this.mapping !== UVMapping)
+ return uv;
+ uv.applyMatrix3(this.matrix);
+ if (uv.x < 0 || uv.x > 1) {
+ switch (this.wrapS) {
+ case RepeatWrapping:
+ uv.x = uv.x - Math.floor(uv.x);
+ break;
+ case ClampToEdgeWrapping:
+ uv.x = uv.x < 0 ? 0 : 1;
+ break;
+ case MirroredRepeatWrapping:
+ if (Math.abs(Math.floor(uv.x) % 2) === 1) {
+ uv.x = Math.ceil(uv.x) - uv.x;
+ } else {
+ uv.x = uv.x - Math.floor(uv.x);
+ }
+ break;
+ }
+ }
+ if (uv.y < 0 || uv.y > 1) {
+ switch (this.wrapT) {
+ case RepeatWrapping:
+ uv.y = uv.y - Math.floor(uv.y);
+ break;
+ case ClampToEdgeWrapping:
+ uv.y = uv.y < 0 ? 0 : 1;
+ break;
+ case MirroredRepeatWrapping:
+ if (Math.abs(Math.floor(uv.y) % 2) === 1) {
+ uv.y = Math.ceil(uv.y) - uv.y;
+ } else {
+ uv.y = uv.y - Math.floor(uv.y);
+ }
+ break;
+ }
+ }
+ if (this.flipY) {
+ uv.y = 1 - uv.y;
+ }
+ return uv;
+ }
+ set needsUpdate(value) {
+ if (value === true) {
+ this.version++;
+ this.source.needsUpdate = true;
+ }
+ }
+}
+Texture$1.DEFAULT_IMAGE = null;
+Texture$1.DEFAULT_MAPPING = UVMapping;
+Texture$1.prototype.isTexture = true;
+class Vector4 {
+ constructor(x = 0, y2 = 0, z2 = 0, w2 = 1) {
+ this.x = x;
+ this.y = y2;
+ this.z = z2;
+ this.w = w2;
+ }
+ get width() {
+ return this.z;
+ }
+ set width(value) {
+ this.z = value;
+ }
+ get height() {
+ return this.w;
+ }
+ set height(value) {
+ this.w = value;
+ }
+ set(x, y2, z2, w2) {
+ this.x = x;
+ this.y = y2;
+ this.z = z2;
+ this.w = w2;
+ return this;
+ }
+ setScalar(scalar) {
+ this.x = scalar;
+ this.y = scalar;
+ this.z = scalar;
+ this.w = scalar;
+ return this;
+ }
+ setX(x) {
+ this.x = x;
+ return this;
+ }
+ setY(y2) {
+ this.y = y2;
+ return this;
+ }
+ setZ(z2) {
+ this.z = z2;
+ return this;
+ }
+ setW(w2) {
+ this.w = w2;
+ return this;
+ }
+ setComponent(index, value) {
+ switch (index) {
+ case 0:
+ this.x = value;
+ break;
+ case 1:
+ this.y = value;
+ break;
+ case 2:
+ this.z = value;
+ break;
+ case 3:
+ this.w = value;
+ break;
+ default:
+ throw new Error("index is out of range: " + index);
+ }
+ return this;
+ }
+ getComponent(index) {
+ switch (index) {
+ 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: " + index);
+ }
+ }
+ clone() {
+ return new this.constructor(this.x, this.y, this.z, this.w);
+ }
+ copy(v2) {
+ this.x = v2.x;
+ this.y = v2.y;
+ this.z = v2.z;
+ this.w = v2.w !== void 0 ? v2.w : 1;
+ return this;
+ }
+ add(v2, w2) {
+ if (w2 !== void 0) {
+ console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");
+ return this.addVectors(v2, w2);
+ }
+ this.x += v2.x;
+ this.y += v2.y;
+ this.z += v2.z;
+ this.w += v2.w;
+ return this;
+ }
+ addScalar(s2) {
+ this.x += s2;
+ this.y += s2;
+ this.z += s2;
+ this.w += s2;
+ return this;
+ }
+ addVectors(a2, b3) {
+ this.x = a2.x + b3.x;
+ this.y = a2.y + b3.y;
+ this.z = a2.z + b3.z;
+ this.w = a2.w + b3.w;
+ return this;
+ }
+ addScaledVector(v2, s2) {
+ this.x += v2.x * s2;
+ this.y += v2.y * s2;
+ this.z += v2.z * s2;
+ this.w += v2.w * s2;
+ return this;
+ }
+ sub(v2, w2) {
+ if (w2 !== void 0) {
+ console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");
+ return this.subVectors(v2, w2);
+ }
+ this.x -= v2.x;
+ this.y -= v2.y;
+ this.z -= v2.z;
+ this.w -= v2.w;
+ return this;
+ }
+ subScalar(s2) {
+ this.x -= s2;
+ this.y -= s2;
+ this.z -= s2;
+ this.w -= s2;
+ return this;
+ }
+ subVectors(a2, b3) {
+ this.x = a2.x - b3.x;
+ this.y = a2.y - b3.y;
+ this.z = a2.z - b3.z;
+ this.w = a2.w - b3.w;
+ return this;
+ }
+ multiply(v2) {
+ this.x *= v2.x;
+ this.y *= v2.y;
+ this.z *= v2.z;
+ this.w *= v2.w;
+ return this;
+ }
+ multiplyScalar(scalar) {
+ this.x *= scalar;
+ this.y *= scalar;
+ this.z *= scalar;
+ this.w *= scalar;
+ return this;
+ }
+ applyMatrix4(m2) {
+ const x = this.x, y2 = this.y, z2 = this.z, w2 = this.w;
+ const e2 = m2.elements;
+ this.x = e2[0] * x + e2[4] * y2 + e2[8] * z2 + e2[12] * w2;
+ this.y = e2[1] * x + e2[5] * y2 + e2[9] * z2 + e2[13] * w2;
+ this.z = e2[2] * x + e2[6] * y2 + e2[10] * z2 + e2[14] * w2;
+ this.w = e2[3] * x + e2[7] * y2 + e2[11] * z2 + e2[15] * w2;
+ return this;
+ }
+ divideScalar(scalar) {
+ return this.multiplyScalar(1 / scalar);
+ }
+ setAxisAngleFromQuaternion(q) {
+ this.w = 2 * Math.acos(q.w);
+ const s2 = Math.sqrt(1 - q.w * q.w);
+ if (s2 < 1e-4) {
+ this.x = 1;
+ this.y = 0;
+ this.z = 0;
+ } else {
+ this.x = q.x / s2;
+ this.y = q.y / s2;
+ this.z = q.z / s2;
+ }
+ return this;
+ }
+ setAxisAngleFromRotationMatrix(m2) {
+ let angle, x, y2, z2;
+ const epsilon = 0.01, epsilon2 = 0.1, te2 = m2.elements, m11 = te2[0], m12 = te2[4], m13 = te2[8], m21 = te2[1], m22 = te2[5], m23 = te2[9], m31 = te2[2], m32 = te2[6], m33 = te2[10];
+ if (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) {
+ if (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) {
+ this.set(1, 0, 0, 0);
+ return this;
+ }
+ angle = Math.PI;
+ const xx = (m11 + 1) / 2;
+ const yy = (m22 + 1) / 2;
+ const zz = (m33 + 1) / 2;
+ const xy = (m12 + m21) / 4;
+ const xz = (m13 + m31) / 4;
+ const yz = (m23 + m32) / 4;
+ if (xx > yy && xx > zz) {
+ if (xx < epsilon) {
+ x = 0;
+ y2 = 0.707106781;
+ z2 = 0.707106781;
+ } else {
+ x = Math.sqrt(xx);
+ y2 = xy / x;
+ z2 = xz / x;
+ }
+ } else if (yy > zz) {
+ if (yy < epsilon) {
+ x = 0.707106781;
+ y2 = 0;
+ z2 = 0.707106781;
+ } else {
+ y2 = Math.sqrt(yy);
+ x = xy / y2;
+ z2 = yz / y2;
+ }
+ } else {
+ if (zz < epsilon) {
+ x = 0.707106781;
+ y2 = 0.707106781;
+ z2 = 0;
+ } else {
+ z2 = Math.sqrt(zz);
+ x = xz / z2;
+ y2 = yz / z2;
+ }
+ }
+ this.set(x, y2, z2, angle);
+ return this;
+ }
+ let s2 = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12));
+ if (Math.abs(s2) < 1e-3)
+ s2 = 1;
+ this.x = (m32 - m23) / s2;
+ this.y = (m13 - m31) / s2;
+ this.z = (m21 - m12) / s2;
+ this.w = Math.acos((m11 + m22 + m33 - 1) / 2);
+ return this;
+ }
+ min(v2) {
+ this.x = Math.min(this.x, v2.x);
+ this.y = Math.min(this.y, v2.y);
+ this.z = Math.min(this.z, v2.z);
+ this.w = Math.min(this.w, v2.w);
+ return this;
+ }
+ max(v2) {
+ this.x = Math.max(this.x, v2.x);
+ this.y = Math.max(this.y, v2.y);
+ this.z = Math.max(this.z, v2.z);
+ this.w = Math.max(this.w, v2.w);
+ return this;
+ }
+ clamp(min, max2) {
+ this.x = Math.max(min.x, Math.min(max2.x, this.x));
+ this.y = Math.max(min.y, Math.min(max2.y, this.y));
+ this.z = Math.max(min.z, Math.min(max2.z, this.z));
+ this.w = Math.max(min.w, Math.min(max2.w, this.w));
+ return this;
+ }
+ clampScalar(minVal, maxVal) {
+ this.x = Math.max(minVal, Math.min(maxVal, this.x));
+ this.y = Math.max(minVal, Math.min(maxVal, this.y));
+ this.z = Math.max(minVal, Math.min(maxVal, this.z));
+ this.w = Math.max(minVal, Math.min(maxVal, this.w));
+ return this;
+ }
+ clampLength(min, max2) {
+ const length = this.length();
+ return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max2, length)));
+ }
+ floor() {
+ this.x = Math.floor(this.x);
+ this.y = Math.floor(this.y);
+ this.z = Math.floor(this.z);
+ this.w = Math.floor(this.w);
+ return this;
+ }
+ ceil() {
+ this.x = Math.ceil(this.x);
+ this.y = Math.ceil(this.y);
+ this.z = Math.ceil(this.z);
+ this.w = Math.ceil(this.w);
+ return this;
+ }
+ round() {
+ this.x = Math.round(this.x);
+ this.y = Math.round(this.y);
+ this.z = Math.round(this.z);
+ this.w = Math.round(this.w);
+ return this;
+ }
+ roundToZero() {
+ this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);
+ this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);
+ this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);
+ this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w);
+ return this;
+ }
+ negate() {
+ this.x = -this.x;
+ this.y = -this.y;
+ this.z = -this.z;
+ this.w = -this.w;
+ return this;
+ }
+ dot(v2) {
+ return this.x * v2.x + this.y * v2.y + this.z * v2.z + this.w * v2.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(length) {
+ return this.normalize().multiplyScalar(length);
+ }
+ lerp(v2, alpha) {
+ this.x += (v2.x - this.x) * alpha;
+ this.y += (v2.y - this.y) * alpha;
+ this.z += (v2.z - this.z) * alpha;
+ this.w += (v2.w - this.w) * alpha;
+ return this;
+ }
+ lerpVectors(v1, v2, alpha) {
+ this.x = v1.x + (v2.x - v1.x) * alpha;
+ this.y = v1.y + (v2.y - v1.y) * alpha;
+ this.z = v1.z + (v2.z - v1.z) * alpha;
+ this.w = v1.w + (v2.w - v1.w) * alpha;
+ return this;
+ }
+ equals(v2) {
+ return v2.x === this.x && v2.y === this.y && v2.z === this.z && v2.w === this.w;
+ }
+ fromArray(array, offset = 0) {
+ this.x = array[offset];
+ this.y = array[offset + 1];
+ this.z = array[offset + 2];
+ this.w = array[offset + 3];
+ return this;
+ }
+ toArray(array = [], offset = 0) {
+ array[offset] = this.x;
+ array[offset + 1] = this.y;
+ array[offset + 2] = this.z;
+ array[offset + 3] = this.w;
+ return array;
+ }
+ fromBufferAttribute(attribute, index, offset) {
+ if (offset !== void 0) {
+ console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute().");
+ }
+ this.x = attribute.getX(index);
+ this.y = attribute.getY(index);
+ this.z = attribute.getZ(index);
+ this.w = attribute.getW(index);
+ return this;
+ }
+ random() {
+ this.x = Math.random();
+ this.y = Math.random();
+ this.z = Math.random();
+ this.w = Math.random();
+ return this;
+ }
+ *[Symbol.iterator]() {
+ yield this.x;
+ yield this.y;
+ yield this.z;
+ yield this.w;
+ }
+}
+Vector4.prototype.isVector4 = true;
+class WebGLRenderTarget extends EventDispatcher {
+ constructor(width, height, options = {}) {
+ super();
+ this.width = width;
+ this.height = height;
+ this.depth = 1;
+ this.scissor = new Vector4(0, 0, width, height);
+ this.scissorTest = false;
+ this.viewport = new Vector4(0, 0, width, height);
+ const image = { width, height, depth: 1 };
+ this.texture = new Texture$1(image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding);
+ this.texture.isRenderTargetTexture = true;
+ this.texture.generateMipmaps = options.generateMipmaps !== void 0 ? options.generateMipmaps : false;
+ this.texture.internalFormat = options.internalFormat !== void 0 ? options.internalFormat : null;
+ this.texture.minFilter = options.minFilter !== void 0 ? options.minFilter : LinearFilter;
+ this.depthBuffer = options.depthBuffer !== void 0 ? options.depthBuffer : true;
+ this.stencilBuffer = options.stencilBuffer !== void 0 ? options.stencilBuffer : false;
+ this.depthTexture = options.depthTexture !== void 0 ? options.depthTexture : null;
+ this.samples = options.samples !== void 0 ? options.samples : 0;
+ }
+ setSize(width, height, depth = 1) {
+ if (this.width !== width || this.height !== height || this.depth !== depth) {
+ this.width = width;
+ this.height = height;
+ this.depth = depth;
+ this.texture.image.width = width;
+ this.texture.image.height = height;
+ this.texture.image.depth = depth;
+ this.dispose();
+ }
+ this.viewport.set(0, 0, width, height);
+ this.scissor.set(0, 0, width, height);
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+ copy(source) {
+ this.width = source.width;
+ this.height = source.height;
+ this.depth = source.depth;
+ this.viewport.copy(source.viewport);
+ this.texture = source.texture.clone();
+ this.texture.image = Object.assign({}, source.texture.image);
+ this.depthBuffer = source.depthBuffer;
+ this.stencilBuffer = source.stencilBuffer;
+ if (source.depthTexture !== null)
+ this.depthTexture = source.depthTexture.clone();
+ this.samples = source.samples;
+ return this;
+ }
+ dispose() {
+ this.dispatchEvent({ type: "dispose" });
+ }
+}
+WebGLRenderTarget.prototype.isWebGLRenderTarget = true;
+class DataArrayTexture extends Texture$1 {
+ constructor(data = null, width = 1, height = 1, depth = 1) {
+ super(null);
+ this.image = { data, width, height, depth };
+ this.magFilter = NearestFilter;
+ this.minFilter = NearestFilter;
+ this.wrapR = ClampToEdgeWrapping;
+ this.generateMipmaps = false;
+ this.flipY = false;
+ this.unpackAlignment = 1;
+ }
+}
+DataArrayTexture.prototype.isDataArrayTexture = true;
+class WebGLArrayRenderTarget extends WebGLRenderTarget {
+ constructor(width, height, depth) {
+ super(width, height);
+ this.depth = depth;
+ this.texture = new DataArrayTexture(null, width, height, depth);
+ this.texture.isRenderTargetTexture = true;
+ }
+}
+WebGLArrayRenderTarget.prototype.isWebGLArrayRenderTarget = true;
+class Data3DTexture extends Texture$1 {
+ constructor(data = null, width = 1, height = 1, depth = 1) {
+ super(null);
+ this.image = { data, width, height, depth };
+ this.magFilter = NearestFilter;
+ this.minFilter = NearestFilter;
+ this.wrapR = ClampToEdgeWrapping;
+ this.generateMipmaps = false;
+ this.flipY = false;
+ this.unpackAlignment = 1;
+ }
+}
+Data3DTexture.prototype.isData3DTexture = true;
+class WebGL3DRenderTarget extends WebGLRenderTarget {
+ constructor(width, height, depth) {
+ super(width, height);
+ this.depth = depth;
+ this.texture = new Data3DTexture(null, width, height, depth);
+ this.texture.isRenderTargetTexture = true;
+ }
+}
+WebGL3DRenderTarget.prototype.isWebGL3DRenderTarget = true;
+class WebGLMultipleRenderTargets extends WebGLRenderTarget {
+ constructor(width, height, count, options = {}) {
+ super(width, height, options);
+ const texture = this.texture;
+ this.texture = [];
+ for (let i = 0; i < count; i++) {
+ this.texture[i] = texture.clone();
+ this.texture[i].isRenderTargetTexture = true;
+ }
+ }
+ setSize(width, height, depth = 1) {
+ if (this.width !== width || this.height !== height || this.depth !== depth) {
+ this.width = width;
+ this.height = height;
+ this.depth = depth;
+ for (let i = 0, il = this.texture.length; i < il; i++) {
+ this.texture[i].image.width = width;
+ this.texture[i].image.height = height;
+ this.texture[i].image.depth = depth;
+ }
+ this.dispose();
+ }
+ this.viewport.set(0, 0, width, height);
+ this.scissor.set(0, 0, width, height);
+ return this;
+ }
+ copy(source) {
+ this.dispose();
+ this.width = source.width;
+ this.height = source.height;
+ this.depth = source.depth;
+ this.viewport.set(0, 0, this.width, this.height);
+ this.scissor.set(0, 0, this.width, this.height);
+ this.depthBuffer = source.depthBuffer;
+ this.stencilBuffer = source.stencilBuffer;
+ this.depthTexture = source.depthTexture;
+ this.texture.length = 0;
+ for (let i = 0, il = source.texture.length; i < il; i++) {
+ this.texture[i] = source.texture[i].clone();
+ }
+ return this;
+ }
+}
+WebGLMultipleRenderTargets.prototype.isWebGLMultipleRenderTargets = true;
+class Quaternion {
+ constructor(x = 0, y2 = 0, z2 = 0, w2 = 1) {
+ this._x = x;
+ this._y = y2;
+ this._z = z2;
+ this._w = w2;
+ }
+ static slerp(qa, qb, qm, t2) {
+ console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead.");
+ return qm.slerpQuaternions(qa, qb, t2);
+ }
+ static slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t2) {
+ let x0 = src0[srcOffset0 + 0], y0 = src0[srcOffset0 + 1], z0 = src0[srcOffset0 + 2], w0 = src0[srcOffset0 + 3];
+ const x1 = src1[srcOffset1 + 0], y1 = src1[srcOffset1 + 1], z1 = src1[srcOffset1 + 2], w1 = src1[srcOffset1 + 3];
+ if (t2 === 0) {
+ dst[dstOffset + 0] = x0;
+ dst[dstOffset + 1] = y0;
+ dst[dstOffset + 2] = z0;
+ dst[dstOffset + 3] = w0;
+ return;
+ }
+ if (t2 === 1) {
+ dst[dstOffset + 0] = x1;
+ dst[dstOffset + 1] = y1;
+ dst[dstOffset + 2] = z1;
+ dst[dstOffset + 3] = w1;
+ return;
+ }
+ if (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {
+ let s2 = 1 - t2;
+ const cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, dir = cos >= 0 ? 1 : -1, sqrSin = 1 - cos * cos;
+ if (sqrSin > Number.EPSILON) {
+ const sin = Math.sqrt(sqrSin), len = Math.atan2(sin, cos * dir);
+ s2 = Math.sin(s2 * len) / sin;
+ t2 = Math.sin(t2 * len) / sin;
+ }
+ const tDir = t2 * dir;
+ x0 = x0 * s2 + x1 * tDir;
+ y0 = y0 * s2 + y1 * tDir;
+ z0 = z0 * s2 + z1 * tDir;
+ w0 = w0 * s2 + w1 * tDir;
+ if (s2 === 1 - t2) {
+ const f2 = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);
+ x0 *= f2;
+ y0 *= f2;
+ z0 *= f2;
+ w0 *= f2;
+ }
+ }
+ dst[dstOffset] = x0;
+ dst[dstOffset + 1] = y0;
+ dst[dstOffset + 2] = z0;
+ dst[dstOffset + 3] = w0;
+ }
+ static multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {
+ const x0 = src0[srcOffset0];
+ const y0 = src0[srcOffset0 + 1];
+ const z0 = src0[srcOffset0 + 2];
+ const w0 = src0[srcOffset0 + 3];
+ const x1 = src1[srcOffset1];
+ const y1 = src1[srcOffset1 + 1];
+ const z1 = src1[srcOffset1 + 2];
+ const w1 = src1[srcOffset1 + 3];
+ dst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;
+ dst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;
+ dst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;
+ dst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;
+ return dst;
+ }
+ get x() {
+ return this._x;
+ }
+ set x(value) {
+ this._x = value;
+ this._onChangeCallback();
+ }
+ get y() {
+ return this._y;
+ }
+ set y(value) {
+ this._y = value;
+ this._onChangeCallback();
+ }
+ get z() {
+ return this._z;
+ }
+ set z(value) {
+ this._z = value;
+ this._onChangeCallback();
+ }
+ get w() {
+ return this._w;
+ }
+ set w(value) {
+ this._w = value;
+ this._onChangeCallback();
+ }
+ set(x, y2, z2, w2) {
+ this._x = x;
+ this._y = y2;
+ this._z = z2;
+ this._w = w2;
+ this._onChangeCallback();
+ return this;
+ }
+ clone() {
+ return new this.constructor(this._x, this._y, this._z, this._w);
+ }
+ copy(quaternion) {
+ this._x = quaternion.x;
+ this._y = quaternion.y;
+ this._z = quaternion.z;
+ this._w = quaternion.w;
+ this._onChangeCallback();
+ return this;
+ }
+ setFromEuler(euler, update) {
+ if (!(euler && euler.isEuler)) {
+ throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");
+ }
+ const x = euler._x, y2 = euler._y, z2 = euler._z, order = euler._order;
+ const cos = Math.cos;
+ const sin = Math.sin;
+ const c1 = cos(x / 2);
+ const c2 = cos(y2 / 2);
+ const c3 = cos(z2 / 2);
+ const s1 = sin(x / 2);
+ const s2 = sin(y2 / 2);
+ const s3 = sin(z2 / 2);
+ switch (order) {
+ case "XYZ":
+ this._x = s1 * c2 * c3 + c1 * s2 * s3;
+ this._y = c1 * s2 * c3 - s1 * c2 * s3;
+ this._z = c1 * c2 * s3 + s1 * s2 * c3;
+ this._w = c1 * c2 * c3 - s1 * s2 * s3;
+ break;
+ case "YXZ":
+ this._x = s1 * c2 * c3 + c1 * s2 * s3;
+ this._y = c1 * s2 * c3 - s1 * c2 * s3;
+ this._z = c1 * c2 * s3 - s1 * s2 * c3;
+ this._w = c1 * c2 * c3 + s1 * s2 * s3;
+ break;
+ case "ZXY":
+ this._x = s1 * c2 * c3 - c1 * s2 * s3;
+ this._y = c1 * s2 * c3 + s1 * c2 * s3;
+ this._z = c1 * c2 * s3 + s1 * s2 * c3;
+ this._w = c1 * c2 * c3 - s1 * s2 * s3;
+ break;
+ case "ZYX":
+ this._x = s1 * c2 * c3 - c1 * s2 * s3;
+ this._y = c1 * s2 * c3 + s1 * c2 * s3;
+ this._z = c1 * c2 * s3 - s1 * s2 * c3;
+ this._w = c1 * c2 * c3 + s1 * s2 * s3;
+ break;
+ case "YZX":
+ this._x = s1 * c2 * c3 + c1 * s2 * s3;
+ this._y = c1 * s2 * c3 + s1 * c2 * s3;
+ this._z = c1 * c2 * s3 - s1 * s2 * c3;
+ this._w = c1 * c2 * c3 - s1 * s2 * s3;
+ break;
+ case "XZY":
+ this._x = s1 * c2 * c3 - c1 * s2 * s3;
+ this._y = c1 * s2 * c3 - s1 * c2 * s3;
+ this._z = c1 * c2 * s3 + s1 * s2 * c3;
+ this._w = c1 * c2 * c3 + s1 * s2 * s3;
+ break;
+ default:
+ console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + order);
+ }
+ if (update !== false)
+ this._onChangeCallback();
+ return this;
+ }
+ setFromAxisAngle(axis, angle) {
+ const halfAngle = angle / 2, s2 = Math.sin(halfAngle);
+ this._x = axis.x * s2;
+ this._y = axis.y * s2;
+ this._z = axis.z * s2;
+ this._w = Math.cos(halfAngle);
+ this._onChangeCallback();
+ return this;
+ }
+ setFromRotationMatrix(m2) {
+ const te2 = m2.elements, m11 = te2[0], m12 = te2[4], m13 = te2[8], m21 = te2[1], m22 = te2[5], m23 = te2[9], m31 = te2[2], m32 = te2[6], m33 = te2[10], trace = m11 + m22 + m33;
+ if (trace > 0) {
+ const s2 = 0.5 / Math.sqrt(trace + 1);
+ this._w = 0.25 / s2;
+ this._x = (m32 - m23) * s2;
+ this._y = (m13 - m31) * s2;
+ this._z = (m21 - m12) * s2;
+ } else if (m11 > m22 && m11 > m33) {
+ const s2 = 2 * Math.sqrt(1 + m11 - m22 - m33);
+ this._w = (m32 - m23) / s2;
+ this._x = 0.25 * s2;
+ this._y = (m12 + m21) / s2;
+ this._z = (m13 + m31) / s2;
+ } else if (m22 > m33) {
+ const s2 = 2 * Math.sqrt(1 + m22 - m11 - m33);
+ this._w = (m13 - m31) / s2;
+ this._x = (m12 + m21) / s2;
+ this._y = 0.25 * s2;
+ this._z = (m23 + m32) / s2;
+ } else {
+ const s2 = 2 * Math.sqrt(1 + m33 - m11 - m22);
+ this._w = (m21 - m12) / s2;
+ this._x = (m13 + m31) / s2;
+ this._y = (m23 + m32) / s2;
+ this._z = 0.25 * s2;
+ }
+ this._onChangeCallback();
+ return this;
+ }
+ setFromUnitVectors(vFrom, vTo) {
+ let r2 = vFrom.dot(vTo) + 1;
+ if (r2 < Number.EPSILON) {
+ r2 = 0;
+ if (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {
+ this._x = -vFrom.y;
+ this._y = vFrom.x;
+ this._z = 0;
+ this._w = r2;
+ } else {
+ this._x = 0;
+ this._y = -vFrom.z;
+ this._z = vFrom.y;
+ this._w = r2;
+ }
+ } else {
+ this._x = vFrom.y * vTo.z - vFrom.z * vTo.y;
+ this._y = vFrom.z * vTo.x - vFrom.x * vTo.z;
+ this._z = vFrom.x * vTo.y - vFrom.y * vTo.x;
+ this._w = r2;
+ }
+ return this.normalize();
+ }
+ angleTo(q) {
+ return 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));
+ }
+ rotateTowards(q, step) {
+ const angle = this.angleTo(q);
+ if (angle === 0)
+ return this;
+ const t2 = Math.min(1, step / angle);
+ this.slerp(q, t2);
+ return this;
+ }
+ identity() {
+ return this.set(0, 0, 0, 1);
+ }
+ invert() {
+ return this.conjugate();
+ }
+ conjugate() {
+ this._x *= -1;
+ this._y *= -1;
+ this._z *= -1;
+ this._onChangeCallback();
+ return this;
+ }
+ dot(v2) {
+ return this._x * v2._x + this._y * v2._y + this._z * v2._z + this._w * v2._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 l2 = this.length();
+ if (l2 === 0) {
+ this._x = 0;
+ this._y = 0;
+ this._z = 0;
+ this._w = 1;
+ } else {
+ l2 = 1 / l2;
+ this._x = this._x * l2;
+ this._y = this._y * l2;
+ this._z = this._z * l2;
+ this._w = this._w * l2;
+ }
+ this._onChangeCallback();
+ return this;
+ }
+ multiply(q, p2) {
+ if (p2 !== void 0) {
+ console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.");
+ return this.multiplyQuaternions(q, p2);
+ }
+ return this.multiplyQuaternions(this, q);
+ }
+ premultiply(q) {
+ return this.multiplyQuaternions(q, this);
+ }
+ multiplyQuaternions(a2, b3) {
+ const qax = a2._x, qay = a2._y, qaz = a2._z, qaw = a2._w;
+ const qbx = b3._x, qby = b3._y, qbz = b3._z, qbw = b3._w;
+ this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;
+ this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;
+ this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;
+ this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;
+ this._onChangeCallback();
+ return this;
+ }
+ slerp(qb, t2) {
+ if (t2 === 0)
+ return this;
+ if (t2 === 1)
+ return this.copy(qb);
+ const x = this._x, y2 = this._y, z2 = this._z, w2 = this._w;
+ let cosHalfTheta = w2 * qb._w + x * qb._x + y2 * qb._y + z2 * qb._z;
+ if (cosHalfTheta < 0) {
+ this._w = -qb._w;
+ this._x = -qb._x;
+ this._y = -qb._y;
+ this._z = -qb._z;
+ cosHalfTheta = -cosHalfTheta;
+ } else {
+ this.copy(qb);
+ }
+ if (cosHalfTheta >= 1) {
+ this._w = w2;
+ this._x = x;
+ this._y = y2;
+ this._z = z2;
+ return this;
+ }
+ const sqrSinHalfTheta = 1 - cosHalfTheta * cosHalfTheta;
+ if (sqrSinHalfTheta <= Number.EPSILON) {
+ const s2 = 1 - t2;
+ this._w = s2 * w2 + t2 * this._w;
+ this._x = s2 * x + t2 * this._x;
+ this._y = s2 * y2 + t2 * this._y;
+ this._z = s2 * z2 + t2 * this._z;
+ this.normalize();
+ this._onChangeCallback();
+ return this;
+ }
+ const sinHalfTheta = Math.sqrt(sqrSinHalfTheta);
+ const halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);
+ const ratioA = Math.sin((1 - t2) * halfTheta) / sinHalfTheta, ratioB = Math.sin(t2 * halfTheta) / sinHalfTheta;
+ this._w = w2 * ratioA + this._w * ratioB;
+ this._x = x * ratioA + this._x * ratioB;
+ this._y = y2 * ratioA + this._y * ratioB;
+ this._z = z2 * ratioA + this._z * ratioB;
+ this._onChangeCallback();
+ return this;
+ }
+ slerpQuaternions(qa, qb, t2) {
+ return this.copy(qa).slerp(qb, t2);
+ }
+ random() {
+ const u1 = Math.random();
+ const sqrt1u1 = Math.sqrt(1 - u1);
+ const sqrtu1 = Math.sqrt(u1);
+ const u2 = 2 * Math.PI * Math.random();
+ const u3 = 2 * Math.PI * Math.random();
+ return this.set(sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2));
+ }
+ equals(quaternion) {
+ return quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;
+ }
+ fromArray(array, offset = 0) {
+ this._x = array[offset];
+ this._y = array[offset + 1];
+ this._z = array[offset + 2];
+ this._w = array[offset + 3];
+ this._onChangeCallback();
+ return this;
+ }
+ toArray(array = [], offset = 0) {
+ array[offset] = this._x;
+ array[offset + 1] = this._y;
+ array[offset + 2] = this._z;
+ array[offset + 3] = this._w;
+ return array;
+ }
+ fromBufferAttribute(attribute, index) {
+ this._x = attribute.getX(index);
+ this._y = attribute.getY(index);
+ this._z = attribute.getZ(index);
+ this._w = attribute.getW(index);
+ return this;
+ }
+ _onChange(callback) {
+ this._onChangeCallback = callback;
+ return this;
+ }
+ _onChangeCallback() {
+ }
+}
+Quaternion.prototype.isQuaternion = true;
+class Vector3 {
+ constructor(x = 0, y2 = 0, z2 = 0) {
+ this.x = x;
+ this.y = y2;
+ this.z = z2;
+ }
+ set(x, y2, z2) {
+ if (z2 === void 0)
+ z2 = this.z;
+ this.x = x;
+ this.y = y2;
+ this.z = z2;
+ return this;
+ }
+ setScalar(scalar) {
+ this.x = scalar;
+ this.y = scalar;
+ this.z = scalar;
+ return this;
+ }
+ setX(x) {
+ this.x = x;
+ return this;
+ }
+ setY(y2) {
+ this.y = y2;
+ return this;
+ }
+ setZ(z2) {
+ this.z = z2;
+ return this;
+ }
+ setComponent(index, value) {
+ switch (index) {
+ case 0:
+ this.x = value;
+ break;
+ case 1:
+ this.y = value;
+ break;
+ case 2:
+ this.z = value;
+ break;
+ default:
+ throw new Error("index is out of range: " + index);
+ }
+ return this;
+ }
+ getComponent(index) {
+ switch (index) {
+ case 0:
+ return this.x;
+ case 1:
+ return this.y;
+ case 2:
+ return this.z;
+ default:
+ throw new Error("index is out of range: " + index);
+ }
+ }
+ clone() {
+ return new this.constructor(this.x, this.y, this.z);
+ }
+ copy(v2) {
+ this.x = v2.x;
+ this.y = v2.y;
+ this.z = v2.z;
+ return this;
+ }
+ add(v2, w2) {
+ if (w2 !== void 0) {
+ console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");
+ return this.addVectors(v2, w2);
+ }
+ this.x += v2.x;
+ this.y += v2.y;
+ this.z += v2.z;
+ return this;
+ }
+ addScalar(s2) {
+ this.x += s2;
+ this.y += s2;
+ this.z += s2;
+ return this;
+ }
+ addVectors(a2, b3) {
+ this.x = a2.x + b3.x;
+ this.y = a2.y + b3.y;
+ this.z = a2.z + b3.z;
+ return this;
+ }
+ addScaledVector(v2, s2) {
+ this.x += v2.x * s2;
+ this.y += v2.y * s2;
+ this.z += v2.z * s2;
+ return this;
+ }
+ sub(v2, w2) {
+ if (w2 !== void 0) {
+ console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");
+ return this.subVectors(v2, w2);
+ }
+ this.x -= v2.x;
+ this.y -= v2.y;
+ this.z -= v2.z;
+ return this;
+ }
+ subScalar(s2) {
+ this.x -= s2;
+ this.y -= s2;
+ this.z -= s2;
+ return this;
+ }
+ subVectors(a2, b3) {
+ this.x = a2.x - b3.x;
+ this.y = a2.y - b3.y;
+ this.z = a2.z - b3.z;
+ return this;
+ }
+ multiply(v2, w2) {
+ if (w2 !== void 0) {
+ console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.");
+ return this.multiplyVectors(v2, w2);
+ }
+ this.x *= v2.x;
+ this.y *= v2.y;
+ this.z *= v2.z;
+ return this;
+ }
+ multiplyScalar(scalar) {
+ this.x *= scalar;
+ this.y *= scalar;
+ this.z *= scalar;
+ return this;
+ }
+ multiplyVectors(a2, b3) {
+ this.x = a2.x * b3.x;
+ this.y = a2.y * b3.y;
+ this.z = a2.z * b3.z;
+ return this;
+ }
+ applyEuler(euler) {
+ if (!(euler && euler.isEuler)) {
+ console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");
+ }
+ return this.applyQuaternion(_quaternion$4.setFromEuler(euler));
+ }
+ applyAxisAngle(axis, angle) {
+ return this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis, angle));
+ }
+ applyMatrix3(m2) {
+ const x = this.x, y2 = this.y, z2 = this.z;
+ const e2 = m2.elements;
+ this.x = e2[0] * x + e2[3] * y2 + e2[6] * z2;
+ this.y = e2[1] * x + e2[4] * y2 + e2[7] * z2;
+ this.z = e2[2] * x + e2[5] * y2 + e2[8] * z2;
+ return this;
+ }
+ applyNormalMatrix(m2) {
+ return this.applyMatrix3(m2).normalize();
+ }
+ applyMatrix4(m2) {
+ const x = this.x, y2 = this.y, z2 = this.z;
+ const e2 = m2.elements;
+ const w2 = 1 / (e2[3] * x + e2[7] * y2 + e2[11] * z2 + e2[15]);
+ this.x = (e2[0] * x + e2[4] * y2 + e2[8] * z2 + e2[12]) * w2;
+ this.y = (e2[1] * x + e2[5] * y2 + e2[9] * z2 + e2[13]) * w2;
+ this.z = (e2[2] * x + e2[6] * y2 + e2[10] * z2 + e2[14]) * w2;
+ return this;
+ }
+ applyQuaternion(q) {
+ const x = this.x, y2 = this.y, z2 = this.z;
+ const qx = q.x, qy = q.y, qz = q.z, qw = q.w;
+ const ix = qw * x + qy * z2 - qz * y2;
+ const iy = qw * y2 + qz * x - qx * z2;
+ const iz = qw * z2 + qx * y2 - qy * x;
+ const iw = -qx * x - qy * y2 - qz * z2;
+ this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;
+ this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;
+ this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;
+ return this;
+ }
+ project(camera) {
+ return this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix);
+ }
+ unproject(camera) {
+ return this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld);
+ }
+ transformDirection(m2) {
+ const x = this.x, y2 = this.y, z2 = this.z;
+ const e2 = m2.elements;
+ this.x = e2[0] * x + e2[4] * y2 + e2[8] * z2;
+ this.y = e2[1] * x + e2[5] * y2 + e2[9] * z2;
+ this.z = e2[2] * x + e2[6] * y2 + e2[10] * z2;
+ return this.normalize();
+ }
+ divide(v2) {
+ this.x /= v2.x;
+ this.y /= v2.y;
+ this.z /= v2.z;
+ return this;
+ }
+ divideScalar(scalar) {
+ return this.multiplyScalar(1 / scalar);
+ }
+ min(v2) {
+ this.x = Math.min(this.x, v2.x);
+ this.y = Math.min(this.y, v2.y);
+ this.z = Math.min(this.z, v2.z);
+ return this;
+ }
+ max(v2) {
+ this.x = Math.max(this.x, v2.x);
+ this.y = Math.max(this.y, v2.y);
+ this.z = Math.max(this.z, v2.z);
+ return this;
+ }
+ clamp(min, max2) {
+ this.x = Math.max(min.x, Math.min(max2.x, this.x));
+ this.y = Math.max(min.y, Math.min(max2.y, this.y));
+ this.z = Math.max(min.z, Math.min(max2.z, this.z));
+ return this;
+ }
+ clampScalar(minVal, maxVal) {
+ this.x = Math.max(minVal, Math.min(maxVal, this.x));
+ this.y = Math.max(minVal, Math.min(maxVal, this.y));
+ this.z = Math.max(minVal, Math.min(maxVal, this.z));
+ return this;
+ }
+ clampLength(min, max2) {
+ const length = this.length();
+ return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max2, length)));
+ }
+ floor() {
+ this.x = Math.floor(this.x);
+ this.y = Math.floor(this.y);
+ this.z = Math.floor(this.z);
+ return this;
+ }
+ ceil() {
+ this.x = Math.ceil(this.x);
+ this.y = Math.ceil(this.y);
+ this.z = Math.ceil(this.z);
+ return this;
+ }
+ round() {
+ this.x = Math.round(this.x);
+ this.y = Math.round(this.y);
+ this.z = Math.round(this.z);
+ return this;
+ }
+ roundToZero() {
+ this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);
+ this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);
+ this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);
+ return this;
+ }
+ negate() {
+ this.x = -this.x;
+ this.y = -this.y;
+ this.z = -this.z;
+ return this;
+ }
+ dot(v2) {
+ return this.x * v2.x + this.y * v2.y + this.z * v2.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(length) {
+ return this.normalize().multiplyScalar(length);
+ }
+ lerp(v2, alpha) {
+ this.x += (v2.x - this.x) * alpha;
+ this.y += (v2.y - this.y) * alpha;
+ this.z += (v2.z - this.z) * alpha;
+ return this;
+ }
+ lerpVectors(v1, v2, alpha) {
+ this.x = v1.x + (v2.x - v1.x) * alpha;
+ this.y = v1.y + (v2.y - v1.y) * alpha;
+ this.z = v1.z + (v2.z - v1.z) * alpha;
+ return this;
+ }
+ cross(v2, w2) {
+ if (w2 !== void 0) {
+ console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.");
+ return this.crossVectors(v2, w2);
+ }
+ return this.crossVectors(this, v2);
+ }
+ crossVectors(a2, b3) {
+ const ax = a2.x, ay = a2.y, az = a2.z;
+ const bx = b3.x, by = b3.y, bz = b3.z;
+ this.x = ay * bz - az * by;
+ this.y = az * bx - ax * bz;
+ this.z = ax * by - ay * bx;
+ return this;
+ }
+ projectOnVector(v2) {
+ const denominator = v2.lengthSq();
+ if (denominator === 0)
+ return this.set(0, 0, 0);
+ const scalar = v2.dot(this) / denominator;
+ return this.copy(v2).multiplyScalar(scalar);
+ }
+ projectOnPlane(planeNormal) {
+ _vector$c.copy(this).projectOnVector(planeNormal);
+ return this.sub(_vector$c);
+ }
+ reflect(normal) {
+ return this.sub(_vector$c.copy(normal).multiplyScalar(2 * this.dot(normal)));
+ }
+ angleTo(v2) {
+ const denominator = Math.sqrt(this.lengthSq() * v2.lengthSq());
+ if (denominator === 0)
+ return Math.PI / 2;
+ const theta = this.dot(v2) / denominator;
+ return Math.acos(clamp(theta, -1, 1));
+ }
+ distanceTo(v2) {
+ return Math.sqrt(this.distanceToSquared(v2));
+ }
+ distanceToSquared(v2) {
+ const dx = this.x - v2.x, dy = this.y - v2.y, dz = this.z - v2.z;
+ return dx * dx + dy * dy + dz * dz;
+ }
+ manhattanDistanceTo(v2) {
+ return Math.abs(this.x - v2.x) + Math.abs(this.y - v2.y) + Math.abs(this.z - v2.z);
+ }
+ setFromSpherical(s2) {
+ return this.setFromSphericalCoords(s2.radius, s2.phi, s2.theta);
+ }
+ setFromSphericalCoords(radius, phi, theta) {
+ const sinPhiRadius = Math.sin(phi) * radius;
+ this.x = sinPhiRadius * Math.sin(theta);
+ this.y = Math.cos(phi) * radius;
+ this.z = sinPhiRadius * Math.cos(theta);
+ return this;
+ }
+ setFromCylindrical(c2) {
+ return this.setFromCylindricalCoords(c2.radius, c2.theta, c2.y);
+ }
+ setFromCylindricalCoords(radius, theta, y2) {
+ this.x = radius * Math.sin(theta);
+ this.y = y2;
+ this.z = radius * Math.cos(theta);
+ return this;
+ }
+ setFromMatrixPosition(m2) {
+ const e2 = m2.elements;
+ this.x = e2[12];
+ this.y = e2[13];
+ this.z = e2[14];
+ return this;
+ }
+ setFromMatrixScale(m2) {
+ const sx = this.setFromMatrixColumn(m2, 0).length();
+ const sy = this.setFromMatrixColumn(m2, 1).length();
+ const sz = this.setFromMatrixColumn(m2, 2).length();
+ this.x = sx;
+ this.y = sy;
+ this.z = sz;
+ return this;
+ }
+ setFromMatrixColumn(m2, index) {
+ return this.fromArray(m2.elements, index * 4);
+ }
+ setFromMatrix3Column(m2, index) {
+ return this.fromArray(m2.elements, index * 3);
+ }
+ setFromEuler(e2) {
+ this.x = e2._x;
+ this.y = e2._y;
+ this.z = e2._z;
+ return this;
+ }
+ equals(v2) {
+ return v2.x === this.x && v2.y === this.y && v2.z === this.z;
+ }
+ fromArray(array, offset = 0) {
+ this.x = array[offset];
+ this.y = array[offset + 1];
+ this.z = array[offset + 2];
+ return this;
+ }
+ toArray(array = [], offset = 0) {
+ array[offset] = this.x;
+ array[offset + 1] = this.y;
+ array[offset + 2] = this.z;
+ return array;
+ }
+ fromBufferAttribute(attribute, index, offset) {
+ if (offset !== void 0) {
+ console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute().");
+ }
+ this.x = attribute.getX(index);
+ this.y = attribute.getY(index);
+ this.z = attribute.getZ(index);
+ return this;
+ }
+ random() {
+ this.x = Math.random();
+ this.y = Math.random();
+ this.z = Math.random();
+ return this;
+ }
+ randomDirection() {
+ const u2 = (Math.random() - 0.5) * 2;
+ const t2 = Math.random() * Math.PI * 2;
+ const f2 = Math.sqrt(1 - u2 ** 2);
+ this.x = f2 * Math.cos(t2);
+ this.y = f2 * Math.sin(t2);
+ this.z = u2;
+ return this;
+ }
+ *[Symbol.iterator]() {
+ yield this.x;
+ yield this.y;
+ yield this.z;
+ }
+}
+Vector3.prototype.isVector3 = true;
+const _vector$c = /* @__PURE__ */ new Vector3();
+const _quaternion$4 = /* @__PURE__ */ new Quaternion();
+class Box3 {
+ constructor(min = new Vector3(Infinity, Infinity, Infinity), max2 = new Vector3(-Infinity, -Infinity, -Infinity)) {
+ this.min = min;
+ this.max = max2;
+ }
+ set(min, max2) {
+ this.min.copy(min);
+ this.max.copy(max2);
+ return this;
+ }
+ setFromArray(array) {
+ let minX = Infinity;
+ let minY = Infinity;
+ let minZ = Infinity;
+ let maxX = -Infinity;
+ let maxY = -Infinity;
+ let maxZ = -Infinity;
+ for (let i = 0, l2 = array.length; i < l2; i += 3) {
+ const x = array[i];
+ const y2 = array[i + 1];
+ const z2 = array[i + 2];
+ if (x < minX)
+ minX = x;
+ if (y2 < minY)
+ minY = y2;
+ if (z2 < minZ)
+ minZ = z2;
+ if (x > maxX)
+ maxX = x;
+ if (y2 > maxY)
+ maxY = y2;
+ if (z2 > maxZ)
+ maxZ = z2;
+ }
+ this.min.set(minX, minY, minZ);
+ this.max.set(maxX, maxY, maxZ);
+ return this;
+ }
+ setFromBufferAttribute(attribute) {
+ let minX = Infinity;
+ let minY = Infinity;
+ let minZ = Infinity;
+ let maxX = -Infinity;
+ let maxY = -Infinity;
+ let maxZ = -Infinity;
+ for (let i = 0, l2 = attribute.count; i < l2; i++) {
+ const x = attribute.getX(i);
+ const y2 = attribute.getY(i);
+ const z2 = attribute.getZ(i);
+ if (x < minX)
+ minX = x;
+ if (y2 < minY)
+ minY = y2;
+ if (z2 < minZ)
+ minZ = z2;
+ if (x > maxX)
+ maxX = x;
+ if (y2 > maxY)
+ maxY = y2;
+ if (z2 > maxZ)
+ maxZ = z2;
+ }
+ this.min.set(minX, minY, minZ);
+ this.max.set(maxX, maxY, maxZ);
+ return this;
+ }
+ setFromPoints(points) {
+ this.makeEmpty();
+ for (let i = 0, il = points.length; i < il; i++) {
+ this.expandByPoint(points[i]);
+ }
+ return this;
+ }
+ setFromCenterAndSize(center, size2) {
+ const halfSize = _vector$b.copy(size2).multiplyScalar(0.5);
+ this.min.copy(center).sub(halfSize);
+ this.max.copy(center).add(halfSize);
+ return this;
+ }
+ setFromObject(object, precise = false) {
+ this.makeEmpty();
+ return this.expandByObject(object, precise);
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+ copy(box) {
+ this.min.copy(box.min);
+ this.max.copy(box.max);
+ return this;
+ }
+ makeEmpty() {
+ this.min.x = this.min.y = this.min.z = Infinity;
+ this.max.x = this.max.y = this.max.z = -Infinity;
+ return this;
+ }
+ isEmpty() {
+ return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;
+ }
+ getCenter(target) {
+ return this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);
+ }
+ getSize(target) {
+ return this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);
+ }
+ expandByPoint(point) {
+ this.min.min(point);
+ this.max.max(point);
+ return this;
+ }
+ expandByVector(vector) {
+ this.min.sub(vector);
+ this.max.add(vector);
+ return this;
+ }
+ expandByScalar(scalar) {
+ this.min.addScalar(-scalar);
+ this.max.addScalar(scalar);
+ return this;
+ }
+ expandByObject(object, precise = false) {
+ object.updateWorldMatrix(false, false);
+ const geometry = object.geometry;
+ if (geometry !== void 0) {
+ if (precise && geometry.attributes != void 0 && geometry.attributes.position !== void 0) {
+ const position = geometry.attributes.position;
+ for (let i = 0, l2 = position.count; i < l2; i++) {
+ _vector$b.fromBufferAttribute(position, i).applyMatrix4(object.matrixWorld);
+ this.expandByPoint(_vector$b);
+ }
+ } else {
+ if (geometry.boundingBox === null) {
+ geometry.computeBoundingBox();
+ }
+ _box$3.copy(geometry.boundingBox);
+ _box$3.applyMatrix4(object.matrixWorld);
+ this.union(_box$3);
+ }
+ }
+ const children = object.children;
+ for (let i = 0, l2 = children.length; i < l2; i++) {
+ this.expandByObject(children[i], precise);
+ }
+ return this;
+ }
+ containsPoint(point) {
+ return point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z ? false : true;
+ }
+ containsBox(box) {
+ return this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;
+ }
+ getParameter(point, target) {
+ return target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y), (point.z - this.min.z) / (this.max.z - this.min.z));
+ }
+ intersectsBox(box) {
+ return box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true;
+ }
+ intersectsSphere(sphere) {
+ this.clampPoint(sphere.center, _vector$b);
+ return _vector$b.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;
+ }
+ intersectsPlane(plane) {
+ let min, max2;
+ if (plane.normal.x > 0) {
+ min = plane.normal.x * this.min.x;
+ max2 = plane.normal.x * this.max.x;
+ } else {
+ min = plane.normal.x * this.max.x;
+ max2 = plane.normal.x * this.min.x;
+ }
+ if (plane.normal.y > 0) {
+ min += plane.normal.y * this.min.y;
+ max2 += plane.normal.y * this.max.y;
+ } else {
+ min += plane.normal.y * this.max.y;
+ max2 += plane.normal.y * this.min.y;
+ }
+ if (plane.normal.z > 0) {
+ min += plane.normal.z * this.min.z;
+ max2 += plane.normal.z * this.max.z;
+ } else {
+ min += plane.normal.z * this.max.z;
+ max2 += plane.normal.z * this.min.z;
+ }
+ return min <= -plane.constant && max2 >= -plane.constant;
+ }
+ intersectsTriangle(triangle) {
+ if (this.isEmpty()) {
+ return false;
+ }
+ this.getCenter(_center);
+ _extents.subVectors(this.max, _center);
+ _v0$2.subVectors(triangle.a, _center);
+ _v1$7.subVectors(triangle.b, _center);
+ _v2$3.subVectors(triangle.c, _center);
+ _f0.subVectors(_v1$7, _v0$2);
+ _f1.subVectors(_v2$3, _v1$7);
+ _f2.subVectors(_v0$2, _v2$3);
+ let axes = [
+ 0,
+ -_f0.z,
+ _f0.y,
+ 0,
+ -_f1.z,
+ _f1.y,
+ 0,
+ -_f2.z,
+ _f2.y,
+ _f0.z,
+ 0,
+ -_f0.x,
+ _f1.z,
+ 0,
+ -_f1.x,
+ _f2.z,
+ 0,
+ -_f2.x,
+ -_f0.y,
+ _f0.x,
+ 0,
+ -_f1.y,
+ _f1.x,
+ 0,
+ -_f2.y,
+ _f2.x,
+ 0
+ ];
+ if (!satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents)) {
+ return false;
+ }
+ axes = [1, 0, 0, 0, 1, 0, 0, 0, 1];
+ if (!satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents)) {
+ return false;
+ }
+ _triangleNormal.crossVectors(_f0, _f1);
+ axes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];
+ return satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents);
+ }
+ clampPoint(point, target) {
+ return target.copy(point).clamp(this.min, this.max);
+ }
+ distanceToPoint(point) {
+ const clampedPoint = _vector$b.copy(point).clamp(this.min, this.max);
+ return clampedPoint.sub(point).length();
+ }
+ getBoundingSphere(target) {
+ this.getCenter(target.center);
+ target.radius = this.getSize(_vector$b).length() * 0.5;
+ return target;
+ }
+ intersect(box) {
+ this.min.max(box.min);
+ this.max.min(box.max);
+ if (this.isEmpty())
+ this.makeEmpty();
+ return this;
+ }
+ union(box) {
+ this.min.min(box.min);
+ this.max.max(box.max);
+ return this;
+ }
+ applyMatrix4(matrix) {
+ if (this.isEmpty())
+ return this;
+ _points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix);
+ _points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix);
+ _points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix);
+ _points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix);
+ _points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix);
+ _points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix);
+ _points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix);
+ _points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix);
+ this.setFromPoints(_points);
+ return this;
+ }
+ translate(offset) {
+ this.min.add(offset);
+ this.max.add(offset);
+ return this;
+ }
+ equals(box) {
+ return box.min.equals(this.min) && box.max.equals(this.max);
+ }
+}
+Box3.prototype.isBox3 = true;
+const _points = [
+ /* @__PURE__ */ new Vector3(),
+ /* @__PURE__ */ new Vector3(),
+ /* @__PURE__ */ new Vector3(),
+ /* @__PURE__ */ new Vector3(),
+ /* @__PURE__ */ new Vector3(),
+ /* @__PURE__ */ new Vector3(),
+ /* @__PURE__ */ new Vector3(),
+ /* @__PURE__ */ new Vector3()
+];
+const _vector$b = /* @__PURE__ */ new Vector3();
+const _box$3 = /* @__PURE__ */ new Box3();
+const _v0$2 = /* @__PURE__ */ new Vector3();
+const _v1$7 = /* @__PURE__ */ new Vector3();
+const _v2$3 = /* @__PURE__ */ new Vector3();
+const _f0 = /* @__PURE__ */ new Vector3();
+const _f1 = /* @__PURE__ */ new Vector3();
+const _f2 = /* @__PURE__ */ new Vector3();
+const _center = /* @__PURE__ */ new Vector3();
+const _extents = /* @__PURE__ */ new Vector3();
+const _triangleNormal = /* @__PURE__ */ new Vector3();
+const _testAxis = /* @__PURE__ */ new Vector3();
+function satForAxes(axes, v0, v1, v2, extents) {
+ for (let i = 0, j2 = axes.length - 3; i <= j2; i += 3) {
+ _testAxis.fromArray(axes, i);
+ const r2 = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z);
+ const p0 = v0.dot(_testAxis);
+ const p1 = v1.dot(_testAxis);
+ const p2 = v2.dot(_testAxis);
+ if (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r2) {
+ return false;
+ }
+ }
+ return true;
+}
+const _box$2 = /* @__PURE__ */ new Box3();
+const _v1$6 = /* @__PURE__ */ new Vector3();
+const _toFarthestPoint = /* @__PURE__ */ new Vector3();
+const _toPoint = /* @__PURE__ */ new Vector3();
+class Sphere {
+ constructor(center = new Vector3(), radius = -1) {
+ this.center = center;
+ this.radius = radius;
+ }
+ set(center, radius) {
+ this.center.copy(center);
+ this.radius = radius;
+ return this;
+ }
+ setFromPoints(points, optionalCenter) {
+ const center = this.center;
+ if (optionalCenter !== void 0) {
+ center.copy(optionalCenter);
+ } else {
+ _box$2.setFromPoints(points).getCenter(center);
+ }
+ let maxRadiusSq = 0;
+ for (let i = 0, il = points.length; i < il; i++) {
+ maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i]));
+ }
+ this.radius = Math.sqrt(maxRadiusSq);
+ return this;
+ }
+ copy(sphere) {
+ this.center.copy(sphere.center);
+ this.radius = sphere.radius;
+ return this;
+ }
+ isEmpty() {
+ return this.radius < 0;
+ }
+ makeEmpty() {
+ this.center.set(0, 0, 0);
+ this.radius = -1;
+ return this;
+ }
+ containsPoint(point) {
+ return point.distanceToSquared(this.center) <= this.radius * this.radius;
+ }
+ distanceToPoint(point) {
+ return point.distanceTo(this.center) - this.radius;
+ }
+ intersectsSphere(sphere) {
+ const radiusSum = this.radius + sphere.radius;
+ return sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;
+ }
+ intersectsBox(box) {
+ return box.intersectsSphere(this);
+ }
+ intersectsPlane(plane) {
+ return Math.abs(plane.distanceToPoint(this.center)) <= this.radius;
+ }
+ clampPoint(point, target) {
+ const deltaLengthSq = this.center.distanceToSquared(point);
+ target.copy(point);
+ if (deltaLengthSq > this.radius * this.radius) {
+ target.sub(this.center).normalize();
+ target.multiplyScalar(this.radius).add(this.center);
+ }
+ return target;
+ }
+ getBoundingBox(target) {
+ if (this.isEmpty()) {
+ target.makeEmpty();
+ return target;
+ }
+ target.set(this.center, this.center);
+ target.expandByScalar(this.radius);
+ return target;
+ }
+ applyMatrix4(matrix) {
+ this.center.applyMatrix4(matrix);
+ this.radius = this.radius * matrix.getMaxScaleOnAxis();
+ return this;
+ }
+ translate(offset) {
+ this.center.add(offset);
+ return this;
+ }
+ expandByPoint(point) {
+ _toPoint.subVectors(point, this.center);
+ const lengthSq = _toPoint.lengthSq();
+ if (lengthSq > this.radius * this.radius) {
+ const length = Math.sqrt(lengthSq);
+ const missingRadiusHalf = (length - this.radius) * 0.5;
+ this.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length));
+ this.radius += missingRadiusHalf;
+ }
+ return this;
+ }
+ union(sphere) {
+ if (this.center.equals(sphere.center) === true) {
+ _toFarthestPoint.set(0, 0, 1).multiplyScalar(sphere.radius);
+ } else {
+ _toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius);
+ }
+ this.expandByPoint(_v1$6.copy(sphere.center).add(_toFarthestPoint));
+ this.expandByPoint(_v1$6.copy(sphere.center).sub(_toFarthestPoint));
+ return this;
+ }
+ equals(sphere) {
+ return sphere.center.equals(this.center) && sphere.radius === this.radius;
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+}
+const _vector$a = /* @__PURE__ */ new Vector3();
+const _segCenter = /* @__PURE__ */ new Vector3();
+const _segDir = /* @__PURE__ */ new Vector3();
+const _diff = /* @__PURE__ */ new Vector3();
+const _edge1 = /* @__PURE__ */ new Vector3();
+const _edge2 = /* @__PURE__ */ new Vector3();
+const _normal$1 = /* @__PURE__ */ new Vector3();
+class Ray {
+ constructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {
+ this.origin = origin;
+ this.direction = direction;
+ }
+ set(origin, direction) {
+ this.origin.copy(origin);
+ this.direction.copy(direction);
+ return this;
+ }
+ copy(ray) {
+ this.origin.copy(ray.origin);
+ this.direction.copy(ray.direction);
+ return this;
+ }
+ at(t2, target) {
+ return target.copy(this.direction).multiplyScalar(t2).add(this.origin);
+ }
+ lookAt(v2) {
+ this.direction.copy(v2).sub(this.origin).normalize();
+ return this;
+ }
+ recast(t2) {
+ this.origin.copy(this.at(t2, _vector$a));
+ return this;
+ }
+ closestPointToPoint(point, target) {
+ target.subVectors(point, this.origin);
+ const directionDistance = target.dot(this.direction);
+ if (directionDistance < 0) {
+ return target.copy(this.origin);
+ }
+ return target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);
+ }
+ distanceToPoint(point) {
+ return Math.sqrt(this.distanceSqToPoint(point));
+ }
+ distanceSqToPoint(point) {
+ const directionDistance = _vector$a.subVectors(point, this.origin).dot(this.direction);
+ if (directionDistance < 0) {
+ return this.origin.distanceToSquared(point);
+ }
+ _vector$a.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);
+ return _vector$a.distanceToSquared(point);
+ }
+ distanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) {
+ _segCenter.copy(v0).add(v1).multiplyScalar(0.5);
+ _segDir.copy(v1).sub(v0).normalize();
+ _diff.copy(this.origin).sub(_segCenter);
+ const segExtent = v0.distanceTo(v1) * 0.5;
+ const a01 = -this.direction.dot(_segDir);
+ const b0 = _diff.dot(this.direction);
+ const b1 = -_diff.dot(_segDir);
+ const c2 = _diff.lengthSq();
+ const det = Math.abs(1 - a01 * a01);
+ let s0, s1, sqrDist, extDet;
+ if (det > 0) {
+ s0 = a01 * b1 - b0;
+ s1 = a01 * b0 - b1;
+ extDet = segExtent * det;
+ if (s0 >= 0) {
+ if (s1 >= -extDet) {
+ if (s1 <= extDet) {
+ const invDet = 1 / det;
+ s0 *= invDet;
+ s1 *= invDet;
+ sqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c2;
+ } else {
+ s1 = segExtent;
+ s0 = Math.max(0, -(a01 * s1 + b0));
+ sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c2;
+ }
+ } else {
+ s1 = -segExtent;
+ s0 = Math.max(0, -(a01 * s1 + b0));
+ sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c2;
+ }
+ } else {
+ if (s1 <= -extDet) {
+ s0 = Math.max(0, -(-a01 * segExtent + b0));
+ s1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);
+ sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c2;
+ } else if (s1 <= extDet) {
+ s0 = 0;
+ s1 = Math.min(Math.max(-segExtent, -b1), segExtent);
+ sqrDist = s1 * (s1 + 2 * b1) + c2;
+ } else {
+ s0 = Math.max(0, -(a01 * segExtent + b0));
+ s1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);
+ sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c2;
+ }
+ }
+ } else {
+ s1 = a01 > 0 ? -segExtent : segExtent;
+ s0 = Math.max(0, -(a01 * s1 + b0));
+ sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c2;
+ }
+ if (optionalPointOnRay) {
+ optionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);
+ }
+ if (optionalPointOnSegment) {
+ optionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);
+ }
+ return sqrDist;
+ }
+ intersectSphere(sphere, target) {
+ _vector$a.subVectors(sphere.center, this.origin);
+ const tca = _vector$a.dot(this.direction);
+ const d2 = _vector$a.dot(_vector$a) - tca * tca;
+ const radius2 = sphere.radius * sphere.radius;
+ if (d2 > radius2)
+ return null;
+ const thc = Math.sqrt(radius2 - d2);
+ const t0 = tca - thc;
+ const t1 = tca + thc;
+ if (t0 < 0 && t1 < 0)
+ return null;
+ if (t0 < 0)
+ return this.at(t1, target);
+ return this.at(t0, target);
+ }
+ intersectsSphere(sphere) {
+ return this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;
+ }
+ distanceToPlane(plane) {
+ const denominator = plane.normal.dot(this.direction);
+ if (denominator === 0) {
+ if (plane.distanceToPoint(this.origin) === 0) {
+ return 0;
+ }
+ return null;
+ }
+ const t2 = -(this.origin.dot(plane.normal) + plane.constant) / denominator;
+ return t2 >= 0 ? t2 : null;
+ }
+ intersectPlane(plane, target) {
+ const t2 = this.distanceToPlane(plane);
+ if (t2 === null) {
+ return null;
+ }
+ return this.at(t2, target);
+ }
+ intersectsPlane(plane) {
+ const distToPoint = plane.distanceToPoint(this.origin);
+ if (distToPoint === 0) {
+ return true;
+ }
+ const denominator = plane.normal.dot(this.direction);
+ if (denominator * distToPoint < 0) {
+ return true;
+ }
+ return false;
+ }
+ intersectBox(box, target) {
+ let tmin, tmax, tymin, tymax, tzmin, tzmax;
+ const invdirx = 1 / this.direction.x, invdiry = 1 / this.direction.y, invdirz = 1 / this.direction.z;
+ const origin = this.origin;
+ if (invdirx >= 0) {
+ tmin = (box.min.x - origin.x) * invdirx;
+ tmax = (box.max.x - origin.x) * invdirx;
+ } else {
+ tmin = (box.max.x - origin.x) * invdirx;
+ tmax = (box.min.x - origin.x) * invdirx;
+ }
+ if (invdiry >= 0) {
+ tymin = (box.min.y - origin.y) * invdiry;
+ tymax = (box.max.y - origin.y) * invdiry;
+ } else {
+ tymin = (box.max.y - origin.y) * invdiry;
+ tymax = (box.min.y - origin.y) * invdiry;
+ }
+ if (tmin > tymax || tymin > tmax)
+ return null;
+ if (tymin > tmin || tmin !== tmin)
+ tmin = tymin;
+ if (tymax < tmax || tmax !== tmax)
+ tmax = tymax;
+ if (invdirz >= 0) {
+ tzmin = (box.min.z - origin.z) * invdirz;
+ tzmax = (box.max.z - origin.z) * invdirz;
+ } else {
+ tzmin = (box.max.z - origin.z) * invdirz;
+ tzmax = (box.min.z - origin.z) * invdirz;
+ }
+ if (tmin > tzmax || tzmin > tmax)
+ return null;
+ if (tzmin > tmin || tmin !== tmin)
+ tmin = tzmin;
+ if (tzmax < tmax || tmax !== tmax)
+ tmax = tzmax;
+ if (tmax < 0)
+ return null;
+ return this.at(tmin >= 0 ? tmin : tmax, target);
+ }
+ intersectsBox(box) {
+ return this.intersectBox(box, _vector$a) !== null;
+ }
+ intersectTriangle(a2, b3, c2, backfaceCulling, target) {
+ _edge1.subVectors(b3, a2);
+ _edge2.subVectors(c2, a2);
+ _normal$1.crossVectors(_edge1, _edge2);
+ let DdN = this.direction.dot(_normal$1);
+ let sign2;
+ if (DdN > 0) {
+ if (backfaceCulling)
+ return null;
+ sign2 = 1;
+ } else if (DdN < 0) {
+ sign2 = -1;
+ DdN = -DdN;
+ } else {
+ return null;
+ }
+ _diff.subVectors(this.origin, a2);
+ const DdQxE2 = sign2 * this.direction.dot(_edge2.crossVectors(_diff, _edge2));
+ if (DdQxE2 < 0) {
+ return null;
+ }
+ const DdE1xQ = sign2 * this.direction.dot(_edge1.cross(_diff));
+ if (DdE1xQ < 0) {
+ return null;
+ }
+ if (DdQxE2 + DdE1xQ > DdN) {
+ return null;
+ }
+ const QdN = -sign2 * _diff.dot(_normal$1);
+ if (QdN < 0) {
+ return null;
+ }
+ return this.at(QdN / DdN, target);
+ }
+ applyMatrix4(matrix4) {
+ this.origin.applyMatrix4(matrix4);
+ this.direction.transformDirection(matrix4);
+ return this;
+ }
+ equals(ray) {
+ return ray.origin.equals(this.origin) && ray.direction.equals(this.direction);
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+}
+class Matrix4 {
+ constructor() {
+ this.elements = [
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1
+ ];
+ if (arguments.length > 0) {
+ console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.");
+ }
+ }
+ set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {
+ const te2 = this.elements;
+ te2[0] = n11;
+ te2[4] = n12;
+ te2[8] = n13;
+ te2[12] = n14;
+ te2[1] = n21;
+ te2[5] = n22;
+ te2[9] = n23;
+ te2[13] = n24;
+ te2[2] = n31;
+ te2[6] = n32;
+ te2[10] = n33;
+ te2[14] = n34;
+ te2[3] = n41;
+ te2[7] = n42;
+ te2[11] = n43;
+ te2[15] = n44;
+ return this;
+ }
+ identity() {
+ this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ return this;
+ }
+ clone() {
+ return new Matrix4().fromArray(this.elements);
+ }
+ copy(m2) {
+ const te2 = this.elements;
+ const me2 = m2.elements;
+ te2[0] = me2[0];
+ te2[1] = me2[1];
+ te2[2] = me2[2];
+ te2[3] = me2[3];
+ te2[4] = me2[4];
+ te2[5] = me2[5];
+ te2[6] = me2[6];
+ te2[7] = me2[7];
+ te2[8] = me2[8];
+ te2[9] = me2[9];
+ te2[10] = me2[10];
+ te2[11] = me2[11];
+ te2[12] = me2[12];
+ te2[13] = me2[13];
+ te2[14] = me2[14];
+ te2[15] = me2[15];
+ return this;
+ }
+ copyPosition(m2) {
+ const te2 = this.elements, me2 = m2.elements;
+ te2[12] = me2[12];
+ te2[13] = me2[13];
+ te2[14] = me2[14];
+ return this;
+ }
+ setFromMatrix3(m2) {
+ const me2 = m2.elements;
+ this.set(me2[0], me2[3], me2[6], 0, me2[1], me2[4], me2[7], 0, me2[2], me2[5], me2[8], 0, 0, 0, 0, 1);
+ return this;
+ }
+ extractBasis(xAxis, yAxis, zAxis) {
+ xAxis.setFromMatrixColumn(this, 0);
+ yAxis.setFromMatrixColumn(this, 1);
+ zAxis.setFromMatrixColumn(this, 2);
+ return this;
+ }
+ makeBasis(xAxis, yAxis, zAxis) {
+ this.set(xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1);
+ return this;
+ }
+ extractRotation(m2) {
+ const te2 = this.elements;
+ const me2 = m2.elements;
+ const scaleX = 1 / _v1$5.setFromMatrixColumn(m2, 0).length();
+ const scaleY = 1 / _v1$5.setFromMatrixColumn(m2, 1).length();
+ const scaleZ = 1 / _v1$5.setFromMatrixColumn(m2, 2).length();
+ te2[0] = me2[0] * scaleX;
+ te2[1] = me2[1] * scaleX;
+ te2[2] = me2[2] * scaleX;
+ te2[3] = 0;
+ te2[4] = me2[4] * scaleY;
+ te2[5] = me2[5] * scaleY;
+ te2[6] = me2[6] * scaleY;
+ te2[7] = 0;
+ te2[8] = me2[8] * scaleZ;
+ te2[9] = me2[9] * scaleZ;
+ te2[10] = me2[10] * scaleZ;
+ te2[11] = 0;
+ te2[12] = 0;
+ te2[13] = 0;
+ te2[14] = 0;
+ te2[15] = 1;
+ return this;
+ }
+ makeRotationFromEuler(euler) {
+ if (!(euler && euler.isEuler)) {
+ console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
+ }
+ const te2 = this.elements;
+ const x = euler.x, y2 = euler.y, z2 = euler.z;
+ const a2 = Math.cos(x), b3 = Math.sin(x);
+ const c2 = Math.cos(y2), d2 = Math.sin(y2);
+ const e2 = Math.cos(z2), f2 = Math.sin(z2);
+ if (euler.order === "XYZ") {
+ const ae = a2 * e2, af = a2 * f2, be = b3 * e2, bf = b3 * f2;
+ te2[0] = c2 * e2;
+ te2[4] = -c2 * f2;
+ te2[8] = d2;
+ te2[1] = af + be * d2;
+ te2[5] = ae - bf * d2;
+ te2[9] = -b3 * c2;
+ te2[2] = bf - ae * d2;
+ te2[6] = be + af * d2;
+ te2[10] = a2 * c2;
+ } else if (euler.order === "YXZ") {
+ const ce2 = c2 * e2, cf = c2 * f2, de2 = d2 * e2, df = d2 * f2;
+ te2[0] = ce2 + df * b3;
+ te2[4] = de2 * b3 - cf;
+ te2[8] = a2 * d2;
+ te2[1] = a2 * f2;
+ te2[5] = a2 * e2;
+ te2[9] = -b3;
+ te2[2] = cf * b3 - de2;
+ te2[6] = df + ce2 * b3;
+ te2[10] = a2 * c2;
+ } else if (euler.order === "ZXY") {
+ const ce2 = c2 * e2, cf = c2 * f2, de2 = d2 * e2, df = d2 * f2;
+ te2[0] = ce2 - df * b3;
+ te2[4] = -a2 * f2;
+ te2[8] = de2 + cf * b3;
+ te2[1] = cf + de2 * b3;
+ te2[5] = a2 * e2;
+ te2[9] = df - ce2 * b3;
+ te2[2] = -a2 * d2;
+ te2[6] = b3;
+ te2[10] = a2 * c2;
+ } else if (euler.order === "ZYX") {
+ const ae = a2 * e2, af = a2 * f2, be = b3 * e2, bf = b3 * f2;
+ te2[0] = c2 * e2;
+ te2[4] = be * d2 - af;
+ te2[8] = ae * d2 + bf;
+ te2[1] = c2 * f2;
+ te2[5] = bf * d2 + ae;
+ te2[9] = af * d2 - be;
+ te2[2] = -d2;
+ te2[6] = b3 * c2;
+ te2[10] = a2 * c2;
+ } else if (euler.order === "YZX") {
+ const ac = a2 * c2, ad = a2 * d2, bc = b3 * c2, bd = b3 * d2;
+ te2[0] = c2 * e2;
+ te2[4] = bd - ac * f2;
+ te2[8] = bc * f2 + ad;
+ te2[1] = f2;
+ te2[5] = a2 * e2;
+ te2[9] = -b3 * e2;
+ te2[2] = -d2 * e2;
+ te2[6] = ad * f2 + bc;
+ te2[10] = ac - bd * f2;
+ } else if (euler.order === "XZY") {
+ const ac = a2 * c2, ad = a2 * d2, bc = b3 * c2, bd = b3 * d2;
+ te2[0] = c2 * e2;
+ te2[4] = -f2;
+ te2[8] = d2 * e2;
+ te2[1] = ac * f2 + bd;
+ te2[5] = a2 * e2;
+ te2[9] = ad * f2 - bc;
+ te2[2] = bc * f2 - ad;
+ te2[6] = b3 * e2;
+ te2[10] = bd * f2 + ac;
+ }
+ te2[3] = 0;
+ te2[7] = 0;
+ te2[11] = 0;
+ te2[12] = 0;
+ te2[13] = 0;
+ te2[14] = 0;
+ te2[15] = 1;
+ return this;
+ }
+ makeRotationFromQuaternion(q) {
+ return this.compose(_zero, q, _one);
+ }
+ lookAt(eye, target, up) {
+ const te2 = this.elements;
+ _z.subVectors(eye, target);
+ if (_z.lengthSq() === 0) {
+ _z.z = 1;
+ }
+ _z.normalize();
+ _x.crossVectors(up, _z);
+ if (_x.lengthSq() === 0) {
+ if (Math.abs(up.z) === 1) {
+ _z.x += 1e-4;
+ } else {
+ _z.z += 1e-4;
+ }
+ _z.normalize();
+ _x.crossVectors(up, _z);
+ }
+ _x.normalize();
+ _y.crossVectors(_z, _x);
+ te2[0] = _x.x;
+ te2[4] = _y.x;
+ te2[8] = _z.x;
+ te2[1] = _x.y;
+ te2[5] = _y.y;
+ te2[9] = _z.y;
+ te2[2] = _x.z;
+ te2[6] = _y.z;
+ te2[10] = _z.z;
+ return this;
+ }
+ multiply(m2, n2) {
+ if (n2 !== void 0) {
+ console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.");
+ return this.multiplyMatrices(m2, n2);
+ }
+ return this.multiplyMatrices(this, m2);
+ }
+ premultiply(m2) {
+ return this.multiplyMatrices(m2, this);
+ }
+ multiplyMatrices(a2, b3) {
+ const ae = a2.elements;
+ const be = b3.elements;
+ const te2 = this.elements;
+ const a11 = ae[0], a12 = ae[4], a13 = ae[8], a14 = ae[12];
+ const a21 = ae[1], a22 = ae[5], a23 = ae[9], a24 = ae[13];
+ const a31 = ae[2], a32 = ae[6], a33 = ae[10], a34 = ae[14];
+ const a41 = ae[3], a42 = ae[7], a43 = ae[11], a44 = ae[15];
+ const b11 = be[0], b12 = be[4], b13 = be[8], b14 = be[12];
+ const b21 = be[1], b22 = be[5], b23 = be[9], b24 = be[13];
+ const b31 = be[2], b32 = be[6], b33 = be[10], b34 = be[14];
+ const b41 = be[3], b42 = be[7], b43 = be[11], b44 = be[15];
+ te2[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;
+ te2[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;
+ te2[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;
+ te2[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;
+ te2[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;
+ te2[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;
+ te2[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;
+ te2[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;
+ te2[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;
+ te2[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;
+ te2[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;
+ te2[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;
+ te2[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;
+ te2[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;
+ te2[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;
+ te2[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;
+ return this;
+ }
+ multiplyScalar(s2) {
+ const te2 = this.elements;
+ te2[0] *= s2;
+ te2[4] *= s2;
+ te2[8] *= s2;
+ te2[12] *= s2;
+ te2[1] *= s2;
+ te2[5] *= s2;
+ te2[9] *= s2;
+ te2[13] *= s2;
+ te2[2] *= s2;
+ te2[6] *= s2;
+ te2[10] *= s2;
+ te2[14] *= s2;
+ te2[3] *= s2;
+ te2[7] *= s2;
+ te2[11] *= s2;
+ te2[15] *= s2;
+ return this;
+ }
+ determinant() {
+ const te2 = this.elements;
+ const n11 = te2[0], n12 = te2[4], n13 = te2[8], n14 = te2[12];
+ const n21 = te2[1], n22 = te2[5], n23 = te2[9], n24 = te2[13];
+ const n31 = te2[2], n32 = te2[6], n33 = te2[10], n34 = te2[14];
+ const n41 = te2[3], n42 = te2[7], n43 = te2[11], n44 = te2[15];
+ return n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);
+ }
+ transpose() {
+ const te2 = this.elements;
+ let tmp2;
+ tmp2 = te2[1];
+ te2[1] = te2[4];
+ te2[4] = tmp2;
+ tmp2 = te2[2];
+ te2[2] = te2[8];
+ te2[8] = tmp2;
+ tmp2 = te2[6];
+ te2[6] = te2[9];
+ te2[9] = tmp2;
+ tmp2 = te2[3];
+ te2[3] = te2[12];
+ te2[12] = tmp2;
+ tmp2 = te2[7];
+ te2[7] = te2[13];
+ te2[13] = tmp2;
+ tmp2 = te2[11];
+ te2[11] = te2[14];
+ te2[14] = tmp2;
+ return this;
+ }
+ setPosition(x, y2, z2) {
+ const te2 = this.elements;
+ if (x.isVector3) {
+ te2[12] = x.x;
+ te2[13] = x.y;
+ te2[14] = x.z;
+ } else {
+ te2[12] = x;
+ te2[13] = y2;
+ te2[14] = z2;
+ }
+ return this;
+ }
+ invert() {
+ const te2 = this.elements, n11 = te2[0], n21 = te2[1], n31 = te2[2], n41 = te2[3], n12 = te2[4], n22 = te2[5], n32 = te2[6], n42 = te2[7], n13 = te2[8], n23 = te2[9], n33 = te2[10], n43 = te2[11], n14 = te2[12], n24 = te2[13], n34 = te2[14], n44 = te2[15], t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;
+ const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;
+ if (det === 0)
+ return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ const detInv = 1 / det;
+ te2[0] = t11 * detInv;
+ te2[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;
+ te2[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;
+ te2[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;
+ te2[4] = t12 * detInv;
+ te2[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;
+ te2[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;
+ te2[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;
+ te2[8] = t13 * detInv;
+ te2[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;
+ te2[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;
+ te2[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;
+ te2[12] = t14 * detInv;
+ te2[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;
+ te2[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;
+ te2[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;
+ return this;
+ }
+ scale(v2) {
+ const te2 = this.elements;
+ const x = v2.x, y2 = v2.y, z2 = v2.z;
+ te2[0] *= x;
+ te2[4] *= y2;
+ te2[8] *= z2;
+ te2[1] *= x;
+ te2[5] *= y2;
+ te2[9] *= z2;
+ te2[2] *= x;
+ te2[6] *= y2;
+ te2[10] *= z2;
+ te2[3] *= x;
+ te2[7] *= y2;
+ te2[11] *= z2;
+ return this;
+ }
+ getMaxScaleOnAxis() {
+ const te2 = this.elements;
+ const scaleXSq = te2[0] * te2[0] + te2[1] * te2[1] + te2[2] * te2[2];
+ const scaleYSq = te2[4] * te2[4] + te2[5] * te2[5] + te2[6] * te2[6];
+ const scaleZSq = te2[8] * te2[8] + te2[9] * te2[9] + te2[10] * te2[10];
+ return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));
+ }
+ makeTranslation(x, y2, z2) {
+ this.set(1, 0, 0, x, 0, 1, 0, y2, 0, 0, 1, z2, 0, 0, 0, 1);
+ return this;
+ }
+ makeRotationX(theta) {
+ const c2 = Math.cos(theta), s2 = Math.sin(theta);
+ this.set(1, 0, 0, 0, 0, c2, -s2, 0, 0, s2, c2, 0, 0, 0, 0, 1);
+ return this;
+ }
+ makeRotationY(theta) {
+ const c2 = Math.cos(theta), s2 = Math.sin(theta);
+ this.set(c2, 0, s2, 0, 0, 1, 0, 0, -s2, 0, c2, 0, 0, 0, 0, 1);
+ return this;
+ }
+ makeRotationZ(theta) {
+ const c2 = Math.cos(theta), s2 = Math.sin(theta);
+ this.set(c2, -s2, 0, 0, s2, c2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ return this;
+ }
+ makeRotationAxis(axis, angle) {
+ const c2 = Math.cos(angle);
+ const s2 = Math.sin(angle);
+ const t2 = 1 - c2;
+ const x = axis.x, y2 = axis.y, z2 = axis.z;
+ const tx = t2 * x, ty = t2 * y2;
+ this.set(tx * x + c2, tx * y2 - s2 * z2, tx * z2 + s2 * y2, 0, tx * y2 + s2 * z2, ty * y2 + c2, ty * z2 - s2 * x, 0, tx * z2 - s2 * y2, ty * z2 + s2 * x, t2 * z2 * z2 + c2, 0, 0, 0, 0, 1);
+ return this;
+ }
+ makeScale(x, y2, z2) {
+ this.set(x, 0, 0, 0, 0, y2, 0, 0, 0, 0, z2, 0, 0, 0, 0, 1);
+ return this;
+ }
+ makeShear(xy, xz, yx, yz, zx, zy) {
+ this.set(1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1);
+ return this;
+ }
+ compose(position, quaternion, scale) {
+ const te2 = this.elements;
+ const x = quaternion._x, y2 = quaternion._y, z2 = quaternion._z, w2 = quaternion._w;
+ const x2 = x + x, y22 = y2 + y2, z22 = z2 + z2;
+ const xx = x * x2, xy = x * y22, xz = x * z22;
+ const yy = y2 * y22, yz = y2 * z22, zz = z2 * z22;
+ const wx = w2 * x2, wy = w2 * y22, wz = w2 * z22;
+ const sx = scale.x, sy = scale.y, sz = scale.z;
+ te2[0] = (1 - (yy + zz)) * sx;
+ te2[1] = (xy + wz) * sx;
+ te2[2] = (xz - wy) * sx;
+ te2[3] = 0;
+ te2[4] = (xy - wz) * sy;
+ te2[5] = (1 - (xx + zz)) * sy;
+ te2[6] = (yz + wx) * sy;
+ te2[7] = 0;
+ te2[8] = (xz + wy) * sz;
+ te2[9] = (yz - wx) * sz;
+ te2[10] = (1 - (xx + yy)) * sz;
+ te2[11] = 0;
+ te2[12] = position.x;
+ te2[13] = position.y;
+ te2[14] = position.z;
+ te2[15] = 1;
+ return this;
+ }
+ decompose(position, quaternion, scale) {
+ const te2 = this.elements;
+ let sx = _v1$5.set(te2[0], te2[1], te2[2]).length();
+ const sy = _v1$5.set(te2[4], te2[5], te2[6]).length();
+ const sz = _v1$5.set(te2[8], te2[9], te2[10]).length();
+ const det = this.determinant();
+ if (det < 0)
+ sx = -sx;
+ position.x = te2[12];
+ position.y = te2[13];
+ position.z = te2[14];
+ _m1$2.copy(this);
+ const invSX = 1 / sx;
+ const invSY = 1 / sy;
+ const invSZ = 1 / sz;
+ _m1$2.elements[0] *= invSX;
+ _m1$2.elements[1] *= invSX;
+ _m1$2.elements[2] *= invSX;
+ _m1$2.elements[4] *= invSY;
+ _m1$2.elements[5] *= invSY;
+ _m1$2.elements[6] *= invSY;
+ _m1$2.elements[8] *= invSZ;
+ _m1$2.elements[9] *= invSZ;
+ _m1$2.elements[10] *= invSZ;
+ quaternion.setFromRotationMatrix(_m1$2);
+ scale.x = sx;
+ scale.y = sy;
+ scale.z = sz;
+ return this;
+ }
+ makePerspective(left, right, top, bottom, near, far) {
+ if (far === void 0) {
+ console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");
+ }
+ const te2 = this.elements;
+ const x = 2 * near / (right - left);
+ const y2 = 2 * near / (top - bottom);
+ const a2 = (right + left) / (right - left);
+ const b3 = (top + bottom) / (top - bottom);
+ const c2 = -(far + near) / (far - near);
+ const d2 = -2 * far * near / (far - near);
+ te2[0] = x;
+ te2[4] = 0;
+ te2[8] = a2;
+ te2[12] = 0;
+ te2[1] = 0;
+ te2[5] = y2;
+ te2[9] = b3;
+ te2[13] = 0;
+ te2[2] = 0;
+ te2[6] = 0;
+ te2[10] = c2;
+ te2[14] = d2;
+ te2[3] = 0;
+ te2[7] = 0;
+ te2[11] = -1;
+ te2[15] = 0;
+ return this;
+ }
+ makeOrthographic(left, right, top, bottom, near, far) {
+ const te2 = this.elements;
+ const w2 = 1 / (right - left);
+ const h2 = 1 / (top - bottom);
+ const p2 = 1 / (far - near);
+ const x = (right + left) * w2;
+ const y2 = (top + bottom) * h2;
+ const z2 = (far + near) * p2;
+ te2[0] = 2 * w2;
+ te2[4] = 0;
+ te2[8] = 0;
+ te2[12] = -x;
+ te2[1] = 0;
+ te2[5] = 2 * h2;
+ te2[9] = 0;
+ te2[13] = -y2;
+ te2[2] = 0;
+ te2[6] = 0;
+ te2[10] = -2 * p2;
+ te2[14] = -z2;
+ te2[3] = 0;
+ te2[7] = 0;
+ te2[11] = 0;
+ te2[15] = 1;
+ return this;
+ }
+ equals(matrix) {
+ const te2 = this.elements;
+ const me2 = matrix.elements;
+ for (let i = 0; i < 16; i++) {
+ if (te2[i] !== me2[i])
+ return false;
+ }
+ return true;
+ }
+ fromArray(array, offset = 0) {
+ for (let i = 0; i < 16; i++) {
+ this.elements[i] = array[i + offset];
+ }
+ return this;
+ }
+ toArray(array = [], offset = 0) {
+ const te2 = this.elements;
+ array[offset] = te2[0];
+ array[offset + 1] = te2[1];
+ array[offset + 2] = te2[2];
+ array[offset + 3] = te2[3];
+ array[offset + 4] = te2[4];
+ array[offset + 5] = te2[5];
+ array[offset + 6] = te2[6];
+ array[offset + 7] = te2[7];
+ array[offset + 8] = te2[8];
+ array[offset + 9] = te2[9];
+ array[offset + 10] = te2[10];
+ array[offset + 11] = te2[11];
+ array[offset + 12] = te2[12];
+ array[offset + 13] = te2[13];
+ array[offset + 14] = te2[14];
+ array[offset + 15] = te2[15];
+ return array;
+ }
+}
+Matrix4.prototype.isMatrix4 = true;
+const _v1$5 = /* @__PURE__ */ new Vector3();
+const _m1$2 = /* @__PURE__ */ new Matrix4();
+const _zero = /* @__PURE__ */ new Vector3(0, 0, 0);
+const _one = /* @__PURE__ */ new Vector3(1, 1, 1);
+const _x = /* @__PURE__ */ new Vector3();
+const _y = /* @__PURE__ */ new Vector3();
+const _z = /* @__PURE__ */ new Vector3();
+const _matrix$1 = /* @__PURE__ */ new Matrix4();
+const _quaternion$3 = /* @__PURE__ */ new Quaternion();
+class Euler {
+ constructor(x = 0, y2 = 0, z2 = 0, order = Euler.DefaultOrder) {
+ this._x = x;
+ this._y = y2;
+ this._z = z2;
+ this._order = order;
+ }
+ get x() {
+ return this._x;
+ }
+ set x(value) {
+ this._x = value;
+ this._onChangeCallback();
+ }
+ get y() {
+ return this._y;
+ }
+ set y(value) {
+ this._y = value;
+ this._onChangeCallback();
+ }
+ get z() {
+ return this._z;
+ }
+ set z(value) {
+ this._z = value;
+ this._onChangeCallback();
+ }
+ get order() {
+ return this._order;
+ }
+ set order(value) {
+ this._order = value;
+ this._onChangeCallback();
+ }
+ set(x, y2, z2, order = this._order) {
+ this._x = x;
+ this._y = y2;
+ this._z = z2;
+ this._order = order;
+ this._onChangeCallback();
+ return this;
+ }
+ clone() {
+ return new this.constructor(this._x, this._y, this._z, this._order);
+ }
+ copy(euler) {
+ this._x = euler._x;
+ this._y = euler._y;
+ this._z = euler._z;
+ this._order = euler._order;
+ this._onChangeCallback();
+ return this;
+ }
+ setFromRotationMatrix(m2, order = this._order, update = true) {
+ const te2 = m2.elements;
+ const m11 = te2[0], m12 = te2[4], m13 = te2[8];
+ const m21 = te2[1], m22 = te2[5], m23 = te2[9];
+ const m31 = te2[2], m32 = te2[6], m33 = te2[10];
+ switch (order) {
+ case "XYZ":
+ this._y = Math.asin(clamp(m13, -1, 1));
+ if (Math.abs(m13) < 0.9999999) {
+ this._x = Math.atan2(-m23, m33);
+ this._z = Math.atan2(-m12, m11);
+ } else {
+ this._x = Math.atan2(m32, m22);
+ this._z = 0;
+ }
+ break;
+ case "YXZ":
+ this._x = Math.asin(-clamp(m23, -1, 1));
+ if (Math.abs(m23) < 0.9999999) {
+ this._y = Math.atan2(m13, m33);
+ this._z = Math.atan2(m21, m22);
+ } else {
+ this._y = Math.atan2(-m31, m11);
+ this._z = 0;
+ }
+ break;
+ case "ZXY":
+ this._x = Math.asin(clamp(m32, -1, 1));
+ if (Math.abs(m32) < 0.9999999) {
+ this._y = Math.atan2(-m31, m33);
+ this._z = Math.atan2(-m12, m22);
+ } else {
+ this._y = 0;
+ this._z = Math.atan2(m21, m11);
+ }
+ break;
+ case "ZYX":
+ this._y = Math.asin(-clamp(m31, -1, 1));
+ if (Math.abs(m31) < 0.9999999) {
+ this._x = Math.atan2(m32, m33);
+ this._z = Math.atan2(m21, m11);
+ } else {
+ this._x = 0;
+ this._z = Math.atan2(-m12, m22);
+ }
+ break;
+ case "YZX":
+ this._z = Math.asin(clamp(m21, -1, 1));
+ if (Math.abs(m21) < 0.9999999) {
+ this._x = Math.atan2(-m23, m22);
+ this._y = Math.atan2(-m31, m11);
+ } else {
+ this._x = 0;
+ this._y = Math.atan2(m13, m33);
+ }
+ break;
+ case "XZY":
+ this._z = Math.asin(-clamp(m12, -1, 1));
+ if (Math.abs(m12) < 0.9999999) {
+ this._x = Math.atan2(m32, m22);
+ this._y = Math.atan2(m13, m11);
+ } else {
+ this._x = Math.atan2(-m23, m33);
+ this._y = 0;
+ }
+ break;
+ default:
+ console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + order);
+ }
+ this._order = order;
+ if (update === true)
+ this._onChangeCallback();
+ return this;
+ }
+ setFromQuaternion(q, order, update) {
+ _matrix$1.makeRotationFromQuaternion(q);
+ return this.setFromRotationMatrix(_matrix$1, order, update);
+ }
+ setFromVector3(v2, order = this._order) {
+ return this.set(v2.x, v2.y, v2.z, order);
+ }
+ reorder(newOrder) {
+ _quaternion$3.setFromEuler(this);
+ return this.setFromQuaternion(_quaternion$3, newOrder);
+ }
+ equals(euler) {
+ return euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;
+ }
+ fromArray(array) {
+ this._x = array[0];
+ this._y = array[1];
+ this._z = array[2];
+ if (array[3] !== void 0)
+ this._order = array[3];
+ this._onChangeCallback();
+ return this;
+ }
+ toArray(array = [], offset = 0) {
+ array[offset] = this._x;
+ array[offset + 1] = this._y;
+ array[offset + 2] = this._z;
+ array[offset + 3] = this._order;
+ return array;
+ }
+ _onChange(callback) {
+ this._onChangeCallback = callback;
+ return this;
+ }
+ _onChangeCallback() {
+ }
+}
+Euler.prototype.isEuler = true;
+Euler.DefaultOrder = "XYZ";
+Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"];
+class Layers {
+ constructor() {
+ this.mask = 1 | 0;
+ }
+ set(channel) {
+ this.mask = (1 << channel | 0) >>> 0;
+ }
+ enable(channel) {
+ this.mask |= 1 << channel | 0;
+ }
+ enableAll() {
+ this.mask = 4294967295 | 0;
+ }
+ toggle(channel) {
+ this.mask ^= 1 << channel | 0;
+ }
+ disable(channel) {
+ this.mask &= ~(1 << channel | 0);
+ }
+ disableAll() {
+ this.mask = 0;
+ }
+ test(layers) {
+ return (this.mask & layers.mask) !== 0;
+ }
+ isEnabled(channel) {
+ return (this.mask & (1 << channel | 0)) !== 0;
+ }
+}
+let _object3DId = 0;
+const _v1$4 = /* @__PURE__ */ new Vector3();
+const _q1 = /* @__PURE__ */ new Quaternion();
+const _m1$1 = /* @__PURE__ */ new Matrix4();
+const _target = /* @__PURE__ */ new Vector3();
+const _position$3 = /* @__PURE__ */ new Vector3();
+const _scale$2 = /* @__PURE__ */ new Vector3();
+const _quaternion$2 = /* @__PURE__ */ new Quaternion();
+const _xAxis = /* @__PURE__ */ new Vector3(1, 0, 0);
+const _yAxis = /* @__PURE__ */ new Vector3(0, 1, 0);
+const _zAxis = /* @__PURE__ */ new Vector3(0, 0, 1);
+const _addedEvent = { type: "added" };
+const _removedEvent = { type: "removed" };
+class Object3D$1 extends EventDispatcher {
+ constructor() {
+ super();
+ Object.defineProperty(this, "id", { value: _object3DId++ });
+ this.uuid = generateUUID();
+ this.name = "";
+ this.type = "Object3D";
+ this.parent = null;
+ this.children = [];
+ this.up = Object3D$1.DefaultUp.clone();
+ const position = new Vector3();
+ const rotation = new Euler();
+ const quaternion = new Quaternion();
+ const scale = new Vector3(1, 1, 1);
+ function onRotationChange() {
+ quaternion.setFromEuler(rotation, false);
+ }
+ function onQuaternionChange() {
+ rotation.setFromQuaternion(quaternion, void 0, false);
+ }
+ rotation._onChange(onRotationChange);
+ quaternion._onChange(onQuaternionChange);
+ Object.defineProperties(this, {
+ position: {
+ configurable: true,
+ enumerable: true,
+ value: position
+ },
+ rotation: {
+ configurable: true,
+ enumerable: true,
+ value: rotation
+ },
+ quaternion: {
+ configurable: true,
+ enumerable: true,
+ value: quaternion
+ },
+ scale: {
+ configurable: true,
+ enumerable: true,
+ value: scale
+ },
+ modelViewMatrix: {
+ value: new Matrix4()
+ },
+ normalMatrix: {
+ value: new Matrix3()
+ }
+ });
+ this.matrix = new Matrix4();
+ this.matrixWorld = new Matrix4();
+ this.matrixAutoUpdate = Object3D$1.DefaultMatrixAutoUpdate;
+ this.matrixWorldNeedsUpdate = false;
+ this.layers = new Layers();
+ this.visible = true;
+ this.castShadow = false;
+ this.receiveShadow = false;
+ this.frustumCulled = true;
+ this.renderOrder = 0;
+ this.animations = [];
+ this.userData = {};
+ }
+ onBeforeRender() {
+ }
+ onAfterRender() {
+ }
+ applyMatrix4(matrix) {
+ if (this.matrixAutoUpdate)
+ this.updateMatrix();
+ this.matrix.premultiply(matrix);
+ this.matrix.decompose(this.position, this.quaternion, this.scale);
+ }
+ applyQuaternion(q) {
+ this.quaternion.premultiply(q);
+ return this;
+ }
+ setRotationFromAxisAngle(axis, angle) {
+ this.quaternion.setFromAxisAngle(axis, angle);
+ }
+ setRotationFromEuler(euler) {
+ this.quaternion.setFromEuler(euler, true);
+ }
+ setRotationFromMatrix(m2) {
+ this.quaternion.setFromRotationMatrix(m2);
+ }
+ setRotationFromQuaternion(q) {
+ this.quaternion.copy(q);
+ }
+ rotateOnAxis(axis, angle) {
+ _q1.setFromAxisAngle(axis, angle);
+ this.quaternion.multiply(_q1);
+ return this;
+ }
+ rotateOnWorldAxis(axis, angle) {
+ _q1.setFromAxisAngle(axis, angle);
+ this.quaternion.premultiply(_q1);
+ return this;
+ }
+ rotateX(angle) {
+ return this.rotateOnAxis(_xAxis, angle);
+ }
+ rotateY(angle) {
+ return this.rotateOnAxis(_yAxis, angle);
+ }
+ rotateZ(angle) {
+ return this.rotateOnAxis(_zAxis, angle);
+ }
+ translateOnAxis(axis, distance) {
+ _v1$4.copy(axis).applyQuaternion(this.quaternion);
+ this.position.add(_v1$4.multiplyScalar(distance));
+ return this;
+ }
+ translateX(distance) {
+ return this.translateOnAxis(_xAxis, distance);
+ }
+ translateY(distance) {
+ return this.translateOnAxis(_yAxis, distance);
+ }
+ translateZ(distance) {
+ return this.translateOnAxis(_zAxis, distance);
+ }
+ localToWorld(vector) {
+ return vector.applyMatrix4(this.matrixWorld);
+ }
+ worldToLocal(vector) {
+ return vector.applyMatrix4(_m1$1.copy(this.matrixWorld).invert());
+ }
+ lookAt(x, y2, z2) {
+ if (x.isVector3) {
+ _target.copy(x);
+ } else {
+ _target.set(x, y2, z2);
+ }
+ const parent = this.parent;
+ this.updateWorldMatrix(true, false);
+ _position$3.setFromMatrixPosition(this.matrixWorld);
+ if (this.isCamera || this.isLight) {
+ _m1$1.lookAt(_position$3, _target, this.up);
+ } else {
+ _m1$1.lookAt(_target, _position$3, this.up);
+ }
+ this.quaternion.setFromRotationMatrix(_m1$1);
+ if (parent) {
+ _m1$1.extractRotation(parent.matrixWorld);
+ _q1.setFromRotationMatrix(_m1$1);
+ this.quaternion.premultiply(_q1.invert());
+ }
+ }
+ add(object) {
+ if (arguments.length > 1) {
+ for (let i = 0; i < arguments.length; i++) {
+ this.add(arguments[i]);
+ }
+ return this;
+ }
+ if (object === this) {
+ console.error("THREE.Object3D.add: object can't be added as a child of itself.", object);
+ return this;
+ }
+ if (object && object.isObject3D) {
+ if (object.parent !== null) {
+ object.parent.remove(object);
+ }
+ object.parent = this;
+ this.children.push(object);
+ object.dispatchEvent(_addedEvent);
+ } else {
+ console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", object);
+ }
+ return this;
+ }
+ remove(object) {
+ if (arguments.length > 1) {
+ for (let i = 0; i < arguments.length; i++) {
+ this.remove(arguments[i]);
+ }
+ return this;
+ }
+ const index = this.children.indexOf(object);
+ if (index !== -1) {
+ object.parent = null;
+ this.children.splice(index, 1);
+ object.dispatchEvent(_removedEvent);
+ }
+ return this;
+ }
+ removeFromParent() {
+ const parent = this.parent;
+ if (parent !== null) {
+ parent.remove(this);
+ }
+ return this;
+ }
+ clear() {
+ for (let i = 0; i < this.children.length; i++) {
+ const object = this.children[i];
+ object.parent = null;
+ object.dispatchEvent(_removedEvent);
+ }
+ this.children.length = 0;
+ return this;
+ }
+ attach(object) {
+ this.updateWorldMatrix(true, false);
+ _m1$1.copy(this.matrixWorld).invert();
+ if (object.parent !== null) {
+ object.parent.updateWorldMatrix(true, false);
+ _m1$1.multiply(object.parent.matrixWorld);
+ }
+ object.applyMatrix4(_m1$1);
+ this.add(object);
+ object.updateWorldMatrix(false, true);
+ return this;
+ }
+ getObjectById(id) {
+ return this.getObjectByProperty("id", id);
+ }
+ getObjectByName(name) {
+ return this.getObjectByProperty("name", name);
+ }
+ getObjectByProperty(name, value) {
+ if (this[name] === value)
+ return this;
+ for (let i = 0, l2 = this.children.length; i < l2; i++) {
+ const child = this.children[i];
+ const object = child.getObjectByProperty(name, value);
+ if (object !== void 0) {
+ return object;
+ }
+ }
+ return void 0;
+ }
+ getWorldPosition(target) {
+ this.updateWorldMatrix(true, false);
+ return target.setFromMatrixPosition(this.matrixWorld);
+ }
+ getWorldQuaternion(target) {
+ this.updateWorldMatrix(true, false);
+ this.matrixWorld.decompose(_position$3, target, _scale$2);
+ return target;
+ }
+ getWorldScale(target) {
+ this.updateWorldMatrix(true, false);
+ this.matrixWorld.decompose(_position$3, _quaternion$2, target);
+ return target;
+ }
+ getWorldDirection(target) {
+ this.updateWorldMatrix(true, false);
+ const e2 = this.matrixWorld.elements;
+ return target.set(e2[8], e2[9], e2[10]).normalize();
+ }
+ raycast() {
+ }
+ traverse(callback) {
+ callback(this);
+ const children = this.children;
+ for (let i = 0, l2 = children.length; i < l2; i++) {
+ children[i].traverse(callback);
+ }
+ }
+ traverseVisible(callback) {
+ if (this.visible === false)
+ return;
+ callback(this);
+ const children = this.children;
+ for (let i = 0, l2 = children.length; i < l2; i++) {
+ children[i].traverseVisible(callback);
+ }
+ }
+ traverseAncestors(callback) {
+ const parent = this.parent;
+ if (parent !== null) {
+ callback(parent);
+ parent.traverseAncestors(callback);
+ }
+ }
+ updateMatrix() {
+ this.matrix.compose(this.position, this.quaternion, this.scale);
+ this.matrixWorldNeedsUpdate = true;
+ }
+ updateMatrixWorld(force) {
+ if (this.matrixAutoUpdate)
+ this.updateMatrix();
+ if (this.matrixWorldNeedsUpdate || force) {
+ if (this.parent === null) {
+ this.matrixWorld.copy(this.matrix);
+ } else {
+ this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix);
+ }
+ this.matrixWorldNeedsUpdate = false;
+ force = true;
+ }
+ const children = this.children;
+ for (let i = 0, l2 = children.length; i < l2; i++) {
+ children[i].updateMatrixWorld(force);
+ }
+ }
+ updateWorldMatrix(updateParents, updateChildren) {
+ const parent = this.parent;
+ if (updateParents === true && parent !== null) {
+ parent.updateWorldMatrix(true, false);
+ }
+ if (this.matrixAutoUpdate)
+ this.updateMatrix();
+ if (this.parent === null) {
+ this.matrixWorld.copy(this.matrix);
+ } else {
+ this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix);
+ }
+ if (updateChildren === true) {
+ const children = this.children;
+ for (let i = 0, l2 = children.length; i < l2; i++) {
+ children[i].updateWorldMatrix(false, true);
+ }
+ }
+ }
+ toJSON(meta) {
+ const isRootObject = meta === void 0 || typeof meta === "string";
+ const output = {};
+ if (isRootObject) {
+ meta = {
+ geometries: {},
+ materials: {},
+ textures: {},
+ images: {},
+ shapes: {},
+ skeletons: {},
+ animations: {},
+ nodes: {}
+ };
+ output.metadata = {
+ version: 4.5,
+ type: "Object",
+ generator: "Object3D.toJSON"
+ };
+ }
+ const object = {};
+ object.uuid = this.uuid;
+ object.type = this.type;
+ if (this.name !== "")
+ object.name = this.name;
+ if (this.castShadow === true)
+ object.castShadow = true;
+ if (this.receiveShadow === true)
+ object.receiveShadow = true;
+ if (this.visible === false)
+ object.visible = false;
+ if (this.frustumCulled === false)
+ object.frustumCulled = false;
+ if (this.renderOrder !== 0)
+ object.renderOrder = this.renderOrder;
+ if (JSON.stringify(this.userData) !== "{}")
+ object.userData = this.userData;
+ object.layers = this.layers.mask;
+ object.matrix = this.matrix.toArray();
+ if (this.matrixAutoUpdate === false)
+ object.matrixAutoUpdate = false;
+ if (this.isInstancedMesh) {
+ object.type = "InstancedMesh";
+ object.count = this.count;
+ object.instanceMatrix = this.instanceMatrix.toJSON();
+ if (this.instanceColor !== null)
+ object.instanceColor = this.instanceColor.toJSON();
+ }
+ function serialize(library, element) {
+ if (library[element.uuid] === void 0) {
+ library[element.uuid] = element.toJSON(meta);
+ }
+ return element.uuid;
+ }
+ if (this.isScene) {
+ if (this.background) {
+ if (this.background.isColor) {
+ object.background = this.background.toJSON();
+ } else if (this.background.isTexture) {
+ object.background = this.background.toJSON(meta).uuid;
+ }
+ }
+ if (this.environment && this.environment.isTexture) {
+ object.environment = this.environment.toJSON(meta).uuid;
+ }
+ } else if (this.isMesh || this.isLine || this.isPoints) {
+ object.geometry = serialize(meta.geometries, this.geometry);
+ const parameters = this.geometry.parameters;
+ if (parameters !== void 0 && parameters.shapes !== void 0) {
+ const shapes = parameters.shapes;
+ if (Array.isArray(shapes)) {
+ for (let i = 0, l2 = shapes.length; i < l2; i++) {
+ const shape = shapes[i];
+ serialize(meta.shapes, shape);
+ }
+ } else {
+ serialize(meta.shapes, shapes);
+ }
+ }
+ }
+ if (this.isSkinnedMesh) {
+ object.bindMode = this.bindMode;
+ object.bindMatrix = this.bindMatrix.toArray();
+ if (this.skeleton !== void 0) {
+ serialize(meta.skeletons, this.skeleton);
+ object.skeleton = this.skeleton.uuid;
+ }
+ }
+ if (this.material !== void 0) {
+ if (Array.isArray(this.material)) {
+ const uuids = [];
+ for (let i = 0, l2 = this.material.length; i < l2; i++) {
+ uuids.push(serialize(meta.materials, this.material[i]));
+ }
+ object.material = uuids;
+ } else {
+ object.material = serialize(meta.materials, this.material);
+ }
+ }
+ if (this.children.length > 0) {
+ object.children = [];
+ for (let i = 0; i < this.children.length; i++) {
+ object.children.push(this.children[i].toJSON(meta).object);
+ }
+ }
+ if (this.animations.length > 0) {
+ object.animations = [];
+ for (let i = 0; i < this.animations.length; i++) {
+ const animation = this.animations[i];
+ object.animations.push(serialize(meta.animations, animation));
+ }
+ }
+ if (isRootObject) {
+ const geometries = extractFromCache(meta.geometries);
+ const materials = extractFromCache(meta.materials);
+ const textures = extractFromCache(meta.textures);
+ const images = extractFromCache(meta.images);
+ const shapes = extractFromCache(meta.shapes);
+ const skeletons = extractFromCache(meta.skeletons);
+ const animations = extractFromCache(meta.animations);
+ const nodes = extractFromCache(meta.nodes);
+ if (geometries.length > 0)
+ output.geometries = geometries;
+ if (materials.length > 0)
+ output.materials = materials;
+ if (textures.length > 0)
+ output.textures = textures;
+ if (images.length > 0)
+ output.images = images;
+ if (shapes.length > 0)
+ output.shapes = shapes;
+ if (skeletons.length > 0)
+ output.skeletons = skeletons;
+ if (animations.length > 0)
+ output.animations = animations;
+ if (nodes.length > 0)
+ output.nodes = nodes;
+ }
+ output.object = object;
+ return output;
+ function extractFromCache(cache) {
+ const values = [];
+ for (const key in cache) {
+ const data = cache[key];
+ delete data.metadata;
+ values.push(data);
+ }
+ return values;
+ }
+ }
+ clone(recursive) {
+ return new this.constructor().copy(this, recursive);
+ }
+ copy(source, recursive = true) {
+ this.name = source.name;
+ this.up.copy(source.up);
+ this.position.copy(source.position);
+ this.rotation.order = source.rotation.order;
+ this.quaternion.copy(source.quaternion);
+ this.scale.copy(source.scale);
+ this.matrix.copy(source.matrix);
+ this.matrixWorld.copy(source.matrixWorld);
+ this.matrixAutoUpdate = source.matrixAutoUpdate;
+ this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;
+ this.layers.mask = source.layers.mask;
+ this.visible = source.visible;
+ this.castShadow = source.castShadow;
+ this.receiveShadow = source.receiveShadow;
+ this.frustumCulled = source.frustumCulled;
+ this.renderOrder = source.renderOrder;
+ this.userData = JSON.parse(JSON.stringify(source.userData));
+ if (recursive === true) {
+ for (let i = 0; i < source.children.length; i++) {
+ const child = source.children[i];
+ this.add(child.clone());
+ }
+ }
+ return this;
+ }
+}
+Object3D$1.DefaultUp = new Vector3(0, 1, 0);
+Object3D$1.DefaultMatrixAutoUpdate = true;
+Object3D$1.prototype.isObject3D = true;
+const _v0$1 = /* @__PURE__ */ new Vector3();
+const _v1$3 = /* @__PURE__ */ new Vector3();
+const _v2$2 = /* @__PURE__ */ new Vector3();
+const _v3$1 = /* @__PURE__ */ new Vector3();
+const _vab = /* @__PURE__ */ new Vector3();
+const _vac = /* @__PURE__ */ new Vector3();
+const _vbc = /* @__PURE__ */ new Vector3();
+const _vap = /* @__PURE__ */ new Vector3();
+const _vbp = /* @__PURE__ */ new Vector3();
+const _vcp = /* @__PURE__ */ new Vector3();
+class Triangle {
+ constructor(a2 = new Vector3(), b3 = new Vector3(), c2 = new Vector3()) {
+ this.a = a2;
+ this.b = b3;
+ this.c = c2;
+ }
+ static getNormal(a2, b3, c2, target) {
+ target.subVectors(c2, b3);
+ _v0$1.subVectors(a2, b3);
+ target.cross(_v0$1);
+ const targetLengthSq = target.lengthSq();
+ if (targetLengthSq > 0) {
+ return target.multiplyScalar(1 / Math.sqrt(targetLengthSq));
+ }
+ return target.set(0, 0, 0);
+ }
+ static getBarycoord(point, a2, b3, c2, target) {
+ _v0$1.subVectors(c2, a2);
+ _v1$3.subVectors(b3, a2);
+ _v2$2.subVectors(point, a2);
+ const dot00 = _v0$1.dot(_v0$1);
+ const dot01 = _v0$1.dot(_v1$3);
+ const dot02 = _v0$1.dot(_v2$2);
+ const dot11 = _v1$3.dot(_v1$3);
+ const dot12 = _v1$3.dot(_v2$2);
+ const denom = dot00 * dot11 - dot01 * dot01;
+ if (denom === 0) {
+ return target.set(-2, -1, -1);
+ }
+ const invDenom = 1 / denom;
+ const u2 = (dot11 * dot02 - dot01 * dot12) * invDenom;
+ const v2 = (dot00 * dot12 - dot01 * dot02) * invDenom;
+ return target.set(1 - u2 - v2, v2, u2);
+ }
+ static containsPoint(point, a2, b3, c2) {
+ this.getBarycoord(point, a2, b3, c2, _v3$1);
+ return _v3$1.x >= 0 && _v3$1.y >= 0 && _v3$1.x + _v3$1.y <= 1;
+ }
+ static getUV(point, p1, p2, p3, uv1, uv2, uv3, target) {
+ this.getBarycoord(point, p1, p2, p3, _v3$1);
+ target.set(0, 0);
+ target.addScaledVector(uv1, _v3$1.x);
+ target.addScaledVector(uv2, _v3$1.y);
+ target.addScaledVector(uv3, _v3$1.z);
+ return target;
+ }
+ static isFrontFacing(a2, b3, c2, direction) {
+ _v0$1.subVectors(c2, b3);
+ _v1$3.subVectors(a2, b3);
+ return _v0$1.cross(_v1$3).dot(direction) < 0 ? true : false;
+ }
+ set(a2, b3, c2) {
+ this.a.copy(a2);
+ this.b.copy(b3);
+ this.c.copy(c2);
+ return this;
+ }
+ setFromPointsAndIndices(points, i0, i1, i2) {
+ this.a.copy(points[i0]);
+ this.b.copy(points[i1]);
+ this.c.copy(points[i2]);
+ return this;
+ }
+ setFromAttributeAndIndices(attribute, i0, i1, i2) {
+ this.a.fromBufferAttribute(attribute, i0);
+ this.b.fromBufferAttribute(attribute, i1);
+ this.c.fromBufferAttribute(attribute, i2);
+ return this;
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+ copy(triangle) {
+ this.a.copy(triangle.a);
+ this.b.copy(triangle.b);
+ this.c.copy(triangle.c);
+ return this;
+ }
+ getArea() {
+ _v0$1.subVectors(this.c, this.b);
+ _v1$3.subVectors(this.a, this.b);
+ return _v0$1.cross(_v1$3).length() * 0.5;
+ }
+ getMidpoint(target) {
+ return target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);
+ }
+ getNormal(target) {
+ return Triangle.getNormal(this.a, this.b, this.c, target);
+ }
+ getPlane(target) {
+ return target.setFromCoplanarPoints(this.a, this.b, this.c);
+ }
+ getBarycoord(point, target) {
+ return Triangle.getBarycoord(point, this.a, this.b, this.c, target);
+ }
+ getUV(point, uv1, uv2, uv3, target) {
+ return Triangle.getUV(point, this.a, this.b, this.c, uv1, uv2, uv3, target);
+ }
+ containsPoint(point) {
+ return Triangle.containsPoint(point, this.a, this.b, this.c);
+ }
+ isFrontFacing(direction) {
+ return Triangle.isFrontFacing(this.a, this.b, this.c, direction);
+ }
+ intersectsBox(box) {
+ return box.intersectsTriangle(this);
+ }
+ closestPointToPoint(p2, target) {
+ const a2 = this.a, b3 = this.b, c2 = this.c;
+ let v2, w2;
+ _vab.subVectors(b3, a2);
+ _vac.subVectors(c2, a2);
+ _vap.subVectors(p2, a2);
+ const d1 = _vab.dot(_vap);
+ const d2 = _vac.dot(_vap);
+ if (d1 <= 0 && d2 <= 0) {
+ return target.copy(a2);
+ }
+ _vbp.subVectors(p2, b3);
+ const d3 = _vab.dot(_vbp);
+ const d4 = _vac.dot(_vbp);
+ if (d3 >= 0 && d4 <= d3) {
+ return target.copy(b3);
+ }
+ const vc = d1 * d4 - d3 * d2;
+ if (vc <= 0 && d1 >= 0 && d3 <= 0) {
+ v2 = d1 / (d1 - d3);
+ return target.copy(a2).addScaledVector(_vab, v2);
+ }
+ _vcp.subVectors(p2, c2);
+ const d5 = _vab.dot(_vcp);
+ const d6 = _vac.dot(_vcp);
+ if (d6 >= 0 && d5 <= d6) {
+ return target.copy(c2);
+ }
+ const vb = d5 * d2 - d1 * d6;
+ if (vb <= 0 && d2 >= 0 && d6 <= 0) {
+ w2 = d2 / (d2 - d6);
+ return target.copy(a2).addScaledVector(_vac, w2);
+ }
+ const va = d3 * d6 - d5 * d4;
+ if (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {
+ _vbc.subVectors(c2, b3);
+ w2 = (d4 - d3) / (d4 - d3 + (d5 - d6));
+ return target.copy(b3).addScaledVector(_vbc, w2);
+ }
+ const denom = 1 / (va + vb + vc);
+ v2 = vb * denom;
+ w2 = vc * denom;
+ return target.copy(a2).addScaledVector(_vab, v2).addScaledVector(_vac, w2);
+ }
+ equals(triangle) {
+ return triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);
+ }
+}
+let materialId = 0;
+class Material extends EventDispatcher {
+ constructor() {
+ super();
+ Object.defineProperty(this, "id", { value: materialId++ });
+ this.uuid = generateUUID();
+ this.name = "";
+ this.type = "Material";
+ this.fog = true;
+ this.blending = NormalBlending;
+ this.side = FrontSide;
+ this.vertexColors = false;
+ this.opacity = 1;
+ this.transparent = false;
+ this.blendSrc = SrcAlphaFactor;
+ this.blendDst = OneMinusSrcAlphaFactor;
+ this.blendEquation = AddEquation;
+ this.blendSrcAlpha = null;
+ this.blendDstAlpha = null;
+ this.blendEquationAlpha = null;
+ this.depthFunc = LessEqualDepth;
+ this.depthTest = true;
+ this.depthWrite = true;
+ this.stencilWriteMask = 255;
+ this.stencilFunc = AlwaysStencilFunc;
+ this.stencilRef = 0;
+ this.stencilFuncMask = 255;
+ this.stencilFail = KeepStencilOp;
+ this.stencilZFail = KeepStencilOp;
+ this.stencilZPass = KeepStencilOp;
+ this.stencilWrite = false;
+ this.clippingPlanes = null;
+ this.clipIntersection = false;
+ this.clipShadows = false;
+ this.shadowSide = null;
+ this.colorWrite = true;
+ this.precision = null;
+ this.polygonOffset = false;
+ this.polygonOffsetFactor = 0;
+ this.polygonOffsetUnits = 0;
+ this.dithering = false;
+ this.alphaToCoverage = false;
+ this.premultipliedAlpha = false;
+ this.visible = true;
+ this.toneMapped = true;
+ this.userData = {};
+ this.version = 0;
+ this._alphaTest = 0;
+ }
+ get alphaTest() {
+ return this._alphaTest;
+ }
+ set alphaTest(value) {
+ if (this._alphaTest > 0 !== value > 0) {
+ this.version++;
+ }
+ this._alphaTest = value;
+ }
+ onBuild() {
+ }
+ onBeforeRender() {
+ }
+ onBeforeCompile() {
+ }
+ customProgramCacheKey() {
+ return this.onBeforeCompile.toString();
+ }
+ setValues(values) {
+ if (values === void 0)
+ return;
+ for (const key in values) {
+ const newValue = values[key];
+ if (newValue === void 0) {
+ console.warn("THREE.Material: '" + key + "' parameter is undefined.");
+ continue;
+ }
+ if (key === "shading") {
+ console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead.");
+ this.flatShading = newValue === FlatShading ? true : false;
+ continue;
+ }
+ const currentValue = this[key];
+ if (currentValue === void 0) {
+ console.warn("THREE." + this.type + ": '" + key + "' is not a property of this material.");
+ continue;
+ }
+ if (currentValue && currentValue.isColor) {
+ currentValue.set(newValue);
+ } else if (currentValue && currentValue.isVector3 && (newValue && newValue.isVector3)) {
+ currentValue.copy(newValue);
+ } else {
+ this[key] = newValue;
+ }
+ }
+ }
+ toJSON(meta) {
+ const isRootObject = meta === void 0 || typeof meta === "string";
+ if (isRootObject) {
+ meta = {
+ textures: {},
+ images: {}
+ };
+ }
+ const data = {
+ metadata: {
+ version: 4.5,
+ type: "Material",
+ generator: "Material.toJSON"
+ }
+ };
+ data.uuid = this.uuid;
+ data.type = this.type;
+ if (this.name !== "")
+ data.name = this.name;
+ if (this.color && this.color.isColor)
+ data.color = this.color.getHex();
+ if (this.roughness !== void 0)
+ data.roughness = this.roughness;
+ if (this.metalness !== void 0)
+ data.metalness = this.metalness;
+ if (this.sheen !== void 0)
+ data.sheen = this.sheen;
+ if (this.sheenColor && this.sheenColor.isColor)
+ data.sheenColor = this.sheenColor.getHex();
+ if (this.sheenRoughness !== void 0)
+ data.sheenRoughness = this.sheenRoughness;
+ if (this.emissive && this.emissive.isColor)
+ data.emissive = this.emissive.getHex();
+ if (this.emissiveIntensity && this.emissiveIntensity !== 1)
+ data.emissiveIntensity = this.emissiveIntensity;
+ if (this.specular && this.specular.isColor)
+ data.specular = this.specular.getHex();
+ if (this.specularIntensity !== void 0)
+ data.specularIntensity = this.specularIntensity;
+ if (this.specularColor && this.specularColor.isColor)
+ data.specularColor = this.specularColor.getHex();
+ if (this.shininess !== void 0)
+ data.shininess = this.shininess;
+ if (this.clearcoat !== void 0)
+ data.clearcoat = this.clearcoat;
+ if (this.clearcoatRoughness !== void 0)
+ data.clearcoatRoughness = this.clearcoatRoughness;
+ if (this.clearcoatMap && this.clearcoatMap.isTexture) {
+ data.clearcoatMap = this.clearcoatMap.toJSON(meta).uuid;
+ }
+ if (this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture) {
+ data.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(meta).uuid;
+ }
+ if (this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture) {
+ data.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(meta).uuid;
+ data.clearcoatNormalScale = this.clearcoatNormalScale.toArray();
+ }
+ if (this.map && this.map.isTexture)
+ data.map = this.map.toJSON(meta).uuid;
+ if (this.matcap && this.matcap.isTexture)
+ data.matcap = this.matcap.toJSON(meta).uuid;
+ if (this.alphaMap && this.alphaMap.isTexture)
+ data.alphaMap = this.alphaMap.toJSON(meta).uuid;
+ if (this.lightMap && this.lightMap.isTexture) {
+ data.lightMap = this.lightMap.toJSON(meta).uuid;
+ data.lightMapIntensity = this.lightMapIntensity;
+ }
+ if (this.aoMap && this.aoMap.isTexture) {
+ data.aoMap = this.aoMap.toJSON(meta).uuid;
+ data.aoMapIntensity = this.aoMapIntensity;
+ }
+ if (this.bumpMap && this.bumpMap.isTexture) {
+ data.bumpMap = this.bumpMap.toJSON(meta).uuid;
+ data.bumpScale = this.bumpScale;
+ }
+ if (this.normalMap && this.normalMap.isTexture) {
+ data.normalMap = this.normalMap.toJSON(meta).uuid;
+ data.normalMapType = this.normalMapType;
+ data.normalScale = this.normalScale.toArray();
+ }
+ if (this.displacementMap && this.displacementMap.isTexture) {
+ data.displacementMap = this.displacementMap.toJSON(meta).uuid;
+ data.displacementScale = this.displacementScale;
+ data.displacementBias = this.displacementBias;
+ }
+ if (this.roughnessMap && this.roughnessMap.isTexture)
+ data.roughnessMap = this.roughnessMap.toJSON(meta).uuid;
+ if (this.metalnessMap && this.metalnessMap.isTexture)
+ data.metalnessMap = this.metalnessMap.toJSON(meta).uuid;
+ if (this.emissiveMap && this.emissiveMap.isTexture)
+ data.emissiveMap = this.emissiveMap.toJSON(meta).uuid;
+ if (this.specularMap && this.specularMap.isTexture)
+ data.specularMap = this.specularMap.toJSON(meta).uuid;
+ if (this.specularIntensityMap && this.specularIntensityMap.isTexture)
+ data.specularIntensityMap = this.specularIntensityMap.toJSON(meta).uuid;
+ if (this.specularColorMap && this.specularColorMap.isTexture)
+ data.specularColorMap = this.specularColorMap.toJSON(meta).uuid;
+ if (this.envMap && this.envMap.isTexture) {
+ data.envMap = this.envMap.toJSON(meta).uuid;
+ if (this.combine !== void 0)
+ data.combine = this.combine;
+ }
+ if (this.envMapIntensity !== void 0)
+ data.envMapIntensity = this.envMapIntensity;
+ if (this.reflectivity !== void 0)
+ data.reflectivity = this.reflectivity;
+ if (this.refractionRatio !== void 0)
+ data.refractionRatio = this.refractionRatio;
+ if (this.gradientMap && this.gradientMap.isTexture) {
+ data.gradientMap = this.gradientMap.toJSON(meta).uuid;
+ }
+ if (this.transmission !== void 0)
+ data.transmission = this.transmission;
+ if (this.transmissionMap && this.transmissionMap.isTexture)
+ data.transmissionMap = this.transmissionMap.toJSON(meta).uuid;
+ if (this.thickness !== void 0)
+ data.thickness = this.thickness;
+ if (this.thicknessMap && this.thicknessMap.isTexture)
+ data.thicknessMap = this.thicknessMap.toJSON(meta).uuid;
+ if (this.attenuationDistance !== void 0)
+ data.attenuationDistance = this.attenuationDistance;
+ if (this.attenuationColor !== void 0)
+ data.attenuationColor = this.attenuationColor.getHex();
+ if (this.size !== void 0)
+ data.size = this.size;
+ if (this.shadowSide !== null)
+ data.shadowSide = this.shadowSide;
+ if (this.sizeAttenuation !== void 0)
+ data.sizeAttenuation = this.sizeAttenuation;
+ if (this.blending !== NormalBlending)
+ data.blending = this.blending;
+ if (this.side !== FrontSide)
+ data.side = this.side;
+ if (this.vertexColors)
+ data.vertexColors = true;
+ if (this.opacity < 1)
+ data.opacity = this.opacity;
+ if (this.transparent === true)
+ data.transparent = this.transparent;
+ data.depthFunc = this.depthFunc;
+ data.depthTest = this.depthTest;
+ data.depthWrite = this.depthWrite;
+ data.colorWrite = this.colorWrite;
+ data.stencilWrite = this.stencilWrite;
+ data.stencilWriteMask = this.stencilWriteMask;
+ data.stencilFunc = this.stencilFunc;
+ data.stencilRef = this.stencilRef;
+ data.stencilFuncMask = this.stencilFuncMask;
+ data.stencilFail = this.stencilFail;
+ data.stencilZFail = this.stencilZFail;
+ data.stencilZPass = this.stencilZPass;
+ if (this.rotation !== void 0 && this.rotation !== 0)
+ data.rotation = this.rotation;
+ if (this.polygonOffset === true)
+ data.polygonOffset = true;
+ if (this.polygonOffsetFactor !== 0)
+ data.polygonOffsetFactor = this.polygonOffsetFactor;
+ if (this.polygonOffsetUnits !== 0)
+ data.polygonOffsetUnits = this.polygonOffsetUnits;
+ if (this.linewidth !== void 0 && this.linewidth !== 1)
+ data.linewidth = this.linewidth;
+ if (this.dashSize !== void 0)
+ data.dashSize = this.dashSize;
+ if (this.gapSize !== void 0)
+ data.gapSize = this.gapSize;
+ if (this.scale !== void 0)
+ data.scale = this.scale;
+ if (this.dithering === true)
+ data.dithering = true;
+ if (this.alphaTest > 0)
+ data.alphaTest = this.alphaTest;
+ if (this.alphaToCoverage === true)
+ data.alphaToCoverage = this.alphaToCoverage;
+ if (this.premultipliedAlpha === true)
+ data.premultipliedAlpha = this.premultipliedAlpha;
+ if (this.wireframe === true)
+ data.wireframe = this.wireframe;
+ if (this.wireframeLinewidth > 1)
+ data.wireframeLinewidth = this.wireframeLinewidth;
+ if (this.wireframeLinecap !== "round")
+ data.wireframeLinecap = this.wireframeLinecap;
+ if (this.wireframeLinejoin !== "round")
+ data.wireframeLinejoin = this.wireframeLinejoin;
+ if (this.flatShading === true)
+ data.flatShading = this.flatShading;
+ if (this.visible === false)
+ data.visible = false;
+ if (this.toneMapped === false)
+ data.toneMapped = false;
+ if (JSON.stringify(this.userData) !== "{}")
+ data.userData = this.userData;
+ function extractFromCache(cache) {
+ const values = [];
+ for (const key in cache) {
+ const data2 = cache[key];
+ delete data2.metadata;
+ values.push(data2);
+ }
+ return values;
+ }
+ if (isRootObject) {
+ const textures = extractFromCache(meta.textures);
+ const images = extractFromCache(meta.images);
+ if (textures.length > 0)
+ data.textures = textures;
+ if (images.length > 0)
+ data.images = images;
+ }
+ return data;
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+ copy(source) {
+ this.name = source.name;
+ this.fog = source.fog;
+ this.blending = source.blending;
+ this.side = source.side;
+ this.vertexColors = source.vertexColors;
+ this.opacity = source.opacity;
+ this.transparent = source.transparent;
+ this.blendSrc = source.blendSrc;
+ this.blendDst = source.blendDst;
+ this.blendEquation = source.blendEquation;
+ this.blendSrcAlpha = source.blendSrcAlpha;
+ this.blendDstAlpha = source.blendDstAlpha;
+ this.blendEquationAlpha = source.blendEquationAlpha;
+ this.depthFunc = source.depthFunc;
+ this.depthTest = source.depthTest;
+ this.depthWrite = source.depthWrite;
+ this.stencilWriteMask = source.stencilWriteMask;
+ this.stencilFunc = source.stencilFunc;
+ this.stencilRef = source.stencilRef;
+ this.stencilFuncMask = source.stencilFuncMask;
+ this.stencilFail = source.stencilFail;
+ this.stencilZFail = source.stencilZFail;
+ this.stencilZPass = source.stencilZPass;
+ this.stencilWrite = source.stencilWrite;
+ const srcPlanes = source.clippingPlanes;
+ let dstPlanes = null;
+ if (srcPlanes !== null) {
+ const n2 = srcPlanes.length;
+ dstPlanes = new Array(n2);
+ for (let i = 0; i !== n2; ++i) {
+ dstPlanes[i] = srcPlanes[i].clone();
+ }
+ }
+ this.clippingPlanes = dstPlanes;
+ this.clipIntersection = source.clipIntersection;
+ this.clipShadows = source.clipShadows;
+ this.shadowSide = source.shadowSide;
+ this.colorWrite = source.colorWrite;
+ this.precision = source.precision;
+ this.polygonOffset = source.polygonOffset;
+ this.polygonOffsetFactor = source.polygonOffsetFactor;
+ this.polygonOffsetUnits = source.polygonOffsetUnits;
+ this.dithering = source.dithering;
+ this.alphaTest = source.alphaTest;
+ this.alphaToCoverage = source.alphaToCoverage;
+ this.premultipliedAlpha = source.premultipliedAlpha;
+ this.visible = source.visible;
+ this.toneMapped = source.toneMapped;
+ this.userData = JSON.parse(JSON.stringify(source.userData));
+ return this;
+ }
+ dispose() {
+ this.dispatchEvent({ type: "dispose" });
+ }
+ set needsUpdate(value) {
+ if (value === true)
+ this.version++;
+ }
+}
+Material.prototype.isMaterial = true;
+Material.fromType = function() {
+ return null;
+};
+class MeshBasicMaterial extends Material {
+ constructor(parameters) {
+ super();
+ this.type = "MeshBasicMaterial";
+ this.color = new Color(16777215);
+ this.map = null;
+ this.lightMap = null;
+ this.lightMapIntensity = 1;
+ this.aoMap = null;
+ this.aoMapIntensity = 1;
+ this.specularMap = null;
+ this.alphaMap = null;
+ this.envMap = null;
+ this.combine = MultiplyOperation;
+ this.reflectivity = 1;
+ this.refractionRatio = 0.98;
+ this.wireframe = false;
+ this.wireframeLinewidth = 1;
+ this.wireframeLinecap = "round";
+ this.wireframeLinejoin = "round";
+ this.setValues(parameters);
+ }
+ copy(source) {
+ super.copy(source);
+ this.color.copy(source.color);
+ this.map = source.map;
+ this.lightMap = source.lightMap;
+ this.lightMapIntensity = source.lightMapIntensity;
+ this.aoMap = source.aoMap;
+ this.aoMapIntensity = source.aoMapIntensity;
+ this.specularMap = source.specularMap;
+ this.alphaMap = source.alphaMap;
+ this.envMap = source.envMap;
+ this.combine = source.combine;
+ this.reflectivity = source.reflectivity;
+ this.refractionRatio = source.refractionRatio;
+ this.wireframe = source.wireframe;
+ this.wireframeLinewidth = source.wireframeLinewidth;
+ this.wireframeLinecap = source.wireframeLinecap;
+ this.wireframeLinejoin = source.wireframeLinejoin;
+ return this;
+ }
+}
+MeshBasicMaterial.prototype.isMeshBasicMaterial = true;
+const _vector$9 = /* @__PURE__ */ new Vector3();
+const _vector2$1 = /* @__PURE__ */ new Vector2();
+class BufferAttribute {
+ constructor(array, itemSize, normalized) {
+ if (Array.isArray(array)) {
+ throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
+ }
+ this.name = "";
+ this.array = array;
+ this.itemSize = itemSize;
+ this.count = array !== void 0 ? array.length / itemSize : 0;
+ this.normalized = normalized === true;
+ this.usage = StaticDrawUsage;
+ this.updateRange = { offset: 0, count: -1 };
+ this.version = 0;
+ }
+ onUploadCallback() {
+ }
+ set needsUpdate(value) {
+ if (value === true)
+ this.version++;
+ }
+ setUsage(value) {
+ this.usage = value;
+ return this;
+ }
+ copy(source) {
+ this.name = source.name;
+ this.array = new source.array.constructor(source.array);
+ this.itemSize = source.itemSize;
+ this.count = source.count;
+ this.normalized = source.normalized;
+ this.usage = source.usage;
+ return this;
+ }
+ copyAt(index1, attribute, index2) {
+ index1 *= this.itemSize;
+ index2 *= attribute.itemSize;
+ for (let i = 0, l2 = this.itemSize; i < l2; i++) {
+ this.array[index1 + i] = attribute.array[index2 + i];
+ }
+ return this;
+ }
+ copyArray(array) {
+ this.array.set(array);
+ return this;
+ }
+ copyColorsArray(colors) {
+ const array = this.array;
+ let offset = 0;
+ for (let i = 0, l2 = colors.length; i < l2; i++) {
+ let color = colors[i];
+ if (color === void 0) {
+ console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", i);
+ color = new Color();
+ }
+ array[offset++] = color.r;
+ array[offset++] = color.g;
+ array[offset++] = color.b;
+ }
+ return this;
+ }
+ copyVector2sArray(vectors) {
+ const array = this.array;
+ let offset = 0;
+ for (let i = 0, l2 = vectors.length; i < l2; i++) {
+ let vector = vectors[i];
+ if (vector === void 0) {
+ console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", i);
+ vector = new Vector2();
+ }
+ array[offset++] = vector.x;
+ array[offset++] = vector.y;
+ }
+ return this;
+ }
+ copyVector3sArray(vectors) {
+ const array = this.array;
+ let offset = 0;
+ for (let i = 0, l2 = vectors.length; i < l2; i++) {
+ let vector = vectors[i];
+ if (vector === void 0) {
+ console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", i);
+ vector = new Vector3();
+ }
+ array[offset++] = vector.x;
+ array[offset++] = vector.y;
+ array[offset++] = vector.z;
+ }
+ return this;
+ }
+ copyVector4sArray(vectors) {
+ const array = this.array;
+ let offset = 0;
+ for (let i = 0, l2 = vectors.length; i < l2; i++) {
+ let vector = vectors[i];
+ if (vector === void 0) {
+ console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", i);
+ vector = new Vector4();
+ }
+ array[offset++] = vector.x;
+ array[offset++] = vector.y;
+ array[offset++] = vector.z;
+ array[offset++] = vector.w;
+ }
+ return this;
+ }
+ applyMatrix3(m2) {
+ if (this.itemSize === 2) {
+ for (let i = 0, l2 = this.count; i < l2; i++) {
+ _vector2$1.fromBufferAttribute(this, i);
+ _vector2$1.applyMatrix3(m2);
+ this.setXY(i, _vector2$1.x, _vector2$1.y);
+ }
+ } else if (this.itemSize === 3) {
+ for (let i = 0, l2 = this.count; i < l2; i++) {
+ _vector$9.fromBufferAttribute(this, i);
+ _vector$9.applyMatrix3(m2);
+ this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);
+ }
+ }
+ return this;
+ }
+ applyMatrix4(m2) {
+ for (let i = 0, l2 = this.count; i < l2; i++) {
+ _vector$9.x = this.getX(i);
+ _vector$9.y = this.getY(i);
+ _vector$9.z = this.getZ(i);
+ _vector$9.applyMatrix4(m2);
+ this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);
+ }
+ return this;
+ }
+ applyNormalMatrix(m2) {
+ for (let i = 0, l2 = this.count; i < l2; i++) {
+ _vector$9.x = this.getX(i);
+ _vector$9.y = this.getY(i);
+ _vector$9.z = this.getZ(i);
+ _vector$9.applyNormalMatrix(m2);
+ this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);
+ }
+ return this;
+ }
+ transformDirection(m2) {
+ for (let i = 0, l2 = this.count; i < l2; i++) {
+ _vector$9.x = this.getX(i);
+ _vector$9.y = this.getY(i);
+ _vector$9.z = this.getZ(i);
+ _vector$9.transformDirection(m2);
+ this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);
+ }
+ return this;
+ }
+ set(value, offset = 0) {
+ this.array.set(value, offset);
+ return this;
+ }
+ getX(index) {
+ return this.array[index * this.itemSize];
+ }
+ setX(index, x) {
+ this.array[index * this.itemSize] = x;
+ return this;
+ }
+ getY(index) {
+ return this.array[index * this.itemSize + 1];
+ }
+ setY(index, y2) {
+ this.array[index * this.itemSize + 1] = y2;
+ return this;
+ }
+ getZ(index) {
+ return this.array[index * this.itemSize + 2];
+ }
+ setZ(index, z2) {
+ this.array[index * this.itemSize + 2] = z2;
+ return this;
+ }
+ getW(index) {
+ return this.array[index * this.itemSize + 3];
+ }
+ setW(index, w2) {
+ this.array[index * this.itemSize + 3] = w2;
+ return this;
+ }
+ setXY(index, x, y2) {
+ index *= this.itemSize;
+ this.array[index + 0] = x;
+ this.array[index + 1] = y2;
+ return this;
+ }
+ setXYZ(index, x, y2, z2) {
+ index *= this.itemSize;
+ this.array[index + 0] = x;
+ this.array[index + 1] = y2;
+ this.array[index + 2] = z2;
+ return this;
+ }
+ setXYZW(index, x, y2, z2, w2) {
+ index *= this.itemSize;
+ this.array[index + 0] = x;
+ this.array[index + 1] = y2;
+ this.array[index + 2] = z2;
+ this.array[index + 3] = w2;
+ return this;
+ }
+ onUpload(callback) {
+ this.onUploadCallback = callback;
+ return this;
+ }
+ clone() {
+ return new this.constructor(this.array, this.itemSize).copy(this);
+ }
+ toJSON() {
+ const data = {
+ itemSize: this.itemSize,
+ type: this.array.constructor.name,
+ array: Array.prototype.slice.call(this.array),
+ normalized: this.normalized
+ };
+ if (this.name !== "")
+ data.name = this.name;
+ if (this.usage !== StaticDrawUsage)
+ data.usage = this.usage;
+ if (this.updateRange.offset !== 0 || this.updateRange.count !== -1)
+ data.updateRange = this.updateRange;
+ return data;
+ }
+}
+BufferAttribute.prototype.isBufferAttribute = true;
+class Uint16BufferAttribute extends BufferAttribute {
+ constructor(array, itemSize, normalized) {
+ super(new Uint16Array(array), itemSize, normalized);
+ }
+}
+class Uint32BufferAttribute extends BufferAttribute {
+ constructor(array, itemSize, normalized) {
+ super(new Uint32Array(array), itemSize, normalized);
+ }
+}
+class Float16BufferAttribute extends BufferAttribute {
+ constructor(array, itemSize, normalized) {
+ super(new Uint16Array(array), itemSize, normalized);
+ }
+}
+Float16BufferAttribute.prototype.isFloat16BufferAttribute = true;
+class Float32BufferAttribute extends BufferAttribute {
+ constructor(array, itemSize, normalized) {
+ super(new Float32Array(array), itemSize, normalized);
+ }
+}
+let _id$1 = 0;
+const _m1 = /* @__PURE__ */ new Matrix4();
+const _obj = /* @__PURE__ */ new Object3D$1();
+const _offset = /* @__PURE__ */ new Vector3();
+const _box$1 = /* @__PURE__ */ new Box3();
+const _boxMorphTargets = /* @__PURE__ */ new Box3();
+const _vector$8 = /* @__PURE__ */ new Vector3();
+class BufferGeometry extends EventDispatcher {
+ constructor() {
+ super();
+ Object.defineProperty(this, "id", { value: _id$1++ });
+ this.uuid = generateUUID();
+ this.name = "";
+ this.type = "BufferGeometry";
+ this.index = null;
+ this.attributes = {};
+ this.morphAttributes = {};
+ this.morphTargetsRelative = false;
+ this.groups = [];
+ this.boundingBox = null;
+ this.boundingSphere = null;
+ this.drawRange = { start: 0, count: Infinity };
+ this.userData = {};
+ }
+ getIndex() {
+ return this.index;
+ }
+ setIndex(index) {
+ if (Array.isArray(index)) {
+ this.index = new (arrayNeedsUint32(index) ? Uint32BufferAttribute : Uint16BufferAttribute)(index, 1);
+ } else {
+ this.index = index;
+ }
+ return this;
+ }
+ getAttribute(name) {
+ return this.attributes[name];
+ }
+ setAttribute(name, attribute) {
+ this.attributes[name] = attribute;
+ return this;
+ }
+ deleteAttribute(name) {
+ delete this.attributes[name];
+ return this;
+ }
+ hasAttribute(name) {
+ return this.attributes[name] !== void 0;
+ }
+ addGroup(start, count, materialIndex = 0) {
+ this.groups.push({
+ start,
+ count,
+ materialIndex
+ });
+ }
+ clearGroups() {
+ this.groups = [];
+ }
+ setDrawRange(start, count) {
+ this.drawRange.start = start;
+ this.drawRange.count = count;
+ }
+ applyMatrix4(matrix) {
+ const position = this.attributes.position;
+ if (position !== void 0) {
+ position.applyMatrix4(matrix);
+ position.needsUpdate = true;
+ }
+ const normal = this.attributes.normal;
+ if (normal !== void 0) {
+ const normalMatrix = new Matrix3().getNormalMatrix(matrix);
+ normal.applyNormalMatrix(normalMatrix);
+ normal.needsUpdate = true;
+ }
+ const tangent = this.attributes.tangent;
+ if (tangent !== void 0) {
+ tangent.transformDirection(matrix);
+ tangent.needsUpdate = true;
+ }
+ if (this.boundingBox !== null) {
+ this.computeBoundingBox();
+ }
+ if (this.boundingSphere !== null) {
+ this.computeBoundingSphere();
+ }
+ return this;
+ }
+ applyQuaternion(q) {
+ _m1.makeRotationFromQuaternion(q);
+ this.applyMatrix4(_m1);
+ return this;
+ }
+ rotateX(angle) {
+ _m1.makeRotationX(angle);
+ this.applyMatrix4(_m1);
+ return this;
+ }
+ rotateY(angle) {
+ _m1.makeRotationY(angle);
+ this.applyMatrix4(_m1);
+ return this;
+ }
+ rotateZ(angle) {
+ _m1.makeRotationZ(angle);
+ this.applyMatrix4(_m1);
+ return this;
+ }
+ translate(x, y2, z2) {
+ _m1.makeTranslation(x, y2, z2);
+ this.applyMatrix4(_m1);
+ return this;
+ }
+ scale(x, y2, z2) {
+ _m1.makeScale(x, y2, z2);
+ this.applyMatrix4(_m1);
+ return this;
+ }
+ lookAt(vector) {
+ _obj.lookAt(vector);
+ _obj.updateMatrix();
+ this.applyMatrix4(_obj.matrix);
+ return this;
+ }
+ center() {
+ this.computeBoundingBox();
+ this.boundingBox.getCenter(_offset).negate();
+ this.translate(_offset.x, _offset.y, _offset.z);
+ return this;
+ }
+ setFromPoints(points) {
+ const position = [];
+ for (let i = 0, l2 = points.length; i < l2; i++) {
+ const point = points[i];
+ position.push(point.x, point.y, point.z || 0);
+ }
+ this.setAttribute("position", new Float32BufferAttribute(position, 3));
+ return this;
+ }
+ computeBoundingBox() {
+ if (this.boundingBox === null) {
+ this.boundingBox = new Box3();
+ }
+ const position = this.attributes.position;
+ const morphAttributesPosition = this.morphAttributes.position;
+ if (position && position.isGLBufferAttribute) {
+ console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this);
+ this.boundingBox.set(new Vector3(-Infinity, -Infinity, -Infinity), new Vector3(Infinity, Infinity, Infinity));
+ return;
+ }
+ if (position !== void 0) {
+ this.boundingBox.setFromBufferAttribute(position);
+ if (morphAttributesPosition) {
+ for (let i = 0, il = morphAttributesPosition.length; i < il; i++) {
+ const morphAttribute = morphAttributesPosition[i];
+ _box$1.setFromBufferAttribute(morphAttribute);
+ if (this.morphTargetsRelative) {
+ _vector$8.addVectors(this.boundingBox.min, _box$1.min);
+ this.boundingBox.expandByPoint(_vector$8);
+ _vector$8.addVectors(this.boundingBox.max, _box$1.max);
+ this.boundingBox.expandByPoint(_vector$8);
+ } else {
+ this.boundingBox.expandByPoint(_box$1.min);
+ this.boundingBox.expandByPoint(_box$1.max);
+ }
+ }
+ }
+ } else {
+ this.boundingBox.makeEmpty();
+ }
+ if (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) {
+ console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this);
+ }
+ }
+ computeBoundingSphere() {
+ if (this.boundingSphere === null) {
+ this.boundingSphere = new Sphere();
+ }
+ const position = this.attributes.position;
+ const morphAttributesPosition = this.morphAttributes.position;
+ if (position && position.isGLBufferAttribute) {
+ console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this);
+ this.boundingSphere.set(new Vector3(), Infinity);
+ return;
+ }
+ if (position) {
+ const center = this.boundingSphere.center;
+ _box$1.setFromBufferAttribute(position);
+ if (morphAttributesPosition) {
+ for (let i = 0, il = morphAttributesPosition.length; i < il; i++) {
+ const morphAttribute = morphAttributesPosition[i];
+ _boxMorphTargets.setFromBufferAttribute(morphAttribute);
+ if (this.morphTargetsRelative) {
+ _vector$8.addVectors(_box$1.min, _boxMorphTargets.min);
+ _box$1.expandByPoint(_vector$8);
+ _vector$8.addVectors(_box$1.max, _boxMorphTargets.max);
+ _box$1.expandByPoint(_vector$8);
+ } else {
+ _box$1.expandByPoint(_boxMorphTargets.min);
+ _box$1.expandByPoint(_boxMorphTargets.max);
+ }
+ }
+ }
+ _box$1.getCenter(center);
+ let maxRadiusSq = 0;
+ for (let i = 0, il = position.count; i < il; i++) {
+ _vector$8.fromBufferAttribute(position, i);
+ maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8));
+ }
+ if (morphAttributesPosition) {
+ for (let i = 0, il = morphAttributesPosition.length; i < il; i++) {
+ const morphAttribute = morphAttributesPosition[i];
+ const morphTargetsRelative = this.morphTargetsRelative;
+ for (let j2 = 0, jl = morphAttribute.count; j2 < jl; j2++) {
+ _vector$8.fromBufferAttribute(morphAttribute, j2);
+ if (morphTargetsRelative) {
+ _offset.fromBufferAttribute(position, j2);
+ _vector$8.add(_offset);
+ }
+ maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8));
+ }
+ }
+ }
+ this.boundingSphere.radius = Math.sqrt(maxRadiusSq);
+ if (isNaN(this.boundingSphere.radius)) {
+ console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this);
+ }
+ }
+ }
+ computeTangents() {
+ const index = this.index;
+ const attributes = this.attributes;
+ if (index === null || attributes.position === void 0 || attributes.normal === void 0 || attributes.uv === void 0) {
+ console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
+ return;
+ }
+ const indices = index.array;
+ const positions = attributes.position.array;
+ const normals = attributes.normal.array;
+ const uvs = attributes.uv.array;
+ const nVertices = positions.length / 3;
+ if (this.hasAttribute("tangent") === false) {
+ this.setAttribute("tangent", new BufferAttribute(new Float32Array(4 * nVertices), 4));
+ }
+ const tangents = this.getAttribute("tangent").array;
+ const tan1 = [], tan2 = [];
+ for (let i = 0; i < nVertices; i++) {
+ tan1[i] = new Vector3();
+ tan2[i] = new Vector3();
+ }
+ const vA = new Vector3(), vB = new Vector3(), vC = new Vector3(), uvA = new Vector2(), uvB = new Vector2(), uvC = new Vector2(), sdir = new Vector3(), tdir = new Vector3();
+ function handleTriangle(a2, b3, c2) {
+ vA.fromArray(positions, a2 * 3);
+ vB.fromArray(positions, b3 * 3);
+ vC.fromArray(positions, c2 * 3);
+ uvA.fromArray(uvs, a2 * 2);
+ uvB.fromArray(uvs, b3 * 2);
+ uvC.fromArray(uvs, c2 * 2);
+ vB.sub(vA);
+ vC.sub(vA);
+ uvB.sub(uvA);
+ uvC.sub(uvA);
+ const r2 = 1 / (uvB.x * uvC.y - uvC.x * uvB.y);
+ if (!isFinite(r2))
+ return;
+ sdir.copy(vB).multiplyScalar(uvC.y).addScaledVector(vC, -uvB.y).multiplyScalar(r2);
+ tdir.copy(vC).multiplyScalar(uvB.x).addScaledVector(vB, -uvC.x).multiplyScalar(r2);
+ tan1[a2].add(sdir);
+ tan1[b3].add(sdir);
+ tan1[c2].add(sdir);
+ tan2[a2].add(tdir);
+ tan2[b3].add(tdir);
+ tan2[c2].add(tdir);
+ }
+ let groups = this.groups;
+ if (groups.length === 0) {
+ groups = [{
+ start: 0,
+ count: indices.length
+ }];
+ }
+ for (let i = 0, il = groups.length; i < il; ++i) {
+ const group = groups[i];
+ const start = group.start;
+ const count = group.count;
+ for (let j2 = start, jl = start + count; j2 < jl; j2 += 3) {
+ handleTriangle(indices[j2 + 0], indices[j2 + 1], indices[j2 + 2]);
+ }
+ }
+ const tmp2 = new Vector3(), tmp22 = new Vector3();
+ const n2 = new Vector3(), n22 = new Vector3();
+ function handleVertex(v2) {
+ n2.fromArray(normals, v2 * 3);
+ n22.copy(n2);
+ const t2 = tan1[v2];
+ tmp2.copy(t2);
+ tmp2.sub(n2.multiplyScalar(n2.dot(t2))).normalize();
+ tmp22.crossVectors(n22, t2);
+ const test = tmp22.dot(tan2[v2]);
+ const w2 = test < 0 ? -1 : 1;
+ tangents[v2 * 4] = tmp2.x;
+ tangents[v2 * 4 + 1] = tmp2.y;
+ tangents[v2 * 4 + 2] = tmp2.z;
+ tangents[v2 * 4 + 3] = w2;
+ }
+ for (let i = 0, il = groups.length; i < il; ++i) {
+ const group = groups[i];
+ const start = group.start;
+ const count = group.count;
+ for (let j2 = start, jl = start + count; j2 < jl; j2 += 3) {
+ handleVertex(indices[j2 + 0]);
+ handleVertex(indices[j2 + 1]);
+ handleVertex(indices[j2 + 2]);
+ }
+ }
+ }
+ computeVertexNormals() {
+ const index = this.index;
+ const positionAttribute = this.getAttribute("position");
+ if (positionAttribute !== void 0) {
+ let normalAttribute = this.getAttribute("normal");
+ if (normalAttribute === void 0) {
+ normalAttribute = new BufferAttribute(new Float32Array(positionAttribute.count * 3), 3);
+ this.setAttribute("normal", normalAttribute);
+ } else {
+ for (let i = 0, il = normalAttribute.count; i < il; i++) {
+ normalAttribute.setXYZ(i, 0, 0, 0);
+ }
+ }
+ const pA = new Vector3(), pB = new Vector3(), pC = new Vector3();
+ const nA = new Vector3(), nB = new Vector3(), nC = new Vector3();
+ const cb = new Vector3(), ab = new Vector3();
+ if (index) {
+ for (let i = 0, il = index.count; i < il; i += 3) {
+ const vA = index.getX(i + 0);
+ const vB = index.getX(i + 1);
+ const vC = index.getX(i + 2);
+ pA.fromBufferAttribute(positionAttribute, vA);
+ pB.fromBufferAttribute(positionAttribute, vB);
+ pC.fromBufferAttribute(positionAttribute, vC);
+ cb.subVectors(pC, pB);
+ ab.subVectors(pA, pB);
+ cb.cross(ab);
+ nA.fromBufferAttribute(normalAttribute, vA);
+ nB.fromBufferAttribute(normalAttribute, vB);
+ nC.fromBufferAttribute(normalAttribute, vC);
+ nA.add(cb);
+ nB.add(cb);
+ nC.add(cb);
+ normalAttribute.setXYZ(vA, nA.x, nA.y, nA.z);
+ normalAttribute.setXYZ(vB, nB.x, nB.y, nB.z);
+ normalAttribute.setXYZ(vC, nC.x, nC.y, nC.z);
+ }
+ } else {
+ for (let i = 0, il = positionAttribute.count; i < il; i += 3) {
+ pA.fromBufferAttribute(positionAttribute, i + 0);
+ pB.fromBufferAttribute(positionAttribute, i + 1);
+ pC.fromBufferAttribute(positionAttribute, i + 2);
+ cb.subVectors(pC, pB);
+ ab.subVectors(pA, pB);
+ cb.cross(ab);
+ normalAttribute.setXYZ(i + 0, cb.x, cb.y, cb.z);
+ normalAttribute.setXYZ(i + 1, cb.x, cb.y, cb.z);
+ normalAttribute.setXYZ(i + 2, cb.x, cb.y, cb.z);
+ }
+ }
+ this.normalizeNormals();
+ normalAttribute.needsUpdate = true;
+ }
+ }
+ merge(geometry, offset) {
+ if (!(geometry && geometry.isBufferGeometry)) {
+ console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", geometry);
+ return;
+ }
+ if (offset === void 0) {
+ offset = 0;
+ console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.");
+ }
+ const attributes = this.attributes;
+ for (const key in attributes) {
+ if (geometry.attributes[key] === void 0)
+ continue;
+ const attribute1 = attributes[key];
+ const attributeArray1 = attribute1.array;
+ const attribute2 = geometry.attributes[key];
+ const attributeArray2 = attribute2.array;
+ const attributeOffset = attribute2.itemSize * offset;
+ const length = Math.min(attributeArray2.length, attributeArray1.length - attributeOffset);
+ for (let i = 0, j2 = attributeOffset; i < length; i++, j2++) {
+ attributeArray1[j2] = attributeArray2[i];
+ }
+ }
+ return this;
+ }
+ normalizeNormals() {
+ const normals = this.attributes.normal;
+ for (let i = 0, il = normals.count; i < il; i++) {
+ _vector$8.fromBufferAttribute(normals, i);
+ _vector$8.normalize();
+ normals.setXYZ(i, _vector$8.x, _vector$8.y, _vector$8.z);
+ }
+ }
+ toNonIndexed() {
+ function convertBufferAttribute(attribute, indices2) {
+ const array = attribute.array;
+ const itemSize = attribute.itemSize;
+ const normalized = attribute.normalized;
+ const array2 = new array.constructor(indices2.length * itemSize);
+ let index = 0, index2 = 0;
+ for (let i = 0, l2 = indices2.length; i < l2; i++) {
+ if (attribute.isInterleavedBufferAttribute) {
+ index = indices2[i] * attribute.data.stride + attribute.offset;
+ } else {
+ index = indices2[i] * itemSize;
+ }
+ for (let j2 = 0; j2 < itemSize; j2++) {
+ array2[index2++] = array[index++];
+ }
+ }
+ return new BufferAttribute(array2, itemSize, normalized);
+ }
+ if (this.index === null) {
+ console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.");
+ return this;
+ }
+ const geometry2 = new BufferGeometry();
+ const indices = this.index.array;
+ const attributes = this.attributes;
+ for (const name in attributes) {
+ const attribute = attributes[name];
+ const newAttribute = convertBufferAttribute(attribute, indices);
+ geometry2.setAttribute(name, newAttribute);
+ }
+ const morphAttributes = this.morphAttributes;
+ for (const name in morphAttributes) {
+ const morphArray = [];
+ const morphAttribute = morphAttributes[name];
+ for (let i = 0, il = morphAttribute.length; i < il; i++) {
+ const attribute = morphAttribute[i];
+ const newAttribute = convertBufferAttribute(attribute, indices);
+ morphArray.push(newAttribute);
+ }
+ geometry2.morphAttributes[name] = morphArray;
+ }
+ geometry2.morphTargetsRelative = this.morphTargetsRelative;
+ const groups = this.groups;
+ for (let i = 0, l2 = groups.length; i < l2; i++) {
+ const group = groups[i];
+ geometry2.addGroup(group.start, group.count, group.materialIndex);
+ }
+ return geometry2;
+ }
+ toJSON() {
+ const data = {
+ metadata: {
+ version: 4.5,
+ type: "BufferGeometry",
+ generator: "BufferGeometry.toJSON"
+ }
+ };
+ data.uuid = this.uuid;
+ data.type = this.type;
+ if (this.name !== "")
+ data.name = this.name;
+ if (Object.keys(this.userData).length > 0)
+ data.userData = this.userData;
+ if (this.parameters !== void 0) {
+ const parameters = this.parameters;
+ for (const key in parameters) {
+ if (parameters[key] !== void 0)
+ data[key] = parameters[key];
+ }
+ return data;
+ }
+ data.data = { attributes: {} };
+ const index = this.index;
+ if (index !== null) {
+ data.data.index = {
+ type: index.array.constructor.name,
+ array: Array.prototype.slice.call(index.array)
+ };
+ }
+ const attributes = this.attributes;
+ for (const key in attributes) {
+ const attribute = attributes[key];
+ data.data.attributes[key] = attribute.toJSON(data.data);
+ }
+ const morphAttributes = {};
+ let hasMorphAttributes = false;
+ for (const key in this.morphAttributes) {
+ const attributeArray = this.morphAttributes[key];
+ const array = [];
+ for (let i = 0, il = attributeArray.length; i < il; i++) {
+ const attribute = attributeArray[i];
+ array.push(attribute.toJSON(data.data));
+ }
+ if (array.length > 0) {
+ morphAttributes[key] = array;
+ hasMorphAttributes = true;
+ }
+ }
+ if (hasMorphAttributes) {
+ data.data.morphAttributes = morphAttributes;
+ data.data.morphTargetsRelative = this.morphTargetsRelative;
+ }
+ const groups = this.groups;
+ if (groups.length > 0) {
+ data.data.groups = JSON.parse(JSON.stringify(groups));
+ }
+ const boundingSphere = this.boundingSphere;
+ if (boundingSphere !== null) {
+ data.data.boundingSphere = {
+ center: boundingSphere.center.toArray(),
+ radius: boundingSphere.radius
+ };
+ }
+ return data;
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+ copy(source) {
+ this.index = null;
+ this.attributes = {};
+ this.morphAttributes = {};
+ this.groups = [];
+ this.boundingBox = null;
+ this.boundingSphere = null;
+ const data = {};
+ this.name = source.name;
+ const index = source.index;
+ if (index !== null) {
+ this.setIndex(index.clone(data));
+ }
+ const attributes = source.attributes;
+ for (const name in attributes) {
+ const attribute = attributes[name];
+ this.setAttribute(name, attribute.clone(data));
+ }
+ const morphAttributes = source.morphAttributes;
+ for (const name in morphAttributes) {
+ const array = [];
+ const morphAttribute = morphAttributes[name];
+ for (let i = 0, l2 = morphAttribute.length; i < l2; i++) {
+ array.push(morphAttribute[i].clone(data));
+ }
+ this.morphAttributes[name] = array;
+ }
+ this.morphTargetsRelative = source.morphTargetsRelative;
+ const groups = source.groups;
+ for (let i = 0, l2 = groups.length; i < l2; i++) {
+ const group = groups[i];
+ this.addGroup(group.start, group.count, group.materialIndex);
+ }
+ const boundingBox = source.boundingBox;
+ if (boundingBox !== null) {
+ this.boundingBox = boundingBox.clone();
+ }
+ const boundingSphere = source.boundingSphere;
+ if (boundingSphere !== null) {
+ this.boundingSphere = boundingSphere.clone();
+ }
+ this.drawRange.start = source.drawRange.start;
+ this.drawRange.count = source.drawRange.count;
+ this.userData = source.userData;
+ if (source.parameters !== void 0)
+ this.parameters = Object.assign({}, source.parameters);
+ return this;
+ }
+ dispose() {
+ this.dispatchEvent({ type: "dispose" });
+ }
+}
+BufferGeometry.prototype.isBufferGeometry = true;
+const _inverseMatrix$2 = /* @__PURE__ */ new Matrix4();
+const _ray$2 = /* @__PURE__ */ new Ray();
+const _sphere$3 = /* @__PURE__ */ new Sphere();
+const _vA$1 = /* @__PURE__ */ new Vector3();
+const _vB$1 = /* @__PURE__ */ new Vector3();
+const _vC$1 = /* @__PURE__ */ new Vector3();
+const _tempA = /* @__PURE__ */ new Vector3();
+const _tempB = /* @__PURE__ */ new Vector3();
+const _tempC = /* @__PURE__ */ new Vector3();
+const _morphA = /* @__PURE__ */ new Vector3();
+const _morphB = /* @__PURE__ */ new Vector3();
+const _morphC = /* @__PURE__ */ new Vector3();
+const _uvA$1 = /* @__PURE__ */ new Vector2();
+const _uvB$1 = /* @__PURE__ */ new Vector2();
+const _uvC$1 = /* @__PURE__ */ new Vector2();
+const _intersectionPoint = /* @__PURE__ */ new Vector3();
+const _intersectionPointWorld = /* @__PURE__ */ new Vector3();
+class Mesh$1 extends Object3D$1 {
+ constructor(geometry = new BufferGeometry(), material = new MeshBasicMaterial()) {
+ super();
+ this.type = "Mesh";
+ this.geometry = geometry;
+ this.material = material;
+ this.updateMorphTargets();
+ }
+ copy(source) {
+ super.copy(source);
+ if (source.morphTargetInfluences !== void 0) {
+ this.morphTargetInfluences = source.morphTargetInfluences.slice();
+ }
+ if (source.morphTargetDictionary !== void 0) {
+ this.morphTargetDictionary = Object.assign({}, source.morphTargetDictionary);
+ }
+ this.material = source.material;
+ this.geometry = source.geometry;
+ return this;
+ }
+ updateMorphTargets() {
+ const geometry = this.geometry;
+ if (geometry.isBufferGeometry) {
+ const morphAttributes = geometry.morphAttributes;
+ const keys2 = Object.keys(morphAttributes);
+ if (keys2.length > 0) {
+ const morphAttribute = morphAttributes[keys2[0]];
+ if (morphAttribute !== void 0) {
+ this.morphTargetInfluences = [];
+ this.morphTargetDictionary = {};
+ for (let m2 = 0, ml = morphAttribute.length; m2 < ml; m2++) {
+ const name = morphAttribute[m2].name || String(m2);
+ this.morphTargetInfluences.push(0);
+ this.morphTargetDictionary[name] = m2;
+ }
+ }
+ }
+ } else {
+ const morphTargets = geometry.morphTargets;
+ if (morphTargets !== void 0 && morphTargets.length > 0) {
+ console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
+ }
+ }
+ }
+ raycast(raycaster, intersects2) {
+ const geometry = this.geometry;
+ const material = this.material;
+ const matrixWorld = this.matrixWorld;
+ if (material === void 0)
+ return;
+ if (geometry.boundingSphere === null)
+ geometry.computeBoundingSphere();
+ _sphere$3.copy(geometry.boundingSphere);
+ _sphere$3.applyMatrix4(matrixWorld);
+ if (raycaster.ray.intersectsSphere(_sphere$3) === false)
+ return;
+ _inverseMatrix$2.copy(matrixWorld).invert();
+ _ray$2.copy(raycaster.ray).applyMatrix4(_inverseMatrix$2);
+ if (geometry.boundingBox !== null) {
+ if (_ray$2.intersectsBox(geometry.boundingBox) === false)
+ return;
+ }
+ let intersection;
+ if (geometry.isBufferGeometry) {
+ const index = geometry.index;
+ const position = geometry.attributes.position;
+ const morphPosition = geometry.morphAttributes.position;
+ const morphTargetsRelative = geometry.morphTargetsRelative;
+ const uv = geometry.attributes.uv;
+ const uv2 = geometry.attributes.uv2;
+ const groups = geometry.groups;
+ const drawRange = geometry.drawRange;
+ if (index !== null) {
+ if (Array.isArray(material)) {
+ for (let i = 0, il = groups.length; i < il; i++) {
+ const group = groups[i];
+ const groupMaterial = material[group.materialIndex];
+ const start = Math.max(group.start, drawRange.start);
+ const end = Math.min(index.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));
+ for (let j2 = start, jl = end; j2 < jl; j2 += 3) {
+ const a2 = index.getX(j2);
+ const b3 = index.getX(j2 + 1);
+ const c2 = index.getX(j2 + 2);
+ intersection = checkBufferGeometryIntersection(this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a2, b3, c2);
+ if (intersection) {
+ intersection.faceIndex = Math.floor(j2 / 3);
+ intersection.face.materialIndex = group.materialIndex;
+ intersects2.push(intersection);
+ }
+ }
+ }
+ } else {
+ const start = Math.max(0, drawRange.start);
+ const end = Math.min(index.count, drawRange.start + drawRange.count);
+ for (let i = start, il = end; i < il; i += 3) {
+ const a2 = index.getX(i);
+ const b3 = index.getX(i + 1);
+ const c2 = index.getX(i + 2);
+ intersection = checkBufferGeometryIntersection(this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a2, b3, c2);
+ if (intersection) {
+ intersection.faceIndex = Math.floor(i / 3);
+ intersects2.push(intersection);
+ }
+ }
+ }
+ } else if (position !== void 0) {
+ if (Array.isArray(material)) {
+ for (let i = 0, il = groups.length; i < il; i++) {
+ const group = groups[i];
+ const groupMaterial = material[group.materialIndex];
+ const start = Math.max(group.start, drawRange.start);
+ const end = Math.min(position.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));
+ for (let j2 = start, jl = end; j2 < jl; j2 += 3) {
+ const a2 = j2;
+ const b3 = j2 + 1;
+ const c2 = j2 + 2;
+ intersection = checkBufferGeometryIntersection(this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a2, b3, c2);
+ if (intersection) {
+ intersection.faceIndex = Math.floor(j2 / 3);
+ intersection.face.materialIndex = group.materialIndex;
+ intersects2.push(intersection);
+ }
+ }
+ }
+ } else {
+ const start = Math.max(0, drawRange.start);
+ const end = Math.min(position.count, drawRange.start + drawRange.count);
+ for (let i = start, il = end; i < il; i += 3) {
+ const a2 = i;
+ const b3 = i + 1;
+ const c2 = i + 2;
+ intersection = checkBufferGeometryIntersection(this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a2, b3, c2);
+ if (intersection) {
+ intersection.faceIndex = Math.floor(i / 3);
+ intersects2.push(intersection);
+ }
+ }
+ }
+ }
+ } else if (geometry.isGeometry) {
+ console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
+ }
+ }
+}
+Mesh$1.prototype.isMesh = true;
+function checkIntersection(object, material, raycaster, ray, pA, pB, pC, point) {
+ let intersect;
+ if (material.side === BackSide) {
+ intersect = ray.intersectTriangle(pC, pB, pA, true, point);
+ } else {
+ intersect = ray.intersectTriangle(pA, pB, pC, material.side !== DoubleSide, point);
+ }
+ if (intersect === null)
+ return null;
+ _intersectionPointWorld.copy(point);
+ _intersectionPointWorld.applyMatrix4(object.matrixWorld);
+ const distance = raycaster.ray.origin.distanceTo(_intersectionPointWorld);
+ if (distance < raycaster.near || distance > raycaster.far)
+ return null;
+ return {
+ distance,
+ point: _intersectionPointWorld.clone(),
+ object
+ };
+}
+function checkBufferGeometryIntersection(object, material, raycaster, ray, position, morphPosition, morphTargetsRelative, uv, uv2, a2, b3, c2) {
+ _vA$1.fromBufferAttribute(position, a2);
+ _vB$1.fromBufferAttribute(position, b3);
+ _vC$1.fromBufferAttribute(position, c2);
+ const morphInfluences = object.morphTargetInfluences;
+ if (morphPosition && morphInfluences) {
+ _morphA.set(0, 0, 0);
+ _morphB.set(0, 0, 0);
+ _morphC.set(0, 0, 0);
+ for (let i = 0, il = morphPosition.length; i < il; i++) {
+ const influence = morphInfluences[i];
+ const morphAttribute = morphPosition[i];
+ if (influence === 0)
+ continue;
+ _tempA.fromBufferAttribute(morphAttribute, a2);
+ _tempB.fromBufferAttribute(morphAttribute, b3);
+ _tempC.fromBufferAttribute(morphAttribute, c2);
+ if (morphTargetsRelative) {
+ _morphA.addScaledVector(_tempA, influence);
+ _morphB.addScaledVector(_tempB, influence);
+ _morphC.addScaledVector(_tempC, influence);
+ } else {
+ _morphA.addScaledVector(_tempA.sub(_vA$1), influence);
+ _morphB.addScaledVector(_tempB.sub(_vB$1), influence);
+ _morphC.addScaledVector(_tempC.sub(_vC$1), influence);
+ }
+ }
+ _vA$1.add(_morphA);
+ _vB$1.add(_morphB);
+ _vC$1.add(_morphC);
+ }
+ if (object.isSkinnedMesh) {
+ object.boneTransform(a2, _vA$1);
+ object.boneTransform(b3, _vB$1);
+ object.boneTransform(c2, _vC$1);
+ }
+ const intersection = checkIntersection(object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint);
+ if (intersection) {
+ if (uv) {
+ _uvA$1.fromBufferAttribute(uv, a2);
+ _uvB$1.fromBufferAttribute(uv, b3);
+ _uvC$1.fromBufferAttribute(uv, c2);
+ intersection.uv = Triangle.getUV(_intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2());
+ }
+ if (uv2) {
+ _uvA$1.fromBufferAttribute(uv2, a2);
+ _uvB$1.fromBufferAttribute(uv2, b3);
+ _uvC$1.fromBufferAttribute(uv2, c2);
+ intersection.uv2 = Triangle.getUV(_intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2());
+ }
+ const face = {
+ a: a2,
+ b: b3,
+ c: c2,
+ normal: new Vector3(),
+ materialIndex: 0
+ };
+ Triangle.getNormal(_vA$1, _vB$1, _vC$1, face.normal);
+ intersection.face = face;
+ }
+ return intersection;
+}
+class BoxGeometry extends BufferGeometry {
+ constructor(width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1) {
+ super();
+ this.type = "BoxGeometry";
+ this.parameters = {
+ width,
+ height,
+ depth,
+ widthSegments,
+ heightSegments,
+ depthSegments
+ };
+ const scope = this;
+ widthSegments = Math.floor(widthSegments);
+ heightSegments = Math.floor(heightSegments);
+ depthSegments = Math.floor(depthSegments);
+ const indices = [];
+ const vertices = [];
+ const normals = [];
+ const uvs = [];
+ let numberOfVertices = 0;
+ let groupStart = 0;
+ buildPlane("z", "y", "x", -1, -1, depth, height, width, depthSegments, heightSegments, 0);
+ buildPlane("z", "y", "x", 1, -1, depth, height, -width, depthSegments, heightSegments, 1);
+ buildPlane("x", "z", "y", 1, 1, width, depth, height, widthSegments, depthSegments, 2);
+ buildPlane("x", "z", "y", 1, -1, width, depth, -height, widthSegments, depthSegments, 3);
+ buildPlane("x", "y", "z", 1, -1, width, height, depth, widthSegments, heightSegments, 4);
+ buildPlane("x", "y", "z", -1, -1, width, height, -depth, widthSegments, heightSegments, 5);
+ this.setIndex(indices);
+ this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
+ this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
+ this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
+ function buildPlane(u2, v2, w2, udir, vdir, width2, height2, depth2, gridX, gridY, materialIndex) {
+ const segmentWidth = width2 / gridX;
+ const segmentHeight = height2 / gridY;
+ const widthHalf = width2 / 2;
+ const heightHalf = height2 / 2;
+ const depthHalf = depth2 / 2;
+ const gridX1 = gridX + 1;
+ const gridY1 = gridY + 1;
+ let vertexCounter = 0;
+ let groupCount = 0;
+ const vector = new Vector3();
+ for (let iy = 0; iy < gridY1; iy++) {
+ const y2 = iy * segmentHeight - heightHalf;
+ for (let ix = 0; ix < gridX1; ix++) {
+ const x = ix * segmentWidth - widthHalf;
+ vector[u2] = x * udir;
+ vector[v2] = y2 * vdir;
+ vector[w2] = depthHalf;
+ vertices.push(vector.x, vector.y, vector.z);
+ vector[u2] = 0;
+ vector[v2] = 0;
+ vector[w2] = depth2 > 0 ? 1 : -1;
+ normals.push(vector.x, vector.y, vector.z);
+ uvs.push(ix / gridX);
+ uvs.push(1 - iy / gridY);
+ vertexCounter += 1;
+ }
+ }
+ for (let iy = 0; iy < gridY; iy++) {
+ for (let ix = 0; ix < gridX; ix++) {
+ const a2 = numberOfVertices + ix + gridX1 * iy;
+ const b3 = numberOfVertices + ix + gridX1 * (iy + 1);
+ const c2 = numberOfVertices + (ix + 1) + gridX1 * (iy + 1);
+ const d2 = numberOfVertices + (ix + 1) + gridX1 * iy;
+ indices.push(a2, b3, d2);
+ indices.push(b3, c2, d2);
+ groupCount += 6;
+ }
+ }
+ scope.addGroup(groupStart, groupCount, materialIndex);
+ groupStart += groupCount;
+ numberOfVertices += vertexCounter;
+ }
+ }
+ static fromJSON(data) {
+ return new BoxGeometry(data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments);
+ }
+}
+function cloneUniforms(src) {
+ const dst = {};
+ for (const u2 in src) {
+ dst[u2] = {};
+ for (const p2 in src[u2]) {
+ const property2 = src[u2][p2];
+ if (property2 && (property2.isColor || property2.isMatrix3 || property2.isMatrix4 || property2.isVector2 || property2.isVector3 || property2.isVector4 || property2.isTexture || property2.isQuaternion)) {
+ dst[u2][p2] = property2.clone();
+ } else if (Array.isArray(property2)) {
+ dst[u2][p2] = property2.slice();
+ } else {
+ dst[u2][p2] = property2;
+ }
+ }
+ }
+ return dst;
+}
+function mergeUniforms(uniforms) {
+ const merged = {};
+ for (let u2 = 0; u2 < uniforms.length; u2++) {
+ const tmp2 = cloneUniforms(uniforms[u2]);
+ for (const p2 in tmp2) {
+ merged[p2] = tmp2[p2];
+ }
+ }
+ return merged;
+}
+const UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };
+var default_vertex = "void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";
+var default_fragment = "void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";
+class ShaderMaterial extends Material {
+ constructor(parameters) {
+ super();
+ this.type = "ShaderMaterial";
+ this.defines = {};
+ this.uniforms = {};
+ this.vertexShader = default_vertex;
+ this.fragmentShader = default_fragment;
+ this.linewidth = 1;
+ this.wireframe = false;
+ this.wireframeLinewidth = 1;
+ this.fog = false;
+ this.lights = false;
+ this.clipping = false;
+ this.extensions = {
+ derivatives: false,
+ fragDepth: false,
+ drawBuffers: false,
+ shaderTextureLOD: false
+ };
+ this.defaultAttributeValues = {
+ "color": [1, 1, 1],
+ "uv": [0, 0],
+ "uv2": [0, 0]
+ };
+ this.index0AttributeName = void 0;
+ this.uniformsNeedUpdate = false;
+ this.glslVersion = null;
+ if (parameters !== void 0) {
+ if (parameters.attributes !== void 0) {
+ console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.");
+ }
+ this.setValues(parameters);
+ }
+ }
+ copy(source) {
+ super.copy(source);
+ this.fragmentShader = source.fragmentShader;
+ this.vertexShader = source.vertexShader;
+ this.uniforms = cloneUniforms(source.uniforms);
+ this.defines = Object.assign({}, source.defines);
+ this.wireframe = source.wireframe;
+ this.wireframeLinewidth = source.wireframeLinewidth;
+ this.lights = source.lights;
+ this.clipping = source.clipping;
+ this.extensions = Object.assign({}, source.extensions);
+ this.glslVersion = source.glslVersion;
+ return this;
+ }
+ toJSON(meta) {
+ const data = super.toJSON(meta);
+ data.glslVersion = this.glslVersion;
+ data.uniforms = {};
+ for (const name in this.uniforms) {
+ const uniform = this.uniforms[name];
+ const value = uniform.value;
+ if (value && value.isTexture) {
+ data.uniforms[name] = {
+ type: "t",
+ value: value.toJSON(meta).uuid
+ };
+ } else if (value && value.isColor) {
+ data.uniforms[name] = {
+ type: "c",
+ value: value.getHex()
+ };
+ } else if (value && value.isVector2) {
+ data.uniforms[name] = {
+ type: "v2",
+ value: value.toArray()
+ };
+ } else if (value && value.isVector3) {
+ data.uniforms[name] = {
+ type: "v3",
+ value: value.toArray()
+ };
+ } else if (value && value.isVector4) {
+ data.uniforms[name] = {
+ type: "v4",
+ value: value.toArray()
+ };
+ } else if (value && value.isMatrix3) {
+ data.uniforms[name] = {
+ type: "m3",
+ value: value.toArray()
+ };
+ } else if (value && value.isMatrix4) {
+ data.uniforms[name] = {
+ type: "m4",
+ value: value.toArray()
+ };
+ } else {
+ data.uniforms[name] = {
+ value
+ };
+ }
+ }
+ if (Object.keys(this.defines).length > 0)
+ data.defines = this.defines;
+ data.vertexShader = this.vertexShader;
+ data.fragmentShader = this.fragmentShader;
+ const extensions = {};
+ for (const key in this.extensions) {
+ if (this.extensions[key] === true)
+ extensions[key] = true;
+ }
+ if (Object.keys(extensions).length > 0)
+ data.extensions = extensions;
+ return data;
+ }
+}
+ShaderMaterial.prototype.isShaderMaterial = true;
+class Camera$1 extends Object3D$1 {
+ constructor() {
+ super();
+ this.type = "Camera";
+ this.matrixWorldInverse = new Matrix4();
+ this.projectionMatrix = new Matrix4();
+ this.projectionMatrixInverse = new Matrix4();
+ }
+ copy(source, recursive) {
+ super.copy(source, recursive);
+ this.matrixWorldInverse.copy(source.matrixWorldInverse);
+ this.projectionMatrix.copy(source.projectionMatrix);
+ this.projectionMatrixInverse.copy(source.projectionMatrixInverse);
+ return this;
+ }
+ getWorldDirection(target) {
+ this.updateWorldMatrix(true, false);
+ const e2 = this.matrixWorld.elements;
+ return target.set(-e2[8], -e2[9], -e2[10]).normalize();
+ }
+ updateMatrixWorld(force) {
+ super.updateMatrixWorld(force);
+ this.matrixWorldInverse.copy(this.matrixWorld).invert();
+ }
+ updateWorldMatrix(updateParents, updateChildren) {
+ super.updateWorldMatrix(updateParents, updateChildren);
+ this.matrixWorldInverse.copy(this.matrixWorld).invert();
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+}
+Camera$1.prototype.isCamera = true;
+class PerspectiveCamera$1 extends Camera$1 {
+ constructor(fov2 = 50, aspect2 = 1, near = 0.1, far = 2e3) {
+ super();
+ this.type = "PerspectiveCamera";
+ this.fov = fov2;
+ this.zoom = 1;
+ this.near = near;
+ this.far = far;
+ this.focus = 10;
+ this.aspect = aspect2;
+ this.view = null;
+ this.filmGauge = 35;
+ this.filmOffset = 0;
+ this.updateProjectionMatrix();
+ }
+ copy(source, recursive) {
+ super.copy(source, recursive);
+ this.fov = source.fov;
+ this.zoom = source.zoom;
+ this.near = source.near;
+ this.far = source.far;
+ this.focus = source.focus;
+ this.aspect = source.aspect;
+ this.view = source.view === null ? null : Object.assign({}, source.view);
+ this.filmGauge = source.filmGauge;
+ this.filmOffset = source.filmOffset;
+ return this;
+ }
+ setFocalLength(focalLength) {
+ const vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;
+ this.fov = RAD2DEG * 2 * Math.atan(vExtentSlope);
+ this.updateProjectionMatrix();
+ }
+ getFocalLength() {
+ const vExtentSlope = Math.tan(DEG2RAD * 0.5 * this.fov);
+ return 0.5 * this.getFilmHeight() / vExtentSlope;
+ }
+ getEffectiveFOV() {
+ return RAD2DEG * 2 * Math.atan(Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom);
+ }
+ getFilmWidth() {
+ return this.filmGauge * Math.min(this.aspect, 1);
+ }
+ getFilmHeight() {
+ return this.filmGauge / Math.max(this.aspect, 1);
+ }
+ setViewOffset(fullWidth, fullHeight, x, y2, width, height) {
+ this.aspect = fullWidth / fullHeight;
+ if (this.view === null) {
+ this.view = {
+ enabled: true,
+ fullWidth: 1,
+ fullHeight: 1,
+ offsetX: 0,
+ offsetY: 0,
+ width: 1,
+ height: 1
+ };
+ }
+ this.view.enabled = true;
+ this.view.fullWidth = fullWidth;
+ this.view.fullHeight = fullHeight;
+ this.view.offsetX = x;
+ this.view.offsetY = y2;
+ this.view.width = width;
+ this.view.height = height;
+ this.updateProjectionMatrix();
+ }
+ clearViewOffset() {
+ if (this.view !== null) {
+ this.view.enabled = false;
+ }
+ this.updateProjectionMatrix();
+ }
+ updateProjectionMatrix() {
+ const near = this.near;
+ let top = near * Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom;
+ let height = 2 * top;
+ let width = this.aspect * height;
+ let left = -0.5 * width;
+ const view = this.view;
+ if (this.view !== null && this.view.enabled) {
+ const fullWidth = view.fullWidth, fullHeight = view.fullHeight;
+ left += view.offsetX * width / fullWidth;
+ top -= view.offsetY * height / fullHeight;
+ width *= view.width / fullWidth;
+ height *= view.height / fullHeight;
+ }
+ const skew = this.filmOffset;
+ if (skew !== 0)
+ left += near * skew / this.getFilmWidth();
+ this.projectionMatrix.makePerspective(left, left + width, top, top - height, near, this.far);
+ this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
+ }
+ toJSON(meta) {
+ const data = super.toJSON(meta);
+ data.object.fov = this.fov;
+ data.object.zoom = this.zoom;
+ data.object.near = this.near;
+ data.object.far = this.far;
+ data.object.focus = this.focus;
+ data.object.aspect = this.aspect;
+ if (this.view !== null)
+ data.object.view = Object.assign({}, this.view);
+ data.object.filmGauge = this.filmGauge;
+ data.object.filmOffset = this.filmOffset;
+ return data;
+ }
+}
+PerspectiveCamera$1.prototype.isPerspectiveCamera = true;
+const fov = 90, aspect = 1;
+class CubeCamera extends Object3D$1 {
+ constructor(near, far, renderTarget) {
+ super();
+ this.type = "CubeCamera";
+ if (renderTarget.isWebGLCubeRenderTarget !== true) {
+ console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");
+ return;
+ }
+ this.renderTarget = renderTarget;
+ const cameraPX = new PerspectiveCamera$1(fov, aspect, near, far);
+ cameraPX.layers = this.layers;
+ cameraPX.up.set(0, -1, 0);
+ cameraPX.lookAt(new Vector3(1, 0, 0));
+ this.add(cameraPX);
+ const cameraNX = new PerspectiveCamera$1(fov, aspect, near, far);
+ cameraNX.layers = this.layers;
+ cameraNX.up.set(0, -1, 0);
+ cameraNX.lookAt(new Vector3(-1, 0, 0));
+ this.add(cameraNX);
+ const cameraPY = new PerspectiveCamera$1(fov, aspect, near, far);
+ cameraPY.layers = this.layers;
+ cameraPY.up.set(0, 0, 1);
+ cameraPY.lookAt(new Vector3(0, 1, 0));
+ this.add(cameraPY);
+ const cameraNY = new PerspectiveCamera$1(fov, aspect, near, far);
+ cameraNY.layers = this.layers;
+ cameraNY.up.set(0, 0, -1);
+ cameraNY.lookAt(new Vector3(0, -1, 0));
+ this.add(cameraNY);
+ const cameraPZ = new PerspectiveCamera$1(fov, aspect, near, far);
+ cameraPZ.layers = this.layers;
+ cameraPZ.up.set(0, -1, 0);
+ cameraPZ.lookAt(new Vector3(0, 0, 1));
+ this.add(cameraPZ);
+ const cameraNZ = new PerspectiveCamera$1(fov, aspect, near, far);
+ cameraNZ.layers = this.layers;
+ cameraNZ.up.set(0, -1, 0);
+ cameraNZ.lookAt(new Vector3(0, 0, -1));
+ this.add(cameraNZ);
+ }
+ update(renderer2, scene) {
+ if (this.parent === null)
+ this.updateMatrixWorld();
+ const renderTarget = this.renderTarget;
+ const [cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ] = this.children;
+ const currentXrEnabled = renderer2.xr.enabled;
+ const currentRenderTarget = renderer2.getRenderTarget();
+ renderer2.xr.enabled = false;
+ const generateMipmaps = renderTarget.texture.generateMipmaps;
+ renderTarget.texture.generateMipmaps = false;
+ renderer2.setRenderTarget(renderTarget, 0);
+ renderer2.render(scene, cameraPX);
+ renderer2.setRenderTarget(renderTarget, 1);
+ renderer2.render(scene, cameraNX);
+ renderer2.setRenderTarget(renderTarget, 2);
+ renderer2.render(scene, cameraPY);
+ renderer2.setRenderTarget(renderTarget, 3);
+ renderer2.render(scene, cameraNY);
+ renderer2.setRenderTarget(renderTarget, 4);
+ renderer2.render(scene, cameraPZ);
+ renderTarget.texture.generateMipmaps = generateMipmaps;
+ renderer2.setRenderTarget(renderTarget, 5);
+ renderer2.render(scene, cameraNZ);
+ renderer2.setRenderTarget(currentRenderTarget);
+ renderer2.xr.enabled = currentXrEnabled;
+ renderTarget.texture.needsPMREMUpdate = true;
+ }
+}
+class CubeTexture extends Texture$1 {
+ constructor(images, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy, encoding) {
+ images = images !== void 0 ? images : [];
+ mapping = mapping !== void 0 ? mapping : CubeReflectionMapping;
+ super(images, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy, encoding);
+ this.flipY = false;
+ }
+ get images() {
+ return this.image;
+ }
+ set images(value) {
+ this.image = value;
+ }
+}
+CubeTexture.prototype.isCubeTexture = true;
+class WebGLCubeRenderTarget extends WebGLRenderTarget {
+ constructor(size2, options = {}) {
+ super(size2, size2, options);
+ const image = { width: size2, height: size2, depth: 1 };
+ const images = [image, image, image, image, image, image];
+ this.texture = new CubeTexture(images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding);
+ this.texture.isRenderTargetTexture = true;
+ this.texture.generateMipmaps = options.generateMipmaps !== void 0 ? options.generateMipmaps : false;
+ this.texture.minFilter = options.minFilter !== void 0 ? options.minFilter : LinearFilter;
+ }
+ fromEquirectangularTexture(renderer2, texture) {
+ this.texture.type = texture.type;
+ this.texture.format = RGBAFormat;
+ this.texture.encoding = texture.encoding;
+ this.texture.generateMipmaps = texture.generateMipmaps;
+ this.texture.minFilter = texture.minFilter;
+ this.texture.magFilter = texture.magFilter;
+ const shader = {
+ 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 );
+
+ }
+ `
+ };
+ const geometry = new BoxGeometry(5, 5, 5);
+ const material = new ShaderMaterial({
+ name: "CubemapFromEquirect",
+ uniforms: cloneUniforms(shader.uniforms),
+ vertexShader: shader.vertexShader,
+ fragmentShader: shader.fragmentShader,
+ side: BackSide,
+ blending: NoBlending
+ });
+ material.uniforms.tEquirect.value = texture;
+ const mesh = new Mesh$1(geometry, material);
+ const currentMinFilter = texture.minFilter;
+ if (texture.minFilter === LinearMipmapLinearFilter)
+ texture.minFilter = LinearFilter;
+ const camera = new CubeCamera(1, 10, this);
+ camera.update(renderer2, mesh);
+ texture.minFilter = currentMinFilter;
+ mesh.geometry.dispose();
+ mesh.material.dispose();
+ return this;
+ }
+ clear(renderer2, color, depth, stencil) {
+ const currentRenderTarget = renderer2.getRenderTarget();
+ for (let i = 0; i < 6; i++) {
+ renderer2.setRenderTarget(this, i);
+ renderer2.clear(color, depth, stencil);
+ }
+ renderer2.setRenderTarget(currentRenderTarget);
+ }
+}
+WebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget = true;
+const _vector1 = /* @__PURE__ */ new Vector3();
+const _vector2 = /* @__PURE__ */ new Vector3();
+const _normalMatrix = /* @__PURE__ */ new Matrix3();
+class Plane {
+ constructor(normal = new Vector3(1, 0, 0), constant = 0) {
+ this.normal = normal;
+ this.constant = constant;
+ }
+ set(normal, constant) {
+ this.normal.copy(normal);
+ this.constant = constant;
+ return this;
+ }
+ setComponents(x, y2, z2, w2) {
+ this.normal.set(x, y2, z2);
+ this.constant = w2;
+ return this;
+ }
+ setFromNormalAndCoplanarPoint(normal, point) {
+ this.normal.copy(normal);
+ this.constant = -point.dot(this.normal);
+ return this;
+ }
+ setFromCoplanarPoints(a2, b3, c2) {
+ const normal = _vector1.subVectors(c2, b3).cross(_vector2.subVectors(a2, b3)).normalize();
+ this.setFromNormalAndCoplanarPoint(normal, a2);
+ return this;
+ }
+ copy(plane) {
+ this.normal.copy(plane.normal);
+ this.constant = plane.constant;
+ return this;
+ }
+ normalize() {
+ const inverseNormalLength = 1 / this.normal.length();
+ this.normal.multiplyScalar(inverseNormalLength);
+ this.constant *= inverseNormalLength;
+ return this;
+ }
+ negate() {
+ this.constant *= -1;
+ this.normal.negate();
+ return this;
+ }
+ distanceToPoint(point) {
+ return this.normal.dot(point) + this.constant;
+ }
+ distanceToSphere(sphere) {
+ return this.distanceToPoint(sphere.center) - sphere.radius;
+ }
+ projectPoint(point, target) {
+ return target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point);
+ }
+ intersectLine(line, target) {
+ const direction = line.delta(_vector1);
+ const denominator = this.normal.dot(direction);
+ if (denominator === 0) {
+ if (this.distanceToPoint(line.start) === 0) {
+ return target.copy(line.start);
+ }
+ return null;
+ }
+ const t2 = -(line.start.dot(this.normal) + this.constant) / denominator;
+ if (t2 < 0 || t2 > 1) {
+ return null;
+ }
+ return target.copy(direction).multiplyScalar(t2).add(line.start);
+ }
+ intersectsLine(line) {
+ const startSign = this.distanceToPoint(line.start);
+ const endSign = this.distanceToPoint(line.end);
+ return startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;
+ }
+ intersectsBox(box) {
+ return box.intersectsPlane(this);
+ }
+ intersectsSphere(sphere) {
+ return sphere.intersectsPlane(this);
+ }
+ coplanarPoint(target) {
+ return target.copy(this.normal).multiplyScalar(-this.constant);
+ }
+ applyMatrix4(matrix, optionalNormalMatrix) {
+ const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);
+ const referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);
+ const normal = this.normal.applyMatrix3(normalMatrix).normalize();
+ this.constant = -referencePoint.dot(normal);
+ return this;
+ }
+ translate(offset) {
+ this.constant -= offset.dot(this.normal);
+ return this;
+ }
+ equals(plane) {
+ return plane.normal.equals(this.normal) && plane.constant === this.constant;
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+}
+Plane.prototype.isPlane = true;
+const _sphere$2 = /* @__PURE__ */ new Sphere();
+const _vector$7 = /* @__PURE__ */ new Vector3();
+class Frustum {
+ constructor(p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane()) {
+ this.planes = [p0, p1, p2, p3, p4, p5];
+ }
+ set(p0, p1, p2, p3, p4, p5) {
+ const planes = this.planes;
+ planes[0].copy(p0);
+ planes[1].copy(p1);
+ planes[2].copy(p2);
+ planes[3].copy(p3);
+ planes[4].copy(p4);
+ planes[5].copy(p5);
+ return this;
+ }
+ copy(frustum) {
+ const planes = this.planes;
+ for (let i = 0; i < 6; i++) {
+ planes[i].copy(frustum.planes[i]);
+ }
+ return this;
+ }
+ setFromProjectionMatrix(m2) {
+ const planes = this.planes;
+ const me2 = m2.elements;
+ const me0 = me2[0], me1 = me2[1], me22 = me2[2], me3 = me2[3];
+ const me4 = me2[4], me5 = me2[5], me6 = me2[6], me7 = me2[7];
+ const me8 = me2[8], me9 = me2[9], me10 = me2[10], me11 = me2[11];
+ const me12 = me2[12], me13 = me2[13], me14 = me2[14], me15 = me2[15];
+ planes[0].setComponents(me3 - me0, me7 - me4, me11 - me8, me15 - me12).normalize();
+ planes[1].setComponents(me3 + me0, me7 + me4, me11 + me8, me15 + me12).normalize();
+ planes[2].setComponents(me3 + me1, me7 + me5, me11 + me9, me15 + me13).normalize();
+ planes[3].setComponents(me3 - me1, me7 - me5, me11 - me9, me15 - me13).normalize();
+ planes[4].setComponents(me3 - me22, me7 - me6, me11 - me10, me15 - me14).normalize();
+ planes[5].setComponents(me3 + me22, me7 + me6, me11 + me10, me15 + me14).normalize();
+ return this;
+ }
+ intersectsObject(object) {
+ const geometry = object.geometry;
+ if (geometry.boundingSphere === null)
+ geometry.computeBoundingSphere();
+ _sphere$2.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld);
+ return this.intersectsSphere(_sphere$2);
+ }
+ intersectsSprite(sprite) {
+ _sphere$2.center.set(0, 0, 0);
+ _sphere$2.radius = 0.7071067811865476;
+ _sphere$2.applyMatrix4(sprite.matrixWorld);
+ return this.intersectsSphere(_sphere$2);
+ }
+ intersectsSphere(sphere) {
+ const planes = this.planes;
+ const center = sphere.center;
+ const negRadius = -sphere.radius;
+ for (let i = 0; i < 6; i++) {
+ const distance = planes[i].distanceToPoint(center);
+ if (distance < negRadius) {
+ return false;
+ }
+ }
+ return true;
+ }
+ intersectsBox(box) {
+ const planes = this.planes;
+ for (let i = 0; i < 6; i++) {
+ const plane = planes[i];
+ _vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x;
+ _vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y;
+ _vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z;
+ if (plane.distanceToPoint(_vector$7) < 0) {
+ return false;
+ }
+ }
+ return true;
+ }
+ containsPoint(point) {
+ const planes = this.planes;
+ for (let i = 0; i < 6; i++) {
+ if (planes[i].distanceToPoint(point) < 0) {
+ return false;
+ }
+ }
+ return true;
+ }
+ clone() {
+ return new this.constructor().copy(this);
+ }
+}
+function WebGLAnimation() {
+ let context = null;
+ let isAnimating = false;
+ let animationLoop = null;
+ let requestId = null;
+ function onAnimationFrame(time, frame) {
+ animationLoop(time, frame);
+ requestId = context.requestAnimationFrame(onAnimationFrame);
+ }
+ return {
+ start: function() {
+ if (isAnimating === true)
+ return;
+ if (animationLoop === null)
+ return;
+ requestId = context.requestAnimationFrame(onAnimationFrame);
+ isAnimating = true;
+ },
+ stop: function() {
+ context.cancelAnimationFrame(requestId);
+ isAnimating = false;
+ },
+ setAnimationLoop: function(callback) {
+ animationLoop = callback;
+ },
+ setContext: function(value) {
+ context = value;
+ }
+ };
+}
+function WebGLAttributes(gl, capabilities) {
+ const isWebGL2 = capabilities.isWebGL2;
+ const buffers = /* @__PURE__ */ new WeakMap();
+ function createBuffer(attribute, bufferType) {
+ const array = attribute.array;
+ const usage = attribute.usage;
+ const buffer = gl.createBuffer();
+ gl.bindBuffer(bufferType, buffer);
+ gl.bufferData(bufferType, array, usage);
+ attribute.onUploadCallback();
+ let type;
+ if (array instanceof Float32Array) {
+ type = 5126;
+ } else if (array instanceof Uint16Array) {
+ if (attribute.isFloat16BufferAttribute) {
+ if (isWebGL2) {
+ type = 5131;
+ } else {
+ throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");
+ }
+ } else {
+ type = 5123;
+ }
+ } else if (array instanceof Int16Array) {
+ type = 5122;
+ } else if (array instanceof Uint32Array) {
+ type = 5125;
+ } else if (array instanceof Int32Array) {
+ type = 5124;
+ } else if (array instanceof Int8Array) {
+ type = 5120;
+ } else if (array instanceof Uint8Array) {
+ type = 5121;
+ } else if (array instanceof Uint8ClampedArray) {
+ type = 5121;
+ } else {
+ throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: " + array);
+ }
+ return {
+ buffer,
+ type,
+ bytesPerElement: array.BYTES_PER_ELEMENT,
+ version: attribute.version
+ };
+ }
+ function updateBuffer(buffer, attribute, bufferType) {
+ const array = attribute.array;
+ const updateRange = attribute.updateRange;
+ gl.bindBuffer(bufferType, buffer);
+ if (updateRange.count === -1) {
+ gl.bufferSubData(bufferType, 0, array);
+ } else {
+ if (isWebGL2) {
+ gl.bufferSubData(bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, array, updateRange.offset, updateRange.count);
+ } else {
+ gl.bufferSubData(bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, array.subarray(updateRange.offset, updateRange.offset + updateRange.count));
+ }
+ updateRange.count = -1;
+ }
+ }
+ function get2(attribute) {
+ if (attribute.isInterleavedBufferAttribute)
+ attribute = attribute.data;
+ return buffers.get(attribute);
+ }
+ function remove2(attribute) {
+ if (attribute.isInterleavedBufferAttribute)
+ attribute = attribute.data;
+ const data = buffers.get(attribute);
+ if (data) {
+ gl.deleteBuffer(data.buffer);
+ buffers.delete(attribute);
+ }
+ }
+ function update(attribute, bufferType) {
+ if (attribute.isGLBufferAttribute) {
+ const cached = buffers.get(attribute);
+ if (!cached || cached.version < attribute.version) {
+ buffers.set(attribute, {
+ buffer: attribute.buffer,
+ type: attribute.type,
+ bytesPerElement: attribute.elementSize,
+ version: attribute.version
+ });
+ }
+ return;
+ }
+ if (attribute.isInterleavedBufferAttribute)
+ attribute = attribute.data;
+ const data = buffers.get(attribute);
+ if (data === void 0) {
+ buffers.set(attribute, createBuffer(attribute, bufferType));
+ } else if (data.version < attribute.version) {
+ updateBuffer(data.buffer, attribute, bufferType);
+ data.version = attribute.version;
+ }
+ }
+ return {
+ get: get2,
+ remove: remove2,
+ update
+ };
+}
+class PlaneGeometry extends BufferGeometry {
+ constructor(width = 1, height = 1, widthSegments = 1, heightSegments = 1) {
+ super();
+ this.type = "PlaneGeometry";
+ this.parameters = {
+ width,
+ height,
+ widthSegments,
+ heightSegments
+ };
+ const width_half = width / 2;
+ const height_half = height / 2;
+ const gridX = Math.floor(widthSegments);
+ const gridY = Math.floor(heightSegments);
+ const gridX1 = gridX + 1;
+ const gridY1 = gridY + 1;
+ const segment_width = width / gridX;
+ const segment_height = height / gridY;
+ const indices = [];
+ const vertices = [];
+ const normals = [];
+ const uvs = [];
+ for (let iy = 0; iy < gridY1; iy++) {
+ const y2 = iy * segment_height - height_half;
+ for (let ix = 0; ix < gridX1; ix++) {
+ const x = ix * segment_width - width_half;
+ vertices.push(x, -y2, 0);
+ normals.push(0, 0, 1);
+ uvs.push(ix / gridX);
+ uvs.push(1 - iy / gridY);
+ }
+ }
+ for (let iy = 0; iy < gridY; iy++) {
+ for (let ix = 0; ix < gridX; ix++) {
+ const a2 = ix + gridX1 * iy;
+ const b3 = ix + gridX1 * (iy + 1);
+ const c2 = ix + 1 + gridX1 * (iy + 1);
+ const d2 = ix + 1 + gridX1 * iy;
+ indices.push(a2, b3, d2);
+ indices.push(b3, c2, d2);
+ }
+ }
+ this.setIndex(indices);
+ this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
+ this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
+ this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
+ }
+ static fromJSON(data) {
+ return new PlaneGeometry(data.width, data.height, data.widthSegments, data.heightSegments);
+ }
+}
+var alphamap_fragment = "#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif";
+var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif";
+var alphatest_fragment = "#ifdef USE_ALPHATEST\n if ( diffuseColor.a < alphaTest ) discard;\n#endif";
+var alphatest_pars_fragment = "#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif";
+var aomap_fragment = "#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif";
+var aomap_pars_fragment = "#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif";
+var begin_vertex = "vec3 transformed = vec3( position );";
+var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif";
+var bsdfs = "vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif";
+var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif";
+var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n#endif";
+var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif";
+var clipping_planes_pars_vertex = "#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif";
+var clipping_planes_vertex = "#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif";
+var color_fragment = "#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif";
+var color_pars_fragment = "#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif";
+var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n varying vec3 vColor;\n#endif";
+var color_vertex = "#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif";
+var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n vec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n return dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}";
+var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define r0 1.0\n #define v0 0.339\n #define m0 - 2.0\n #define r1 0.8\n #define v1 0.276\n #define m1 - 1.0\n #define r4 0.4\n #define v4 0.046\n #define m4 2.0\n #define r5 0.305\n #define v5 0.016\n #define m5 3.0\n #define r6 0.21\n #define v6 0.0038\n #define m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= r1 ) {\n mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n } else if ( roughness >= r4 ) {\n mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n } else if ( roughness >= r5 ) {\n mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n } else if ( roughness >= r6 ) {\n mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif";
+var defaultnormal_vertex = "vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n mat3 m = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n transformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif";
+var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif";
+var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif";
+var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vUv );\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif";
+var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif";
+var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
+var encodings_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}";
+var envmap_fragment = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif";
+var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif";
+var envmap_pars_fragment = "#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif";
+var envmap_pars_vertex = "#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif";
+var envmap_vertex = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif";
+var fog_vertex = "#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif";
+var fog_pars_vertex = "#ifdef USE_FOG\n varying float vFogDepth;\n#endif";
+var fog_fragment = "#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif";
+var fog_pars_fragment = "#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif";
+var gradientmap_pars_fragment = "#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n #endif\n}";
+var lightmap_fragment = "#ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n lightMapIrradiance *= PI;\n #endif\n reflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif";
+var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif";
+var lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n vLightBack = vec3( 0.0 );\n vIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n vIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n getPointLightInfo( pointLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n getSpotLightInfo( spotLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n getDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n #ifdef DOUBLE_SIDED\n vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n #endif\n }\n #pragma unroll_loop_end\n#endif";
+var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n #if defined ( PHYSICALLY_CORRECT_LIGHTS )\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n #else\n if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n }\n return 1.0;\n #endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometry.position;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometry.position;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif";
+var envmap_physical_pars_fragment = "#if defined( USE_ENVMAP )\n #ifdef ENVMAP_MODE_REFRACTION\n uniform float refractionRatio;\n #endif\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #if defined( ENVMAP_TYPE_CUBE_UV )\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #if defined( ENVMAP_TYPE_CUBE_UV )\n vec3 reflectVec;\n #ifdef ENVMAP_MODE_REFLECTION\n reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n #else\n reflectVec = refract( - viewDir, normal, refractionRatio );\n #endif\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n#endif";
+var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
+var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material ) (0)";
+var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;";
+var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material ) (0)";
+var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n #ifdef SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULARINTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n #endif\n #ifdef USE_SPECULARCOLORMAP\n specularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEENCOLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEENROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n #endif\n#endif";
+var lights_physical_pars_fragment = "struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n vec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometry.normal;\n vec3 viewDir = geometry.viewDir;\n vec3 position = geometry.position;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
+var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n geometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif";
+var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n lightMapIrradiance *= PI;\n #endif\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometry.normal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif";
+var lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif";
+var logdepthbuf_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif";
+var logdepthbuf_pars_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif";
+var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n varying float vFragDepth;\n varying float vIsPerspective;\n #else\n uniform float logDepthBufFC;\n #endif\n#endif";
+var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n #else\n if ( isPerspectiveMatrix( projectionMatrix ) ) {\n gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n gl_Position.z *= gl_Position.w;\n }\n #endif\n#endif";
+var map_fragment = "#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif";
+var map_pars_fragment = "#ifdef USE_MAP\n uniform sampler2D map;\n#endif";
+var map_particle_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif";
+var map_particle_pars_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif";
+var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vUv );\n metalnessFactor *= texelMetalness.b;\n#endif";
+var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif";
+var morphcolor_vertex = "#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]\n #endif\n }\n#endif";
+var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n #ifdef MORPHTARGETS_TEXTURE\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n #else\n objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n #endif\n#endif";
+var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n uniform float morphTargetBaseInfluence;\n #ifdef MORPHTARGETS_TEXTURE\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n uniform sampler2DArray morphTargetsTexture;\n uniform vec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n float texelIndex = float( vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset );\n float y = floor( texelIndex / morphTargetsTextureSize.x );\n float x = texelIndex - y * morphTargetsTextureSize.x;\n vec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n return texture( morphTargetsTexture, morphUV );\n }\n #else\n #ifndef USE_MORPHNORMALS\n uniform float morphTargetInfluences[ 8 ];\n #else\n uniform float morphTargetInfluences[ 4 ];\n #endif\n #endif\n#endif";
+var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n #ifdef MORPHTARGETS_TEXTURE\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n #else\n transformed += morphTarget0 * morphTargetInfluences[ 0 ];\n transformed += morphTarget1 * morphTargetInfluences[ 1 ];\n transformed += morphTarget2 * morphTargetInfluences[ 2 ];\n transformed += morphTarget3 * morphTargetInfluences[ 3 ];\n #ifndef USE_MORPHNORMALS\n transformed += morphTarget4 * morphTargetInfluences[ 4 ];\n transformed += morphTarget5 * morphTargetInfluences[ 5 ];\n transformed += morphTarget6 * morphTargetInfluences[ 6 ];\n transformed += morphTarget7 * morphTargetInfluences[ 7 ];\n #endif\n #endif\n#endif";
+var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n #ifdef USE_TANGENT\n vec3 tangent = normalize( vTangent );\n vec3 bitangent = normalize( vBitangent );\n #ifdef DOUBLE_SIDED\n tangent = tangent * faceDirection;\n bitangent = bitangent * faceDirection;\n #endif\n #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n mat3 vTBN = mat3( tangent, bitangent, normal );\n #endif\n #endif\n#endif\nvec3 geometryNormal = normal;";
+var normal_fragment_maps = "#ifdef OBJECTSPACE_NORMALMAP\n normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n #ifdef USE_TANGENT\n normal = normalize( vTBN * mapN );\n #else\n normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n #endif\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";
+var normal_pars_fragment = "#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif";
+var normal_pars_vertex = "#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif";
+var normal_vertex = "#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif";
+var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n }\n#endif";
+var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = geometryNormal;\n#endif";
+var clearcoat_normal_fragment_maps = "#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n #ifdef USE_TANGENT\n clearcoatNormal = normalize( vTBN * clearcoatMapN );\n #else\n clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n #endif\n#endif";
+var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif";
+var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";
+var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n vec4 r = vec4( fract( v * PackFactors ), v );\n r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}";
+var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif";
+var project_vertex = "vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;";
+var dithering_fragment = "#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif";
+var dithering_pars_fragment = "#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif";
+var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vUv );\n roughnessFactor *= texelRoughness.g;\n#endif";
+var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif";
+var shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n 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 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n bool frustumTest = all( frustumTestVec );\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return shadow;\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n vec3 lightToPosition = shadowCoord.xyz;\n float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n return (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n#endif";
+var shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif";
+var shadowmap_vertex = "#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n #endif\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif";
+var shadowmask_pars_fragment = "float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}";
+var skinbase_vertex = "#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif";
+var skinning_pars_vertex = "#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n #ifdef BONE_TEXTURE\n uniform highp sampler2D boneTexture;\n uniform int boneTextureSize;\n mat4 getBoneMatrix( const in float i ) {\n float j = i * 4.0;\n float x = mod( j, float( boneTextureSize ) );\n float y = floor( j / float( boneTextureSize ) );\n float dx = 1.0 / float( boneTextureSize );\n float dy = 1.0 / float( boneTextureSize );\n y = dy * ( y + 0.5 );\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n mat4 bone = mat4( v1, v2, v3, v4 );\n return bone;\n }\n #else\n uniform mat4 boneMatrices[ MAX_BONES ];\n mat4 getBoneMatrix( const in float i ) {\n mat4 bone = boneMatrices[ int(i) ];\n return bone;\n }\n #endif\n#endif";
+var skinning_vertex = "#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif";
+var skinnormal_vertex = "#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif";
+var specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif";
+var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif";
+var tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";
+var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
+var transmission_fragment = "#ifdef USE_TRANSMISSION\n float transmissionAlpha = 1.0;\n float transmissionFactor = transmission;\n float thicknessFactor = thickness;\n #ifdef USE_TRANSMISSIONMAP\n transmissionFactor *= texture2D( transmissionMap, vUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n thicknessFactor *= texture2D( thicknessMap, vUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmission = getIBLVolumeRefraction(\n n, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n attenuationColor, attenuationDistance );\n totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n transmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif";
+var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n #ifdef texture2DLodEXT\n return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n #else\n return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n #endif\n }\n vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( attenuationDistance == 0.0 ) {\n return radiance;\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n }\n#endif";
+var uv_pars_fragment = "#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n varying vec2 vUv;\n#endif";
+var uv_pars_vertex = "#ifdef USE_UV\n #ifdef UVS_VERTEX_ONLY\n vec2 vUv;\n #else\n varying vec2 vUv;\n #endif\n uniform mat3 uvTransform;\n#endif";
+var uv_vertex = "#ifdef USE_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif";
+var uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n varying vec2 vUv2;\n#endif";
+var uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n attribute vec2 uv2;\n varying vec2 vUv2;\n uniform mat3 uv2Transform;\n#endif";
+var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif";
+var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif";
+const vertex$g = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
+const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n gl_FragColor = texture2D( t2D, vUv );\n #include \n #include \n}";
+const vertex$f = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}";
+const fragment$f = "#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 vReflect = vWorldDirection;\n #include \n gl_FragColor = envColor;\n gl_FragColor.a *= opacity;\n #include \n #include \n}";
+const vertex$e = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n}";
+const fragment$e = "#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n vec4 diffuseColor = vec4( 1.0 );\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #endif\n}";
+const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}";
+const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n #include \n vec4 diffuseColor = vec4( 1.0 );\n #include \n #include \n #include \n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}";
+const vertex$c = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n}";
+const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include \n #include \n}";
+const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vLineDistance = scale * lineDistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}";
+const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}";
+const vertex$a = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}";
+const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel= texture2D( lightMap, vUv2 );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}";
+const vertex$9 = "#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}";
+const fragment$9 = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #ifdef DOUBLE_SIDED\n reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n #else\n reflectedLight.indirectDiffuse += vIndirectFront;\n #endif\n #include \n reflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n #ifdef DOUBLE_SIDED\n reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n #else\n reflectedLight.directDiffuse = vLightFront;\n #endif\n reflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}";
+const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include