storybook
Version:
Storybook: Develop, document, and test UI components in isolation
1,492 lines (1,432 loc) • 2.71 MB
JavaScript
import CJS_COMPAT_NODE_URL_q99y7iqlbzn from 'node:url';
import CJS_COMPAT_NODE_PATH_q99y7iqlbzn from 'node:path';
import CJS_COMPAT_NODE_MODULE_q99y7iqlbzn from "node:module";
var __filename = CJS_COMPAT_NODE_URL_q99y7iqlbzn.fileURLToPath(import.meta.url);
var __dirname = CJS_COMPAT_NODE_PATH_q99y7iqlbzn.dirname(__filename);
var require = CJS_COMPAT_NODE_MODULE_q99y7iqlbzn.createRequire(import.meta.url);
// ------------------------------------------------------------
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
// ------------------------------------------------------------
import {
resolvePackageDir
} from "./chunk-7N53RHGS.js";
import "./chunk-LMQEOO5W.js";
import {
require_gen_mapping_umd,
require_trace_mapping_umd
} from "./chunk-3RGO4AAD.js";
import {
__commonJS,
__name,
__require
} from "./chunk-MB5KTO7X.js";
// ../node_modules/lodash/_freeGlobal.js
var require_freeGlobal = __commonJS({
"../node_modules/lodash/_freeGlobal.js"(exports, module) {
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
module.exports = freeGlobal;
}
});
// ../node_modules/lodash/_root.js
var require_root = __commonJS({
"../node_modules/lodash/_root.js"(exports, module) {
var freeGlobal = require_freeGlobal();
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
var root = freeGlobal || freeSelf || Function("return this")();
module.exports = root;
}
});
// ../node_modules/lodash/_Symbol.js
var require_Symbol = __commonJS({
"../node_modules/lodash/_Symbol.js"(exports, module) {
var root = require_root();
var Symbol2 = root.Symbol;
module.exports = Symbol2;
}
});
// ../node_modules/lodash/_getRawTag.js
var require_getRawTag = __commonJS({
"../node_modules/lodash/_getRawTag.js"(exports, module) {
var Symbol2 = require_Symbol();
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
var nativeObjectToString = objectProto.toString;
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
try {
value[symToStringTag] = void 0;
var unmasked = true;
} catch (e) {
}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
__name(getRawTag, "getRawTag");
module.exports = getRawTag;
}
});
// ../node_modules/lodash/_objectToString.js
var require_objectToString = __commonJS({
"../node_modules/lodash/_objectToString.js"(exports, module) {
var objectProto = Object.prototype;
var nativeObjectToString = objectProto.toString;
function objectToString(value) {
return nativeObjectToString.call(value);
}
__name(objectToString, "objectToString");
module.exports = objectToString;
}
});
// ../node_modules/lodash/_baseGetTag.js
var require_baseGetTag = __commonJS({
"../node_modules/lodash/_baseGetTag.js"(exports, module) {
var Symbol2 = require_Symbol();
var getRawTag = require_getRawTag();
var objectToString = require_objectToString();
var nullTag = "[object Null]";
var undefinedTag = "[object Undefined]";
var symToStringTag = Symbol2 ? Symbol2.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);
}
__name(baseGetTag, "baseGetTag");
module.exports = baseGetTag;
}
});
// ../node_modules/lodash/isObject.js
var require_isObject = __commonJS({
"../node_modules/lodash/isObject.js"(exports, module) {
function isObject(value) {
var type = typeof value;
return value != null && (type == "object" || type == "function");
}
__name(isObject, "isObject");
module.exports = isObject;
}
});
// ../node_modules/lodash/isFunction.js
var require_isFunction = __commonJS({
"../node_modules/lodash/isFunction.js"(exports, module) {
var baseGetTag = require_baseGetTag();
var isObject = require_isObject();
var asyncTag = "[object AsyncFunction]";
var funcTag = "[object Function]";
var genTag = "[object GeneratorFunction]";
var proxyTag = "[object Proxy]";
function isFunction(value) {
if (!isObject(value)) {
return false;
}
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
__name(isFunction, "isFunction");
module.exports = isFunction;
}
});
// ../node_modules/lodash/_coreJsData.js
var require_coreJsData = __commonJS({
"../node_modules/lodash/_coreJsData.js"(exports, module) {
var root = require_root();
var coreJsData = root["__core-js_shared__"];
module.exports = coreJsData;
}
});
// ../node_modules/lodash/_isMasked.js
var require_isMasked = __commonJS({
"../node_modules/lodash/_isMasked.js"(exports, module) {
var coreJsData = require_coreJsData();
var maskSrcKey = function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
return uid ? "Symbol(src)_1." + uid : "";
}();
function isMasked(func) {
return !!maskSrcKey && maskSrcKey in func;
}
__name(isMasked, "isMasked");
module.exports = isMasked;
}
});
// ../node_modules/lodash/_toSource.js
var require_toSource = __commonJS({
"../node_modules/lodash/_toSource.js"(exports, module) {
var funcProto = Function.prototype;
var funcToString = funcProto.toString;
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {
}
try {
return func + "";
} catch (e) {
}
}
return "";
}
__name(toSource, "toSource");
module.exports = toSource;
}
});
// ../node_modules/lodash/_baseIsNative.js
var require_baseIsNative = __commonJS({
"../node_modules/lodash/_baseIsNative.js"(exports, module) {
var isFunction = require_isFunction();
var isMasked = require_isMasked();
var isObject = require_isObject();
var toSource = require_toSource();
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
var funcProto = Function.prototype;
var objectProto = Object.prototype;
var funcToString = funcProto.toString;
var hasOwnProperty = objectProto.hasOwnProperty;
var reIsNative = RegExp(
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
__name(baseIsNative, "baseIsNative");
module.exports = baseIsNative;
}
});
// ../node_modules/lodash/_getValue.js
var require_getValue = __commonJS({
"../node_modules/lodash/_getValue.js"(exports, module) {
function getValue(object, key) {
return object == null ? void 0 : object[key];
}
__name(getValue, "getValue");
module.exports = getValue;
}
});
// ../node_modules/lodash/_getNative.js
var require_getNative = __commonJS({
"../node_modules/lodash/_getNative.js"(exports, module) {
var baseIsNative = require_baseIsNative();
var getValue = require_getValue();
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : void 0;
}
__name(getNative, "getNative");
module.exports = getNative;
}
});
// ../node_modules/lodash/_nativeCreate.js
var require_nativeCreate = __commonJS({
"../node_modules/lodash/_nativeCreate.js"(exports, module) {
var getNative = require_getNative();
var nativeCreate = getNative(Object, "create");
module.exports = nativeCreate;
}
});
// ../node_modules/lodash/_hashClear.js
var require_hashClear = __commonJS({
"../node_modules/lodash/_hashClear.js"(exports, module) {
var nativeCreate = require_nativeCreate();
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
__name(hashClear, "hashClear");
module.exports = hashClear;
}
});
// ../node_modules/lodash/_hashDelete.js
var require_hashDelete = __commonJS({
"../node_modules/lodash/_hashDelete.js"(exports, module) {
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
__name(hashDelete, "hashDelete");
module.exports = hashDelete;
}
});
// ../node_modules/lodash/_hashGet.js
var require_hashGet = __commonJS({
"../node_modules/lodash/_hashGet.js"(exports, module) {
var nativeCreate = require_nativeCreate();
var HASH_UNDEFINED = "__lodash_hash_undefined__";
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? void 0 : result;
}
return hasOwnProperty.call(data, key) ? data[key] : void 0;
}
__name(hashGet, "hashGet");
module.exports = hashGet;
}
});
// ../node_modules/lodash/_hashHas.js
var require_hashHas = __commonJS({
"../node_modules/lodash/_hashHas.js"(exports, module) {
var nativeCreate = require_nativeCreate();
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
}
__name(hashHas, "hashHas");
module.exports = hashHas;
}
});
// ../node_modules/lodash/_hashSet.js
var require_hashSet = __commonJS({
"../node_modules/lodash/_hashSet.js"(exports, module) {
var nativeCreate = require_nativeCreate();
var HASH_UNDEFINED = "__lodash_hash_undefined__";
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
return this;
}
__name(hashSet, "hashSet");
module.exports = hashSet;
}
});
// ../node_modules/lodash/_Hash.js
var require_Hash = __commonJS({
"../node_modules/lodash/_Hash.js"(exports, module) {
var hashClear = require_hashClear();
var hashDelete = require_hashDelete();
var hashGet = require_hashGet();
var hashHas = require_hashHas();
var hashSet = require_hashSet();
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]);
}
}
__name(Hash, "Hash");
Hash.prototype.clear = hashClear;
Hash.prototype["delete"] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
}
});
// ../node_modules/lodash/_listCacheClear.js
var require_listCacheClear = __commonJS({
"../node_modules/lodash/_listCacheClear.js"(exports, module) {
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
__name(listCacheClear, "listCacheClear");
module.exports = listCacheClear;
}
});
// ../node_modules/lodash/eq.js
var require_eq = __commonJS({
"../node_modules/lodash/eq.js"(exports, module) {
function eq(value, other) {
return value === other || value !== value && other !== other;
}
__name(eq, "eq");
module.exports = eq;
}
});
// ../node_modules/lodash/_assocIndexOf.js
var require_assocIndexOf = __commonJS({
"../node_modules/lodash/_assocIndexOf.js"(exports, module) {
var eq = require_eq();
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
__name(assocIndexOf, "assocIndexOf");
module.exports = assocIndexOf;
}
});
// ../node_modules/lodash/_listCacheDelete.js
var require_listCacheDelete = __commonJS({
"../node_modules/lodash/_listCacheDelete.js"(exports, module) {
var assocIndexOf = require_assocIndexOf();
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;
}
__name(listCacheDelete, "listCacheDelete");
module.exports = listCacheDelete;
}
});
// ../node_modules/lodash/_listCacheGet.js
var require_listCacheGet = __commonJS({
"../node_modules/lodash/_listCacheGet.js"(exports, module) {
var assocIndexOf = require_assocIndexOf();
function listCacheGet(key) {
var data = this.__data__, index = assocIndexOf(data, key);
return index < 0 ? void 0 : data[index][1];
}
__name(listCacheGet, "listCacheGet");
module.exports = listCacheGet;
}
});
// ../node_modules/lodash/_listCacheHas.js
var require_listCacheHas = __commonJS({
"../node_modules/lodash/_listCacheHas.js"(exports, module) {
var assocIndexOf = require_assocIndexOf();
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
__name(listCacheHas, "listCacheHas");
module.exports = listCacheHas;
}
});
// ../node_modules/lodash/_listCacheSet.js
var require_listCacheSet = __commonJS({
"../node_modules/lodash/_listCacheSet.js"(exports, module) {
var assocIndexOf = require_assocIndexOf();
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;
}
__name(listCacheSet, "listCacheSet");
module.exports = listCacheSet;
}
});
// ../node_modules/lodash/_ListCache.js
var require_ListCache = __commonJS({
"../node_modules/lodash/_ListCache.js"(exports, module) {
var listCacheClear = require_listCacheClear();
var listCacheDelete = require_listCacheDelete();
var listCacheGet = require_listCacheGet();
var listCacheHas = require_listCacheHas();
var listCacheSet = require_listCacheSet();
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]);
}
}
__name(ListCache, "ListCache");
ListCache.prototype.clear = listCacheClear;
ListCache.prototype["delete"] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
}
});
// ../node_modules/lodash/_Map.js
var require_Map = __commonJS({
"../node_modules/lodash/_Map.js"(exports, module) {
var getNative = require_getNative();
var root = require_root();
var Map2 = getNative(root, "Map");
module.exports = Map2;
}
});
// ../node_modules/lodash/_mapCacheClear.js
var require_mapCacheClear = __commonJS({
"../node_modules/lodash/_mapCacheClear.js"(exports, module) {
var Hash = require_Hash();
var ListCache = require_ListCache();
var Map2 = require_Map();
function mapCacheClear() {
this.size = 0;
this.__data__ = {
"hash": new Hash(),
"map": new (Map2 || ListCache)(),
"string": new Hash()
};
}
__name(mapCacheClear, "mapCacheClear");
module.exports = mapCacheClear;
}
});
// ../node_modules/lodash/_isKeyable.js
var require_isKeyable = __commonJS({
"../node_modules/lodash/_isKeyable.js"(exports, module) {
function isKeyable(value) {
var type = typeof value;
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
}
__name(isKeyable, "isKeyable");
module.exports = isKeyable;
}
});
// ../node_modules/lodash/_getMapData.js
var require_getMapData = __commonJS({
"../node_modules/lodash/_getMapData.js"(exports, module) {
var isKeyable = require_isKeyable();
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
}
__name(getMapData, "getMapData");
module.exports = getMapData;
}
});
// ../node_modules/lodash/_mapCacheDelete.js
var require_mapCacheDelete = __commonJS({
"../node_modules/lodash/_mapCacheDelete.js"(exports, module) {
var getMapData = require_getMapData();
function mapCacheDelete(key) {
var result = getMapData(this, key)["delete"](key);
this.size -= result ? 1 : 0;
return result;
}
__name(mapCacheDelete, "mapCacheDelete");
module.exports = mapCacheDelete;
}
});
// ../node_modules/lodash/_mapCacheGet.js
var require_mapCacheGet = __commonJS({
"../node_modules/lodash/_mapCacheGet.js"(exports, module) {
var getMapData = require_getMapData();
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
__name(mapCacheGet, "mapCacheGet");
module.exports = mapCacheGet;
}
});
// ../node_modules/lodash/_mapCacheHas.js
var require_mapCacheHas = __commonJS({
"../node_modules/lodash/_mapCacheHas.js"(exports, module) {
var getMapData = require_getMapData();
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
__name(mapCacheHas, "mapCacheHas");
module.exports = mapCacheHas;
}
});
// ../node_modules/lodash/_mapCacheSet.js
var require_mapCacheSet = __commonJS({
"../node_modules/lodash/_mapCacheSet.js"(exports, module) {
var getMapData = require_getMapData();
function mapCacheSet(key, value) {
var data = getMapData(this, key), size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
__name(mapCacheSet, "mapCacheSet");
module.exports = mapCacheSet;
}
});
// ../node_modules/lodash/_MapCache.js
var require_MapCache = __commonJS({
"../node_modules/lodash/_MapCache.js"(exports, module) {
var mapCacheClear = require_mapCacheClear();
var mapCacheDelete = require_mapCacheDelete();
var mapCacheGet = require_mapCacheGet();
var mapCacheHas = require_mapCacheHas();
var mapCacheSet = require_mapCacheSet();
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]);
}
}
__name(MapCache, "MapCache");
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype["delete"] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
}
});
// ../node_modules/lodash/_setCacheAdd.js
var require_setCacheAdd = __commonJS({
"../node_modules/lodash/_setCacheAdd.js"(exports, module) {
var HASH_UNDEFINED = "__lodash_hash_undefined__";
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
__name(setCacheAdd, "setCacheAdd");
module.exports = setCacheAdd;
}
});
// ../node_modules/lodash/_setCacheHas.js
var require_setCacheHas = __commonJS({
"../node_modules/lodash/_setCacheHas.js"(exports, module) {
function setCacheHas(value) {
return this.__data__.has(value);
}
__name(setCacheHas, "setCacheHas");
module.exports = setCacheHas;
}
});
// ../node_modules/lodash/_SetCache.js
var require_SetCache = __commonJS({
"../node_modules/lodash/_SetCache.js"(exports, module) {
var MapCache = require_MapCache();
var setCacheAdd = require_setCacheAdd();
var setCacheHas = require_setCacheHas();
function SetCache(values) {
var index = -1, length = values == null ? 0 : values.length;
this.__data__ = new MapCache();
while (++index < length) {
this.add(values[index]);
}
}
__name(SetCache, "SetCache");
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
}
});
// ../node_modules/lodash/_baseFindIndex.js
var require_baseFindIndex = __commonJS({
"../node_modules/lodash/_baseFindIndex.js"(exports, module) {
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
while (fromRight ? index-- : ++index < length) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
__name(baseFindIndex, "baseFindIndex");
module.exports = baseFindIndex;
}
});
// ../node_modules/lodash/_baseIsNaN.js
var require_baseIsNaN = __commonJS({
"../node_modules/lodash/_baseIsNaN.js"(exports, module) {
function baseIsNaN(value) {
return value !== value;
}
__name(baseIsNaN, "baseIsNaN");
module.exports = baseIsNaN;
}
});
// ../node_modules/lodash/_strictIndexOf.js
var require_strictIndexOf = __commonJS({
"../node_modules/lodash/_strictIndexOf.js"(exports, module) {
function strictIndexOf(array, value, fromIndex) {
var index = fromIndex - 1, length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
__name(strictIndexOf, "strictIndexOf");
module.exports = strictIndexOf;
}
});
// ../node_modules/lodash/_baseIndexOf.js
var require_baseIndexOf = __commonJS({
"../node_modules/lodash/_baseIndexOf.js"(exports, module) {
var baseFindIndex = require_baseFindIndex();
var baseIsNaN = require_baseIsNaN();
var strictIndexOf = require_strictIndexOf();
function baseIndexOf(array, value, fromIndex) {
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
}
__name(baseIndexOf, "baseIndexOf");
module.exports = baseIndexOf;
}
});
// ../node_modules/lodash/_arrayIncludes.js
var require_arrayIncludes = __commonJS({
"../node_modules/lodash/_arrayIncludes.js"(exports, module) {
var baseIndexOf = require_baseIndexOf();
function arrayIncludes(array, value) {
var length = array == null ? 0 : array.length;
return !!length && baseIndexOf(array, value, 0) > -1;
}
__name(arrayIncludes, "arrayIncludes");
module.exports = arrayIncludes;
}
});
// ../node_modules/lodash/_arrayIncludesWith.js
var require_arrayIncludesWith = __commonJS({
"../node_modules/lodash/_arrayIncludesWith.js"(exports, module) {
function arrayIncludesWith(array, value, comparator) {
var index = -1, length = array == null ? 0 : array.length;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
__name(arrayIncludesWith, "arrayIncludesWith");
module.exports = arrayIncludesWith;
}
});
// ../node_modules/lodash/_cacheHas.js
var require_cacheHas = __commonJS({
"../node_modules/lodash/_cacheHas.js"(exports, module) {
function cacheHas(cache, key) {
return cache.has(key);
}
__name(cacheHas, "cacheHas");
module.exports = cacheHas;
}
});
// ../node_modules/lodash/_Set.js
var require_Set = __commonJS({
"../node_modules/lodash/_Set.js"(exports, module) {
var getNative = require_getNative();
var root = require_root();
var Set2 = getNative(root, "Set");
module.exports = Set2;
}
});
// ../node_modules/lodash/noop.js
var require_noop = __commonJS({
"../node_modules/lodash/noop.js"(exports, module) {
function noop() {
}
__name(noop, "noop");
module.exports = noop;
}
});
// ../node_modules/lodash/_setToArray.js
var require_setToArray = __commonJS({
"../node_modules/lodash/_setToArray.js"(exports, module) {
function setToArray(set) {
var index = -1, result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
__name(setToArray, "setToArray");
module.exports = setToArray;
}
});
// ../node_modules/lodash/_createSet.js
var require_createSet = __commonJS({
"../node_modules/lodash/_createSet.js"(exports, module) {
var Set2 = require_Set();
var noop = require_noop();
var setToArray = require_setToArray();
var INFINITY = 1 / 0;
var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values) {
return new Set2(values);
};
module.exports = createSet;
}
});
// ../node_modules/lodash/_baseUniq.js
var require_baseUniq = __commonJS({
"../node_modules/lodash/_baseUniq.js"(exports, module) {
var SetCache = require_SetCache();
var arrayIncludes = require_arrayIncludes();
var arrayIncludesWith = require_arrayIncludesWith();
var cacheHas = require_cacheHas();
var createSet = require_createSet();
var setToArray = require_setToArray();
var LARGE_ARRAY_SIZE = 200;
function baseUniq(array, iteratee, comparator) {
var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
} else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache();
} else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index], computed = iteratee ? iteratee(value) : value;
value = comparator || value !== 0 ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
} else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
__name(baseUniq, "baseUniq");
module.exports = baseUniq;
}
});
// ../node_modules/lodash/uniq.js
var require_uniq = __commonJS({
"../node_modules/lodash/uniq.js"(exports, module) {
var baseUniq = require_baseUniq();
function uniq(array) {
return array && array.length ? baseUniq(array) : [];
}
__name(uniq, "uniq");
module.exports = uniq;
}
});
// ../node_modules/html-webpack-plugin/lib/child-compiler.js
var require_child_compiler = __commonJS({
"../node_modules/html-webpack-plugin/lib/child-compiler.js"(exports, module) {
"use strict";
var HtmlWebpackChildCompiler = class {
static {
__name(this, "HtmlWebpackChildCompiler");
}
/**
*
* @param {string[]} templates
*/
constructor(templates) {
this.templates = templates;
this.compilationPromise;
this.compilationStartedTimestamp;
this.compilationEndedTimestamp;
this.fileDependencies = {
fileDependencies: [],
contextDependencies: [],
missingDependencies: []
};
}
/**
* Returns true if the childCompiler is currently compiling
*
* @returns {boolean}
*/
isCompiling() {
return !this.didCompile() && this.compilationStartedTimestamp !== void 0;
}
/**
* Returns true if the childCompiler is done compiling
*
* @returns {boolean}
*/
didCompile() {
return this.compilationEndedTimestamp !== void 0;
}
/**
* This function will start the template compilation
* once it is started no more templates can be added
*
* @param {import('webpack').Compilation} mainCompilation
* @returns {Promise<{[templatePath: string]: ChildCompilationTemplateResult}>}
*/
compileTemplates(mainCompilation) {
const webpack = mainCompilation.compiler.webpack;
const Compilation = webpack.Compilation;
const NodeTemplatePlugin = webpack.node.NodeTemplatePlugin;
const NodeTargetPlugin = webpack.node.NodeTargetPlugin;
const LoaderTargetPlugin = webpack.LoaderTargetPlugin;
const EntryPlugin = webpack.EntryPlugin;
if (this.compilationPromise) {
return this.compilationPromise;
}
const outputOptions = {
filename: "__child-[name]",
publicPath: "",
library: {
type: "var",
name: "HTML_WEBPACK_PLUGIN_RESULT"
},
scriptType: (
/** @type {'text/javascript'} */
"text/javascript"
),
iife: true
};
const compilerName = "HtmlWebpackCompiler";
const childCompiler = mainCompilation.createChildCompiler(
compilerName,
outputOptions,
[
// Compile the template to nodejs javascript
new NodeTargetPlugin(),
new NodeTemplatePlugin(),
new LoaderTargetPlugin("node"),
new webpack.library.EnableLibraryPlugin("var")
]
);
childCompiler.context = mainCompilation.compiler.context;
const temporaryTemplateNames = this.templates.map(
(template, index) => `__child-HtmlWebpackPlugin_${index}-${template}`
);
this.templates.forEach((template, index) => {
new EntryPlugin(
childCompiler.context,
"data:text/javascript,__webpack_public_path__ = __webpack_base_uri__ = htmlWebpackPluginPublicPath;",
`HtmlWebpackPlugin_${index}-${template}`
).apply(childCompiler);
new EntryPlugin(
childCompiler.context,
template,
`HtmlWebpackPlugin_${index}-${template}`
).apply(childCompiler);
});
childCompiler.options.module = { ...childCompiler.options.module };
childCompiler.options.module.parser = {
...childCompiler.options.module.parser
};
childCompiler.options.module.parser.javascript = {
...childCompiler.options.module.parser.javascript,
url: "relative"
};
this.compilationStartedTimestamp = (/* @__PURE__ */ new Date()).getTime();
this.compilationPromise = new Promise((resolve, reject) => {
const extractedAssets = [];
childCompiler.hooks.thisCompilation.tap(
"HtmlWebpackPlugin",
(compilation) => {
compilation.hooks.processAssets.tap(
{
name: "HtmlWebpackPlugin",
stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS
},
(assets) => {
temporaryTemplateNames.forEach((temporaryTemplateName) => {
if (assets[temporaryTemplateName]) {
extractedAssets.push(assets[temporaryTemplateName]);
compilation.deleteAsset(temporaryTemplateName);
}
});
}
);
}
);
childCompiler.runAsChild((err, entries, childCompilation) => {
const compiledTemplates = entries ? extractedAssets.map((asset) => asset.source()) : [];
if (entries && childCompilation) {
this.fileDependencies = {
fileDependencies: Array.from(childCompilation.fileDependencies),
contextDependencies: Array.from(
childCompilation.contextDependencies
),
missingDependencies: Array.from(
childCompilation.missingDependencies
)
};
}
if (childCompilation && childCompilation.errors && childCompilation.errors.length) {
const errorDetailsArray = [];
for (const error of childCompilation.errors) {
let message = error.message;
if (error.stack) {
message += "\n" + error.stack;
}
errorDetailsArray.push(message);
}
const errorDetails = errorDetailsArray.join("\n");
reject(new Error("Child compilation failed:\n" + errorDetails));
return;
}
if (err) {
reject(err);
return;
}
if (!childCompilation || !entries) {
reject(new Error("Empty child compilation"));
return;
}
const result = {};
const assets = {};
for (const asset of childCompilation.getAssets()) {
assets[asset.name] = { source: asset.source, info: asset.info };
}
compiledTemplates.forEach((templateSource, entryIndex) => {
result[this.templates[entryIndex]] = {
// TODO, can we have Buffer here?
content: (
/** @type {string} */
templateSource
),
hash: childCompilation.hash || "XXXX",
entry: entries[entryIndex],
assets
};
});
this.compilationEndedTimestamp = (/* @__PURE__ */ new Date()).getTime();
resolve(result);
});
});
return this.compilationPromise;
}
};
module.exports = {
HtmlWebpackChildCompiler
};
}
});
// ../node_modules/html-webpack-plugin/lib/cached-child-compiler.js
var require_cached_child_compiler = __commonJS({
"../node_modules/html-webpack-plugin/lib/cached-child-compiler.js"(exports, module) {
"use strict";
var { HtmlWebpackChildCompiler } = require_child_compiler();
var compilerMap = /* @__PURE__ */ new WeakMap();
var CachedChildCompilation = class {
static {
__name(this, "CachedChildCompilation");
}
/**
* @param {Compiler} compiler
*/
constructor(compiler) {
this.compiler = compiler;
if (compilerMap.has(compiler)) {
return;
}
const persistentChildCompilerSingletonPlugin = new PersistentChildCompilerSingletonPlugin();
compilerMap.set(compiler, persistentChildCompilerSingletonPlugin);
persistentChildCompilerSingletonPlugin.apply(compiler);
}
/**
* apply is called by the webpack main compiler during the start phase
* @param {string} entry
*/
addEntry(entry) {
const persistentChildCompilerSingletonPlugin = compilerMap.get(
this.compiler
);
if (!persistentChildCompilerSingletonPlugin) {
throw new Error(
"PersistentChildCompilerSingletonPlugin instance not found."
);
}
persistentChildCompilerSingletonPlugin.addEntry(entry);
}
getCompilationResult() {
const persistentChildCompilerSingletonPlugin = compilerMap.get(
this.compiler
);
if (!persistentChildCompilerSingletonPlugin) {
throw new Error(
"PersistentChildCompilerSingletonPlugin instance not found."
);
}
return persistentChildCompilerSingletonPlugin.getLatestResult();
}
/**
* Returns the result for the given entry
* @param {string} entry
* @returns {
| { mainCompilationHash: string, error: Error }
| { mainCompilationHash: string, compiledEntry: ChildCompilationTemplateResult }
}
*/
getCompilationEntryResult(entry) {
const latestResult = this.getCompilationResult();
const compilationResult = latestResult.compilationResult;
return "error" in compilationResult ? {
mainCompilationHash: latestResult.mainCompilationHash,
error: compilationResult.error
} : {
mainCompilationHash: latestResult.mainCompilationHash,
compiledEntry: compilationResult.compiledEntries[entry]
};
}
};
var PersistentChildCompilerSingletonPlugin = class _PersistentChildCompilerSingletonPlugin {
static {
__name(this, "PersistentChildCompilerSingletonPlugin");
}
/**
*
* @param {{fileDependencies: string[], contextDependencies: string[], missingDependencies: string[]}} fileDependencies
* @param {Compilation} mainCompilation
* @param {number} startTime
*/
static createSnapshot(fileDependencies, mainCompilation, startTime) {
return new Promise((resolve, reject) => {
mainCompilation.fileSystemInfo.createSnapshot(
startTime,
fileDependencies.fileDependencies,
fileDependencies.contextDependencies,
fileDependencies.missingDependencies,
// @ts-ignore
null,
(err, snapshot) => {
if (err) {
return reject(err);
}
resolve(snapshot);
}
);
});
}
/**
* Returns true if the files inside this snapshot
* have not been changed
*
* @param {Snapshot} snapshot
* @param {Compilation} mainCompilation
* @returns {Promise<boolean | undefined>}
*/
static isSnapshotValid(snapshot, mainCompilation) {
return new Promise((resolve, reject) => {
mainCompilation.fileSystemInfo.checkSnapshotValid(
snapshot,
(err, isValid) => {
if (err) {
reject(err);
}
resolve(isValid);
}
);
});
}
static watchFiles(mainCompilation, fileDependencies) {
Object.keys(fileDependencies).forEach((dependencyType) => {
fileDependencies[dependencyType].forEach((fileDependency) => {
mainCompilation[dependencyType].add(fileDependency);
});
});
}
constructor() {
this.compilationState = {
isCompiling: false,
isVerifyingCache: false,
entries: [],
compiledEntries: [],
mainCompilationHash: "initial",
compilationResult: {
dependencies: {
fileDependencies: [],
contextDependencies: [],
missingDependencies: []
},
compiledEntries: {}
}
};
}
/**
* apply is called by the webpack main compiler during the start phase
* @param {Compiler} compiler
*/
apply(compiler) {
let childCompilationResultPromise = Promise.resolve({
dependencies: {
fileDependencies: [],
contextDependencies: [],
missingDependencies: []
},
compiledEntries: {}
});
let mainCompilationHashOfLastChildRecompile = "";
let previousFileSystemSnapshot;
let compilationStartTime = (/* @__PURE__ */ new Date()).getTime();
compiler.hooks.make.tapAsync(
"PersistentChildCompilerSingletonPlugin",
(mainCompilation, callback) => {
if (this.compilationState.isCompiling || this.compilationState.isVerifyingCache) {
return callback(new Error("Child compilation has already started"));
}
compilationStartTime = (/* @__PURE__ */ new Date()).getTime();
this.compilationState = {
isCompiling: false,
isVerifyingCache: true,
previousEntries: this.compilationState.compiledEntries,
previousResult: this.compilationState.compilationResult,
entries: this.compilationState.entries
};
const isCacheValidPromise = this.isCacheValid(
previousFileSystemSnapshot,
mainCompilation
);
let cachedResult = childCompilationResultPromise;
childCompilationResultPromise = isCacheValidPromise.then(
(isCacheValid) => {
if (isCacheValid) {
return cachedResult;
}
const compiledEntriesPromise = this.compileEntries(
mainCompilation,
this.compilationState.entries
);
compiledEntriesPromise.then((childCompilationResult) => {
return _PersistentChildCompilerSingletonPlugin.createSnapshot(
childCompilationResult.dependencies,
mainCompilation,
compilationStartTime
);
}).then((snapshot) => {
previousFileSystemSnapshot = snapshot;
});
return compiledEntriesPromise;
}
);
mainCompilation.hooks.optimizeTree.tapAsync(
"PersistentChildCompilerSingletonPlugin",
(chunks, modules, callback2) => {
const handleCompilationDonePromise = childCompilationResultPromise.then((childCompilationResult) => {
this.watchFiles(
mainCompilation,
childCompilationResult.dependencies
);
});
handleCompilationDonePromise.then(
// @ts-ignore
() => callback2(null, chunks, modules),
callback2
);
}
);
mainCompilation.hooks.additionalAssets.tapAsync(
"PersistentChildCompilerSingletonPlugin",
(callback2) => {
const didRecompilePromise = Promise.all([
childCompilationResultPromise,
cachedResult
]).then(([childCompilationResult, cachedResult2]) => {
return cachedResult2 !== childCompilationResult;
});
const handleCompilationDonePromise = Promise.all([
childCompilationResultPromise,
didRecompilePromise
]).then(([childCompilationResult, didRecompile]) => {
if (didRecompile) {
mainCompilationHashOfLastChildRecompile = /** @type {string} */
mainCompilation.hash;
}
this.compilationState = {
isCompiling: false,
isVerifyingCache: false,
entries: this.compilationState.entries,
compiledEntries: this.compilationState.entries,
compilationResult: childCompilationResult,
mainCompilationHash: mainCompilationHashOfLastChildRecompile
};
});
handleCompilationDonePromise.then(() => callback2(null), callback2);
}
);
callback(null);
}
);
}
/**
* Add a new entry to the next compile run
* @param {string} entry
*/
addEntry(entry) {
if (this.compilationState.isCompiling || this.compilationState.isVerifyingCache) {
throw new Error(
"The child compiler has already started to compile. Please add entries before the main compiler 'make' phase has started or after the compilation is done."
);
}
if (this.compilationState.entries.indexOf(entry) === -1) {
this.compilationState.entries = [...this.compilationState.entries, entry];
}
}
getLatestResult() {
if (this.compilationState.isCompiling || this.compilationState.isVerifyingCache) {
throw new Error(
"The child compiler is not done compiling. Please access the result after the compiler 'make' phase has started or after the compilation is done."
);
}
return {
mainCompilationHash: this.compilationState.mainCompilationHash,
compilationResult: this.compilationState.compilationResult
};
}
/**
* Verify that the cache is still valid
* @private
* @param {Snapshot | undefined} snapshot
* @param {Compilation} mainCompilation
* @returns {Promise<boolean | undefined>}
*/
isCacheValid(snapshot, mainCompilation) {
if (!this.compilationState.isVerifyingCache) {
return Promise.reject(
new Error(
"Cache validation can only be done right before the compilation starts"
)
);
}
if (this.compilationState.entries.length === 0) {
return Promise.resolve(true);
}
if (this.compilationState.entries !== this.compilationState.previousEntries) {
return Promise.resolve(false);
}
if (!snapshot) {
return Promise.resolve(false);
}
return _PersistentChildCompilerSingletonPlugin.isSnapshotValid(
snapshot,
mainCompilation
);
}
/**
* Start to compile all templates
*
* @private
* @param {Compilation} mainCompilation
* @param {string[]} entries
* @returns {Promise<ChildCompilationResult>}
*/
compileEntries(mainCompilation, entries) {
const compiler = new HtmlWebpackChildCompiler(entries);
return compiler.compileTemplates(mainCompilation).then(
(result) => {
return {
// The compiled sources to render the content
compiledEntries: result,
// The file dependencies to find out if a
// recompilation is required
dependencies: compiler.fileDependencies,
// The main compilation hash can be used to find out
// if this compilation was done during the current compilation
mainCompilationHash: mainCompilation.hash
};
},
(error) => ({
// The compiled sources to render the content
error,
// The file dependencies to find out if a
// recompilation is required
dependencies: compiler.fileDependencies,
// The main compilation hash can be used to find out
// if this compilation was done during the current compilation
mainCompilationHash: mainCompilation.hash
})
);
}
/**
* @private
* @param {Compilation} mainCompilation
* @param {FileDependencies} files
*/
watchFiles(mainCompilation, files) {
_PersistentChildCompilerSingletonPlugin.watchFiles(mainCompilation, files);
}
};
module.exports = {
CachedChildCompilation
};
}
});
// ../node_modules/html-webpack-plugin/lib/html-tags.js
var require_html_tags = __commonJS({
"../node_modules/html-webpack-plugin/lib/html-tags.js"(exports, module) {
var voidTags = [
"area",
"base",
"br",
"col",
"embed",
"hr",
"img",
"input",
"keygen",
"link",
"meta",
"param",
"source",
"track",
"wbr"
];
function htmlTagObjectToString(tagDefinition, xhtml) {
const attributes = Object.keys(tagDefinition.attributes || {}).filter(function(attributeName) {
return tagDefinition.attributes[attributeName] === "" || tagDefinition.attributes[attributeName];
}).map(function(attributeName) {
if (tagDefinition.attributes[attributeName] === true) {
return xhtml ? attributeName + '="' + attributeName + '"' : attributeName;
}
return attributeName + '="' + tagDefinition.attributes[attributeName] + '"';
});
return "<" + [tagDefinition.tagName].concat(attributes).join(" ") + (tagDefinition.voidTag && xhtml ? "/" : "") + ">" + (tagDefinition.innerHTML || "") + (tagDefinition.voidTag ? "" : "</" + tagDefinition.tagName + ">");
}
__name(htmlTagObjectToString, "htmlTagObjectToString");
function createHtmlTagObject(tagName, attributes, innerHTML, meta) {
return {
tagName,
voidTag: voidTags.indexOf(tagName) !== -1,
attributes: attributes || {},
meta: meta || {},
innerHTML
};
}
__name(createHtmlTagObject, "createHtmlTagObject");
var HtmlTagArray = class extends Array {
static {
__name(this, "HtmlTagArray");
}
toString() {
return this.join("");
}
};
module.exports = {
HtmlTagArray,
createHtmlTagObject,
htmlTagObjectToString
};
}
});
// ../node_modules/lodash/_overArg.js
var require_overArg = __commonJS({
"../node_mod