123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014 |
- "use strict";
- var __defProp = Object.defineProperty;
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
- var __getOwnPropNames = Object.getOwnPropertyNames;
- var __hasOwnProp = Object.prototype.hasOwnProperty;
- var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
- };
- var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
- };
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
- // src/index.ts
- var src_exports = {};
- __export(src_exports, {
- createPopper: () => createPopper,
- offsetModifier: () => offset_default
- });
- module.exports = __toCommonJS(src_exports);
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindow.js
- function getWindow(node) {
- if (node == null) {
- return window;
- }
- if (node.toString() !== "[object Window]") {
- var ownerDocument = node.ownerDocument;
- return ownerDocument ? ownerDocument.defaultView || window : window;
- }
- return node;
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
- function isElement(node) {
- var OwnElement = getWindow(node).Element;
- return node instanceof OwnElement || node instanceof Element;
- }
- function isHTMLElement(node) {
- var OwnElement = getWindow(node).HTMLElement;
- return node instanceof OwnElement || node instanceof HTMLElement;
- }
- function isShadowRoot(node) {
- if (typeof ShadowRoot === "undefined") {
- return false;
- }
- var OwnElement = getWindow(node).ShadowRoot;
- return node instanceof OwnElement || node instanceof ShadowRoot;
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/math.js
- var round = Math.round;
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/userAgent.js
- function getUAString() {
- var uaData = navigator.userAgentData;
- if (uaData != null && uaData.brands) {
- return uaData.brands.map(function(item) {
- return item.brand + "/" + item.version;
- }).join(" ");
- }
- return navigator.userAgent;
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
- function isLayoutViewport() {
- return !/^((?!chrome|android).)*safari/i.test(getUAString());
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
- function getBoundingClientRect(element, includeScale, isFixedStrategy) {
- if (includeScale === void 0) {
- includeScale = false;
- }
- if (isFixedStrategy === void 0) {
- isFixedStrategy = false;
- }
- var clientRect = element.getBoundingClientRect();
- var scaleX = 1;
- var scaleY = 1;
- if (includeScale && isHTMLElement(element)) {
- scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
- scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
- }
- var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
- var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
- var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
- var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
- var width = clientRect.width / scaleX;
- var height = clientRect.height / scaleY;
- return {
- width,
- height,
- top: y,
- right: x + width,
- bottom: y + height,
- left: x,
- x,
- y
- };
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
- function getWindowScroll(node) {
- var win = getWindow(node);
- var scrollLeft = win.pageXOffset;
- var scrollTop = win.pageYOffset;
- return {
- scrollLeft,
- scrollTop
- };
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
- function getHTMLElementScroll(element) {
- return {
- scrollLeft: element.scrollLeft,
- scrollTop: element.scrollTop
- };
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
- function getNodeScroll(node) {
- if (node === getWindow(node) || !isHTMLElement(node)) {
- return getWindowScroll(node);
- } else {
- return getHTMLElementScroll(node);
- }
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
- function getNodeName(element) {
- return element ? (element.nodeName || "").toLowerCase() : null;
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
- function getDocumentElement(element) {
- return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
- function getWindowScrollBarX(element) {
- return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
- function getComputedStyle(element) {
- return getWindow(element).getComputedStyle(element);
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
- function isScrollParent(element) {
- var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
- function isElementScaled(element) {
- var rect = element.getBoundingClientRect();
- var scaleX = round(rect.width) / element.offsetWidth || 1;
- var scaleY = round(rect.height) / element.offsetHeight || 1;
- return scaleX !== 1 || scaleY !== 1;
- }
- function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
- if (isFixed === void 0) {
- isFixed = false;
- }
- var isOffsetParentAnElement = isHTMLElement(offsetParent);
- var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
- var documentElement = getDocumentElement(offsetParent);
- var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
- var scroll = {
- scrollLeft: 0,
- scrollTop: 0
- };
- var offsets = {
- x: 0,
- y: 0
- };
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
- if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
- scroll = getNodeScroll(offsetParent);
- }
- if (isHTMLElement(offsetParent)) {
- offsets = getBoundingClientRect(offsetParent, true);
- offsets.x += offsetParent.clientLeft;
- offsets.y += offsetParent.clientTop;
- } else if (documentElement) {
- offsets.x = getWindowScrollBarX(documentElement);
- }
- }
- return {
- x: rect.left + scroll.scrollLeft - offsets.x,
- y: rect.top + scroll.scrollTop - offsets.y,
- width: rect.width,
- height: rect.height
- };
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
- function getLayoutRect(element) {
- var clientRect = getBoundingClientRect(element);
- var width = element.offsetWidth;
- var height = element.offsetHeight;
- if (Math.abs(clientRect.width - width) <= 1) {
- width = clientRect.width;
- }
- if (Math.abs(clientRect.height - height) <= 1) {
- height = clientRect.height;
- }
- return {
- x: element.offsetLeft,
- y: element.offsetTop,
- width,
- height
- };
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
- function getParentNode(element) {
- if (getNodeName(element) === "html") {
- return element;
- }
- return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
- function getScrollParent(node) {
- if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
- return node.ownerDocument.body;
- }
- if (isHTMLElement(node) && isScrollParent(node)) {
- return node;
- }
- return getScrollParent(getParentNode(node));
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
- function listScrollParents(element, list) {
- var _element$ownerDocumen;
- if (list === void 0) {
- list = [];
- }
- var scrollParent = getScrollParent(element);
- var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
- var win = getWindow(scrollParent);
- var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
- var updatedList = list.concat(target);
- return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
- function isTableElement(element) {
- return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
- function getTrueOffsetParent(element) {
- if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
- return null;
- }
- return element.offsetParent;
- }
- function getContainingBlock(element) {
- var isFirefox = /firefox/i.test(getUAString());
- var isIE = /Trident/i.test(getUAString());
- if (isIE && isHTMLElement(element)) {
- var elementCss = getComputedStyle(element);
- if (elementCss.position === "fixed") {
- return null;
- }
- }
- var currentNode = getParentNode(element);
- if (isShadowRoot(currentNode)) {
- currentNode = currentNode.host;
- }
- while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
- var css = getComputedStyle(currentNode);
- if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
- return currentNode;
- } else {
- currentNode = currentNode.parentNode;
- }
- }
- return null;
- }
- function getOffsetParent(element) {
- var window2 = getWindow(element);
- var offsetParent = getTrueOffsetParent(element);
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
- offsetParent = getTrueOffsetParent(offsetParent);
- }
- if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
- return window2;
- }
- return offsetParent || getContainingBlock(element) || window2;
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/enums.js
- var top = "top";
- var bottom = "bottom";
- var right = "right";
- var left = "left";
- var auto = "auto";
- var basePlacements = [top, bottom, right, left];
- var start = "start";
- var end = "end";
- var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
- return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
- }, []);
- var beforeRead = "beforeRead";
- var read = "read";
- var afterRead = "afterRead";
- var beforeMain = "beforeMain";
- var main = "main";
- var afterMain = "afterMain";
- var beforeWrite = "beforeWrite";
- var write = "write";
- var afterWrite = "afterWrite";
- var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/orderModifiers.js
- function order(modifiers) {
- var map = /* @__PURE__ */ new Map();
- var visited = /* @__PURE__ */ new Set();
- var result = [];
- modifiers.forEach(function(modifier) {
- map.set(modifier.name, modifier);
- });
- function sort(modifier) {
- visited.add(modifier.name);
- var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
- requires.forEach(function(dep) {
- if (!visited.has(dep)) {
- var depModifier = map.get(dep);
- if (depModifier) {
- sort(depModifier);
- }
- }
- });
- result.push(modifier);
- }
- modifiers.forEach(function(modifier) {
- if (!visited.has(modifier.name)) {
- sort(modifier);
- }
- });
- return result;
- }
- function orderModifiers(modifiers) {
- var orderedModifiers = order(modifiers);
- return modifierPhases.reduce(function(acc, phase) {
- return acc.concat(orderedModifiers.filter(function(modifier) {
- return modifier.phase === phase;
- }));
- }, []);
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/debounce.js
- function debounce(fn2) {
- var pending;
- return function() {
- if (!pending) {
- pending = new Promise(function(resolve) {
- Promise.resolve().then(function() {
- pending = void 0;
- resolve(fn2());
- });
- });
- }
- return pending;
- };
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/format.js
- function format(str) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- return [].concat(args).reduce(function(p, c) {
- return p.replace(/%s/, c);
- }, str);
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/validateModifiers.js
- var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
- var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
- var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
- function validateModifiers(modifiers) {
- modifiers.forEach(function(modifier) {
- [].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index, self) {
- return self.indexOf(value) === index;
- }).forEach(function(key) {
- switch (key) {
- case "name":
- if (typeof modifier.name !== "string") {
- console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"'));
- }
- break;
- case "enabled":
- if (typeof modifier.enabled !== "boolean") {
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"'));
- }
- break;
- case "phase":
- if (modifierPhases.indexOf(modifier.phase) < 0) {
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"'));
- }
- break;
- case "fn":
- if (typeof modifier.fn !== "function") {
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"'));
- }
- break;
- case "effect":
- if (modifier.effect != null && typeof modifier.effect !== "function") {
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"'));
- }
- break;
- case "requires":
- if (modifier.requires != null && !Array.isArray(modifier.requires)) {
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"'));
- }
- break;
- case "requiresIfExists":
- if (!Array.isArray(modifier.requiresIfExists)) {
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"'));
- }
- break;
- case "options":
- case "data":
- break;
- default:
- console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s) {
- return '"' + s + '"';
- }).join(", ") + '; but "' + key + '" was provided.');
- }
- modifier.requires && modifier.requires.forEach(function(requirement) {
- if (modifiers.find(function(mod) {
- return mod.name === requirement;
- }) == null) {
- console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
- }
- });
- });
- });
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/uniqueBy.js
- function uniqueBy(arr, fn2) {
- var identifiers = /* @__PURE__ */ new Set();
- return arr.filter(function(item) {
- var identifier = fn2(item);
- if (!identifiers.has(identifier)) {
- identifiers.add(identifier);
- return true;
- }
- });
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getBasePlacement.js
- function getBasePlacement(placement) {
- return placement.split("-")[0];
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/mergeByName.js
- function mergeByName(modifiers) {
- var merged = modifiers.reduce(function(merged2, current) {
- var existing = merged2[current.name];
- merged2[current.name] = existing ? Object.assign({}, existing, current, {
- options: Object.assign({}, existing.options, current.options),
- data: Object.assign({}, existing.data, current.data)
- }) : current;
- return merged2;
- }, {});
- return Object.keys(merged).map(function(key) {
- return merged[key];
- });
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getVariation.js
- function getVariation(placement) {
- return placement.split("-")[1];
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
- function getMainAxisFromPlacement(placement) {
- return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/computeOffsets.js
- function computeOffsets(_ref) {
- var reference = _ref.reference, element = _ref.element, placement = _ref.placement;
- var basePlacement = placement ? getBasePlacement(placement) : null;
- var variation = placement ? getVariation(placement) : null;
- var commonX = reference.x + reference.width / 2 - element.width / 2;
- var commonY = reference.y + reference.height / 2 - element.height / 2;
- var offsets;
- switch (basePlacement) {
- case top:
- offsets = {
- x: commonX,
- y: reference.y - element.height
- };
- break;
- case bottom:
- offsets = {
- x: commonX,
- y: reference.y + reference.height
- };
- break;
- case right:
- offsets = {
- x: reference.x + reference.width,
- y: commonY
- };
- break;
- case left:
- offsets = {
- x: reference.x - element.width,
- y: commonY
- };
- break;
- default:
- offsets = {
- x: reference.x,
- y: reference.y
- };
- }
- var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
- if (mainAxis != null) {
- var len = mainAxis === "y" ? "height" : "width";
- switch (variation) {
- case start:
- offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
- break;
- case end:
- offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
- break;
- default:
- }
- }
- return offsets;
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/createPopper.js
- var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.";
- var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.";
- var DEFAULT_OPTIONS = {
- placement: "bottom",
- modifiers: [],
- strategy: "absolute"
- };
- function areValidElements() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return !args.some(function(element) {
- return !(element && typeof element.getBoundingClientRect === "function");
- });
- }
- function popperGenerator(generatorOptions) {
- if (generatorOptions === void 0) {
- generatorOptions = {};
- }
- var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
- return function createPopper2(reference, popper, options) {
- if (options === void 0) {
- options = defaultOptions;
- }
- var state = {
- placement: "bottom",
- orderedModifiers: [],
- options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
- modifiersData: {},
- elements: {
- reference,
- popper
- },
- attributes: {},
- styles: {}
- };
- var effectCleanupFns = [];
- var isDestroyed = false;
- var instance = {
- state,
- setOptions: function setOptions(setOptionsAction) {
- var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
- cleanupModifierEffects();
- state.options = Object.assign({}, defaultOptions, state.options, options2);
- state.scrollParents = {
- reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
- popper: listScrollParents(popper)
- };
- var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
- state.orderedModifiers = orderedModifiers.filter(function(m) {
- return m.enabled;
- });
- if (true) {
- var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) {
- var name = _ref.name;
- return name;
- });
- validateModifiers(modifiers);
- if (getBasePlacement(state.options.placement) === auto) {
- var flipModifier = state.orderedModifiers.find(function(_ref2) {
- var name = _ref2.name;
- return name === "flip";
- });
- if (!flipModifier) {
- console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
- }
- }
- var _getComputedStyle = getComputedStyle(popper), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft;
- if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) {
- return parseFloat(margin);
- })) {
- console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
- }
- }
- runModifierEffects();
- return instance.update();
- },
- forceUpdate: function forceUpdate() {
- if (isDestroyed) {
- return;
- }
- var _state$elements = state.elements, reference2 = _state$elements.reference, popper2 = _state$elements.popper;
- if (!areValidElements(reference2, popper2)) {
- if (true) {
- console.error(INVALID_ELEMENT_ERROR);
- }
- return;
- }
- state.rects = {
- reference: getCompositeRect(reference2, getOffsetParent(popper2), state.options.strategy === "fixed"),
- popper: getLayoutRect(popper2)
- };
- state.reset = false;
- state.placement = state.options.placement;
- state.orderedModifiers.forEach(function(modifier) {
- return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
- });
- var __debug_loops__ = 0;
- for (var index = 0; index < state.orderedModifiers.length; index++) {
- if (true) {
- __debug_loops__ += 1;
- if (__debug_loops__ > 100) {
- console.error(INFINITE_LOOP_ERROR);
- break;
- }
- }
- if (state.reset === true) {
- state.reset = false;
- index = -1;
- continue;
- }
- var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
- if (typeof fn2 === "function") {
- state = fn2({
- state,
- options: _options,
- name,
- instance
- }) || state;
- }
- }
- },
- update: debounce(function() {
- return new Promise(function(resolve) {
- instance.forceUpdate();
- resolve(state);
- });
- }),
- destroy: function destroy() {
- cleanupModifierEffects();
- isDestroyed = true;
- }
- };
- if (!areValidElements(reference, popper)) {
- if (true) {
- console.error(INVALID_ELEMENT_ERROR);
- }
- return instance;
- }
- instance.setOptions(options).then(function(state2) {
- if (!isDestroyed && options.onFirstUpdate) {
- options.onFirstUpdate(state2);
- }
- });
- function runModifierEffects() {
- state.orderedModifiers.forEach(function(_ref3) {
- var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect3 = _ref3.effect;
- if (typeof effect3 === "function") {
- var cleanupFn = effect3({
- state,
- name,
- instance,
- options: options2
- });
- var noopFn = function noopFn2() {
- };
- effectCleanupFns.push(cleanupFn || noopFn);
- }
- });
- }
- function cleanupModifierEffects() {
- effectCleanupFns.forEach(function(fn2) {
- return fn2();
- });
- effectCleanupFns = [];
- }
- return instance;
- };
- }
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/eventListeners.js
- var passive = {
- passive: true
- };
- function effect(_ref) {
- var state = _ref.state, instance = _ref.instance, options = _ref.options;
- var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
- var window2 = getWindow(state.elements.popper);
- var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
- if (scroll) {
- scrollParents.forEach(function(scrollParent) {
- scrollParent.addEventListener("scroll", instance.update, passive);
- });
- }
- if (resize) {
- window2.addEventListener("resize", instance.update, passive);
- }
- return function() {
- if (scroll) {
- scrollParents.forEach(function(scrollParent) {
- scrollParent.removeEventListener("scroll", instance.update, passive);
- });
- }
- if (resize) {
- window2.removeEventListener("resize", instance.update, passive);
- }
- };
- }
- var eventListeners_default = {
- name: "eventListeners",
- enabled: true,
- phase: "write",
- fn: function fn() {
- },
- effect,
- data: {}
- };
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
- function popperOffsets(_ref) {
- var state = _ref.state, name = _ref.name;
- state.modifiersData[name] = computeOffsets({
- reference: state.rects.reference,
- element: state.rects.popper,
- strategy: "absolute",
- placement: state.placement
- });
- }
- var popperOffsets_default = {
- name: "popperOffsets",
- enabled: true,
- phase: "read",
- fn: popperOffsets,
- data: {}
- };
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/computeStyles.js
- var unsetSides = {
- top: "auto",
- right: "auto",
- bottom: "auto",
- left: "auto"
- };
- function roundOffsetsByDPR(_ref) {
- var x = _ref.x, y = _ref.y;
- var win = window;
- var dpr = win.devicePixelRatio || 1;
- return {
- x: round(x * dpr) / dpr || 0,
- y: round(y * dpr) / dpr || 0
- };
- }
- function mapToStyles(_ref2) {
- var _Object$assign2;
- var popper = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
- var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
- var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
- x,
- y
- }) : {
- x,
- y
- };
- x = _ref3.x;
- y = _ref3.y;
- var hasX = offsets.hasOwnProperty("x");
- var hasY = offsets.hasOwnProperty("y");
- var sideX = left;
- var sideY = top;
- var win = window;
- if (adaptive) {
- var offsetParent = getOffsetParent(popper);
- var heightProp = "clientHeight";
- var widthProp = "clientWidth";
- if (offsetParent === getWindow(popper)) {
- offsetParent = getDocumentElement(popper);
- if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
- heightProp = "scrollHeight";
- widthProp = "scrollWidth";
- }
- }
- offsetParent = offsetParent;
- if (placement === top || (placement === left || placement === right) && variation === end) {
- sideY = bottom;
- var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
- y -= offsetY - popperRect.height;
- y *= gpuAcceleration ? 1 : -1;
- }
- if (placement === left || (placement === top || placement === bottom) && variation === end) {
- sideX = right;
- var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
- x -= offsetX - popperRect.width;
- x *= gpuAcceleration ? 1 : -1;
- }
- }
- var commonStyles = Object.assign({
- position
- }, adaptive && unsetSides);
- var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
- x,
- y
- }) : {
- x,
- y
- };
- x = _ref4.x;
- y = _ref4.y;
- if (gpuAcceleration) {
- var _Object$assign;
- return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
- }
- return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
- }
- function computeStyles(_ref5) {
- var state = _ref5.state, options = _ref5.options;
- var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
- if (true) {
- var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || "";
- if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) {
- return transitionProperty.indexOf(property) >= 0;
- })) {
- console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
- }
- }
- var commonStyles = {
- placement: getBasePlacement(state.placement),
- variation: getVariation(state.placement),
- popper: state.elements.popper,
- popperRect: state.rects.popper,
- gpuAcceleration,
- isFixed: state.options.strategy === "fixed"
- };
- if (state.modifiersData.popperOffsets != null) {
- state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
- offsets: state.modifiersData.popperOffsets,
- position: state.options.strategy,
- adaptive,
- roundOffsets
- })));
- }
- if (state.modifiersData.arrow != null) {
- state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
- offsets: state.modifiersData.arrow,
- position: "absolute",
- adaptive: false,
- roundOffsets
- })));
- }
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
- "data-popper-placement": state.placement
- });
- }
- var computeStyles_default = {
- name: "computeStyles",
- enabled: true,
- phase: "beforeWrite",
- fn: computeStyles,
- data: {}
- };
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/applyStyles.js
- function applyStyles(_ref) {
- var state = _ref.state;
- Object.keys(state.elements).forEach(function(name) {
- var style = state.styles[name] || {};
- var attributes = state.attributes[name] || {};
- var element = state.elements[name];
- if (!isHTMLElement(element) || !getNodeName(element)) {
- return;
- }
- Object.assign(element.style, style);
- Object.keys(attributes).forEach(function(name2) {
- var value = attributes[name2];
- if (value === false) {
- element.removeAttribute(name2);
- } else {
- element.setAttribute(name2, value === true ? "" : value);
- }
- });
- });
- }
- function effect2(_ref2) {
- var state = _ref2.state;
- var initialStyles = {
- popper: {
- position: state.options.strategy,
- left: "0",
- top: "0",
- margin: "0"
- },
- arrow: {
- position: "absolute"
- },
- reference: {}
- };
- Object.assign(state.elements.popper.style, initialStyles.popper);
- state.styles = initialStyles;
- if (state.elements.arrow) {
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
- }
- return function() {
- Object.keys(state.elements).forEach(function(name) {
- var element = state.elements[name];
- var attributes = state.attributes[name] || {};
- var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
- var style = styleProperties.reduce(function(style2, property) {
- style2[property] = "";
- return style2;
- }, {});
- if (!isHTMLElement(element) || !getNodeName(element)) {
- return;
- }
- Object.assign(element.style, style);
- Object.keys(attributes).forEach(function(attribute) {
- element.removeAttribute(attribute);
- });
- });
- };
- }
- var applyStyles_default = {
- name: "applyStyles",
- enabled: true,
- phase: "write",
- fn: applyStyles,
- effect: effect2,
- requires: ["computeStyles"]
- };
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/popper-lite.js
- var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default];
- var createPopper = /* @__PURE__ */ popperGenerator({
- defaultModifiers
- });
- // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/offset.js
- function distanceAndSkiddingToXY(placement, rects, offset2) {
- var basePlacement = getBasePlacement(placement);
- var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
- var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
- placement
- })) : offset2, skidding = _ref[0], distance = _ref[1];
- skidding = skidding || 0;
- distance = (distance || 0) * invertDistance;
- return [left, right].indexOf(basePlacement) >= 0 ? {
- x: distance,
- y: skidding
- } : {
- x: skidding,
- y: distance
- };
- }
- function offset(_ref2) {
- var state = _ref2.state, options = _ref2.options, name = _ref2.name;
- var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
- var data = placements.reduce(function(acc, placement) {
- acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
- return acc;
- }, {});
- var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
- if (state.modifiersData.popperOffsets != null) {
- state.modifiersData.popperOffsets.x += x;
- state.modifiersData.popperOffsets.y += y;
- }
- state.modifiersData[name] = data;
- }
- var offset_default = {
- name: "offset",
- enabled: true,
- phase: "main",
- requires: ["popperOffsets"],
- fn: offset
- };
|